Grounding and evaluation / 5 of 8
Retrieval-Augmented Generation
What you’ll learn
- Explain the main idea of “Retrieval-Augmented Generation” in your own words.
- Trace a concrete example and identify the assumptions behind it.
- Apply the principle in a practice problem and recognize a common failure.
The idea, intuitively
RAG retrieves external information and supplies it as context for generation. It can improve access to domain evidence without retraining weights, but success requires both useful retrieval and faithful use of the evidence.
A working AI product is more than a successful prompt. Its data flow, authorization, error behavior, and evaluation determine whether users can rely on it. This school teaches architecture and implementation decisions; it does not require an inference provider or secretly send your learning data to a service.
Under the hood
A typical pipeline chunks documents, embeds and indexes them, retrieves candidates, optionally reranks, and builds a grounded prompt. Evaluate retrieval separately from answer quality so failures can be located.
Retrieved content is untrusted data and can contain prompt injection.
A worked example
For a policy question, retrieve the relevant policy version and cite its section. A stale but similar document can produce a polished wrong answer.
How to use this way of thinking
Draw the path from user input to evidence, model invocation, validation, and final action. Define a useful fallback for each failure point. Start with a small representative evaluation set, then inspect real failure modes before adding more infrastructure or orchestration.
Try it yourself
The answer is wrong. How do you separate retrieval and generation failures?
Key takeaways
- No, it changes the invocation context
- Retrieved content is untrusted data and can contain prompt injection.
- Check the assumptions with a small example before applying this idea to a larger system.
Check your understanding
Use feedback to learn. Quiz scores and lesson completion are tracked separately.
Go to lesson completionFurther reading
Original papers and reference material for this school. External resources may be in English and require internet access.
Google: Rules of Machine Learning (opens a new tab)Sentence Transformers documentation (opens a new tab)Finish this lesson
Mark this lesson complete when you’re ready to continue.