Eight stages, one diagram. Know what each stage is for and what breaks when it is skipped.
A language model knows what it was trained on: public text, frozen at a cutoff. It does not know the listing that went live an hour ago, a client's visit history, or the clause on page 31 of a signed contract. RAG bolts a second memory on: at question time, retrieve the relevant pieces from an index of that private, current data and hand them to the model as context. Lewis et al. named the pattern in 2020: parametric memory (the model) plus non-parametric memory (a retrieved index).[1]
offline, per document change: INGEST -> CHUNK -> EMBED -> INDEX
online, per question: QUERY -> RETRIEVE -> RERANK -> GENERATE
The offline half runs whenever data changes; the online half runs per question, in a few hundred milliseconds. Every stage exists because skipping it produces a specific, recognisable failure - the cheat sheet lists all eight. Two examples: skip chunking and you index 40-page contracts whole, so retrieval returns documents nobody can fit in a prompt; skip rerank and the right chunk sits at rank 18 where the generator never uses it.
"What did the buyer of Kortrijksesteenweg 12 agree about the completion date?"
Everything the answer can possibly contain was decided before generation. That is the central discipline of RAG: the generator can only be as good as what retrieval hands it.
A single retrieve-then-generate pass is a workflow: predictable, cheap, debuggable. Reach for an agentic loop (the model deciding to search again, reformulate, or drill into a document) only when single-pass quality measurably falls short - Anthropic's guidance on workflows versus agents applies directly.[2] This course builds the single loop well first.
Do these from memory, before scrolling up.
Read the abstract and section 2 of Lewis et al. 2020 - ten minutes, and the vocabulary of every later paper comes from it. All sources are annotated in RESOURCES.md.
Anything unclear? Ask your teaching agent - it wrote this lesson and can go deeper on any point.