core Estimated learning time: 8 h

8.7 Retrieval-augmented generation

You can ground a model in a document set and cite sources.

Before:07. Natural Language ProcessingUnlocks:09. Agentic AI12. Frontier Topics

RAG grounds a model in your documents: chunk, retrieve, rerank, assemble context, enforce citations — the standard architecture for question answering over private data. It sits at the centre of the LLM module as the flagship pattern. The evaluation habit is the lesson: measure retrieval quality separately from generation quality, because when the answer is wrong you must know whether the system failed to find the truth or found it and ignored it.

Work through these

  • Chunking strategies and overlap

    How documents are cut into pieces decides what can be retrieved, and pieces that overlap avoid cutting an idea in half. This is the least glamorous and most consequential decision in the topic.

  • Retrieval, reranking and context assembly

    Finding candidates, reordering them with a more careful model, and assembling what fits into the request. Each stage can be improved independently.

  • Citation and grounding enforcement

    Requiring the answer to point at the retrieved material is what makes it checkable by the reader. Without it, retrieval becomes decoration.

  • Measuring retrieval quality separately from generation

    If retrieval fails, no amount of generation quality can rescue the answer, so the two must be measured separately. Conflating them is why many systems are debugged in the wrong place.

Sign in to keep your progress.

Free resources

Links last checked 29 Aug 2026.

Stuck here?

Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.

Checking your session…

Topics shown in module order.