Fig. 2 — Retrieval, detail at larger scale
What gets fetched and stuffed in beside it. Only the top few survive ranking.
Key plan — part 2 on Fig. 1Figure 2 — the parts of this course, as links to their lessons
What the detail shows
- Before any question is asked, the corpus is built along the top: content is pulled out of the source system, parsed into text, cut into chunks, and one chunk at a time goes through the embedding model, which turns it into a vector.
- The vector drops into the store. Inside the store is an index — points with edges between them, which is what an approximate search walks instead of reading every vector.
- A chunk carries its permissions in with it, as a tag on the chunk rather than a check done later.
- A query comes in at the bottom left and is rewritten before it is used.
- The rewritten query splits in two: a keyword search and a semantic search, running side by side and reading the same store.
- On the way out, a gate narrows the results by their metadata, before anything is ranked.
- Five candidates fan out. The reranker is one blade across all five, because it reads them against the query rather than scoring each on its own. Two do not survive: they are struck through and drawn weak.
- The three that do converge into the top-k line and go up into the context window.
- If that was not enough, a line runs back from the top-k to the rewrite, and the query is asked again differently.
- A dotted line runs from the context window all the way back to the chunk the answer came from. That is the citation, and it carries nothing.
- A second dotted tap on the top-k line reads the dial: did retrieval find the right thing at all, measured on its own and never through the answer.
Schedule of lessons
23 lessons
- Embeddings
6 lessons · 43 min
- What an embedding really is
Text as a point in space, and an honest list of what that buys you and what it costs you.
- Choosing an embedding model
The five axes that decide it, and why the leaderboard is a filter rather than an answer.
- From source system to corpus
Extraction is the bottleneck, not the embedding call - because the content still lives inside someone else's system.
- Parsing documents before you chunk them
The step chunking assumes already happened - turning a scanned page, a multi-column PDF, or a table into text worth splitting.
- Chunking
Cutting documents into the units you actually retrieve, and the cheap header line to try first.
- Giving each chunk its context
A chunk cut out of its document forgets what it refers to, and there are five ways to put that back, from free to one model call per chunk.
- What an embedding really is
- Storing vectors
6 lessons · 43 min
- Vector databases
What one actually is, and the ladder of options you should climb only as far as you need to.
- Indexes and the trade you are making
Approximate search, the knobs that control it, and how to prove you tuned it well enough.
- Metadata and filtering
The half of retrieval that is not semantic, including the half that is a security boundary.
- Permissions that travel with the data
Getting who-can-see-what into the index, keeping it true as it changes upstream, and asking the source before anything reaches the model.
- Changing the embedding model underneath a live index
Two vectors from two different models are not comparable numbers, so the swap is a migration, not a config change.
- Keeping the index fresh without paying twice
Hash every span and let only real text edits reach the embedder: a permission flip is a patch, and a delete is a removal.
- Vector databases
- Retrieval
7 lessons · 54 min
- Hybrid search
Run keyword search next to vector search and fuse the two ranked lists, so exact strings stop falling through the cracks.
- Reranking
Retrieve fifty candidates cheaply, then have a slower model read query and passage together and pick the best five.
- Late interaction: one vector per token
Keep a small vector for every token and let each word of the query find its best match, instead of squeezing a passage into one point.
- Retrieving pages as images
Skip the parser and embed a picture of each page, so a chart can be found by what it shows and not only by the words printed near it.
- Query rewriting
Fix the query before you search - expand it, split it, turn it into a fake answer, or make a follow-up stand on its own.
- Iterative retrieval
Search, read, decide whether you have enough, search again - for the questions where you cannot name your second query until you have seen the first answer.
- Retrieval as a tool the agent calls
Hand the model a search tool and let it decide when to search and what to ask, then cap the rounds and keep the results lean.
- Hybrid search
- Proving it works
4 lessons · 29 min
- Measuring retrieval
Build a fifty-query eval set by hand, score recall@k, MRR and nDCG on retrieval alone, and tell a real gain from noise.
- Measuring the whole answer
Run the same questions with no documents, your retrieval and the right documents, then read the gaps to see what to fix first.
- Citations and grounding
Give every chunk an id, require the answer to cite it, then check the quoted span really appears where the model said it did.
- When RAG is the wrong tool
Recognise the questions retrieval structurally cannot answer, and pick the tool that can.
- Measuring retrieval
Notes
Your answer can never be better than what you retrieved. Embeddings, vector stores, chunking, hybrid search, reranking, late interaction and agent-driven search - the whole pipeline, and how to tell which part of it is letting you down.
Every figure on this sheet is counted from the lessons themselves. Your progress is kept in this browser only — no account, nothing sent anywhere.