Chapter 21

21Retrieval-Augmented Generation

Draft pending — this page is an outline of planned content. Write it by creating content/rag.md.

21.1Why retrieval at all

Planned: Knowledge cutoff, private data, and grounding to reduce hallucination.

Planned: Dense retrieval; cosine similarity; the ANN index in one picture.

Planned: The unglamorous engineering that makes or breaks RAG; BM25 + dense.

21.4Evaluating and failing gracefully

Planned: Faithfulness vs relevance; what to do when retrieval returns nothing good.

21.5Long context vs retrieval

Planned: When a big context window replaces RAG, and when it doesn't.