▶ 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-upTime 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
- Read PDFs and split them into chunks
- Embed the chunks and store them in a vector database
- For each question: retrieve, build a grounded prompt and answer with sources
- Test it with a small evaluation set
Setup
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
Step 2: Embed and store
Step 3: Retrieve and answer
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.
Share with a friend