IT Vizag
← How LLMs Really Work

▶ Sign up free for the video, slides & prompts

The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.

Checking…

How LLMs Really Work · Lesson 15 of 15 · 2 min read · 6 min video

Project: a RAG chatbot over your PDFs

Build a working question-answering bot over your own documents, end to end.

📄 Download slides (PDF)· free sign-up

Time to put the course together. You'll build a chatbot that answers questions about your own PDFs, such as a college handbook or a company policy, with citations. It runs in Google Colab or on your laptop.

What you'll build

  1. Read PDFs and split them into chunks
  2. Embed the chunks and store them in a vector database
  3. For each question: retrieve, build a grounded prompt and answer with sources
  4. Test it with a small evaluation set

Setup

🔒 Code example: sign up free (above) to unlock it.

Set your API key as an environment variable (OPENAI_API_KEY). Any provider with chat and embedding models works with small changes.

Step 1: Load and chunk

🔒 Code example: sign up free (above) to unlock it.

Step 2: Embed and store

🔒 Code example: sign up free (above) to unlock it.

Step 3: Retrieve and answer

🔒 Code example: sign up free (above) to unlock it.

Step 4: Evaluate

Write 15 to 20 real questions with the expected answer and source page. Include two or three whose answer is not in the PDFs. For each one, check:

  • Was the right page in the retrieved chunks?
  • Is the answer correct and cited?
  • Did it say "I don't know" when it should?

Step 5: Improve

  • Answers miss details? Try smaller chunks or more results (k)
  • Wrong sections retrieved? Add the section heading to each chunk
  • Codes and names not found? Add keyword search alongside (hybrid)
  • Then wrap it in a simple web UI with Streamlit or Gradio and share it

Show it off

Push the code to GitHub with a README: what it does, a screenshot, your evaluation results and what you'd improve next. It's a strong portfolio project for AI engineer roles.

In one line

Chunk, embed, store, retrieve, answer with citations, and evaluate: that's a real RAG app, and you've now built every piece of it.

Saved on this device. Sign in to keep progress everywhere.

Share with a friend