AI Base

Course 09 of 10

RAG

Retrieval-augmented generation: grounding a model in real documents, from chunking and embeddings to retrieval, generation and evaluation.

9 chapters · 48 lessons · builds on LLMs · About this course

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

  1. 1Parametric vs. Non-Parametric Knowledge 4 min
  2. 2Hallucination and Knowledge Cutoff 5 min
  3. 3RAG vs. Fine-Tuning vs. Long-Context 5 min
  4. 4Anatomy of a RAG Pipeline 5 min
02Document Processing and Chunking6 lessons
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

  1. 1Bi-Encoders and Dense Embeddings 4 min
  2. 2Cross-Encoders and Re-Rankers 4 min
  3. 3Domain-Adapting Embedding Models 4 min
  4. 4Multi-Vector and Late-Interaction Retrieval 4 min
  5. 5Embedding Quantization for Retrieval 4 min
04Vector Search and Indexing5 lessons
05Retrieval Strategies6 lessons
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

  1. 1Re-Ranking Retrieved Results 4 min
  2. 2Self-RAG and Reflective Retrieval 4 min
  3. 3Corrective RAG 4 min
  4. 4Graph-Based RAG 4 min
  5. 5Retrieval over Structured Data 4 min
  6. 6Multimodal RAG 4 min
07Generation with Retrieved Context5 lessons
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

  1. 1Retrieval Metrics: Precision, Recall, MRR and NDCG 5 min
  2. 2Faithfulness and Answer Relevancy Metrics 4 min
  3. 3End-to-End RAG Evaluation Frameworks 4 min
  4. 4Common RAG Failure Modes 5 min
  5. 5Synthetic Test-Set Generation for RAG 4 min
  6. 6A-B and Online Evaluation of RAG 5 min
09RAG in Practice5 lessons
RAG glossaryEvery key term from this course in one alphabetical list. Next course · 10Agents