Course 09 of 10
RAG
Retrieval-augmented generation: grounding a model in real documents, from chunking and embeddings to retrieval, generation and evaluation.
01Why Retrieval and Grounding4 lessons
A model's weights are a fixed snapshot of what it learned during training — they can't be updated with this morning's news or a document it's never seen. Chapter overview
02Document Processing and Chunking6 lessons
Before anything can be retrieved, raw documents — PDFs, web pages, spreadsheets, code — have to become a collection of individually retrievable pieces. Chapter overview
03Embeddings for Retrieval5 lessons
Turning a chunk of text into a vector is already covered in Math; this section is about the retrieval-specific engineering on top of that: which kind of model produces the vector, how to make it… Chapter overview
04Vector Search and Indexing5 lessons
Once a collection has a few million chunks, each with its own embedding, finding the handful nearest to a query vector stops being a problem you can solve by checking every single one. Chapter overview
05Retrieval Strategies6 lessons
Having a fast index doesn't yet say what to search it with. Chapter overview
06Advanced RAG Patterns6 lessons
The basic retrieve-then-generate loop has limits: it trusts whatever came back from a single search, treats every document the same whether it's prose or a spreadsheet, and has no way to notice… Chapter overview
07Generation with Retrieved Context5 lessons
Retrieval only hands a model raw material; what the model does with that material is a separate problem. Chapter overview
08Evaluating RAG Systems6 lessons
A RAG system can fail in two independent places — retrieval can find the wrong passages, or generation can answer badly even from the right ones — and a single end-to-end score can't tell you which. Chapter overview
09RAG in Practice5 lessons
Everything in this subject so far has covered one piece of a RAG system at a time. Chapter overview