RAG and grounding
Retrieve relevant evidence and ask the model to answer from it with visible sources.
- 12 minutes
- intermediate
- Reviewed 2026-07-16
What is it?
Retrieval-augmented generation searches source material, places selected passages in context, and asks a model to answer using them.
Why does it matter?
It can use current private knowledge without retraining the model and can show where an answer came from.
The mental model
Retrieval finds evidence; grounding keeps the answer tied to that evidence.
A simple example
A policy assistant retrieves two relevant sections, answers the employee question, and cites both document titles.
What it is not
RAG does not train the model, guarantee truth, or fix poor source material. Retrieval can miss the right passage and models can misuse it.
Learn this first
These ideas make the lesson easier to place.
- Context engineering
- Search
Your first 60 minutes
Use one focused hour to make the idea concrete.
- Choose five short source documents.
- Create three questions with known answers.
- Retrieve evidence, require citations, and test a question with no evidence.
Build this first
Build a small grounded FAQ that declines when no source supports the answer.
When not to use it
Use ordinary filters or keyword search when the corpus is small and exact wording is reliable. Do not add vector infrastructure by habit.
What to learn next
Learn embeddings and evaluation.