Week 3 · Session 3 · 2 hours

Agents That Read

An LLM only knows what it was trained on — not your notes, your school handbook, or last week’s news. Today you give an agent the power to look things up in your own documents, using embeddings and a vector database. You’ll leave saying: “It answered from MY documents, with a citation.”

Begin →
Today you will

Three real wins

🔢

Embed text

Turn sentences into vectors, so “meaning” becomes math you can search.

🧩

Build a vector store

Chunk a document, index it in FAISS/Chroma, and retrieve by similarity.

📚

Answer with sources

Feed retrieved chunks to the LLM so every answer cites where it came from.

RAG pipeline: QUERY to RETRIEVE (from document chunks and a vector database) to AUGMENT to LLM to ANSWER
RAG: retrieve → augment → generate — grounded, citable answers.
RAG in one line: RETRIEVE the most relevant chunks of your documents, then AUGMENT the prompt with them, so the model GENERATES a grounded, citable answer instead of guessing.
The Arc · check each off as you go in Colab (NB3)

Your step-by-step for today

See it work

Retrieval, live: pick a question, tune top-k

Here’s a tiny “vector store” of 6 chunks from a school handbook. Choose a question and slide k — the number of chunks retrieved. Watch which chunks the agent would hand to the LLM, ranked by similarity.

🔎 Watch the tradeoff. Too small a k and you miss the answer; too large and you drown the model in noise (and burn tokens). Retrieval quality is chunking + embeddings + k — all three matter.
Checkpoint

Did the idea land?

Why does RAG reduce hallucination?

Law #3: an agent that can’t look it up will make it up. RAG puts the source in front of the model so it can quote instead of guess.

Two chunks both mention “the deadline” but only one is about your question. What decides which ranks higher?

Retrieval ranks by vector similarity — distance in meaning-space, not keywords or length. That’s why embeddings matter.
Lock it in

Law, badge, and this week’s mission

Law #3 · Week 3
An agent that can’t look it up will make it up.

Retrieval beats hallucination. Ground answers in real documents — and cite them.

📚

Badge earned: Retriever

You built a RAG agent over your own documents that answers with a real citation.

🎯 Mission before Week 4
  • Point your RAG agent at a document you care about (a game wiki, a club handbook, your class notes).
  • Find one question where a bad chunk gives a wrong answer. Fix it by re-chunking or changing k. Bring the before/after.
Next: Many Minds → Week 4