RAG (Retrieval-Augmented Generation)
AI Engineer path · lesson 74 of 124Run retrieve → augment → generate as an animated pipeline, see why grounding beats a frozen model when facts change, peek at the offline indexing half, and diagnose where RAG breaks.
— context not assembled yet —
…answers once context is retrieved.
Key insight
RAG doesn’t change the model’s weights — it puts the right evidence in the prompt at query time. The answer is grounded, current, and citable. Its ceiling is retrieval quality: the generator can only be as good as the chunks it’s given.
Trace a RAG request
Order what happens when a question arrives.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
- 1Drop a step here
- 2Drop a step here
- 3Drop a step here
- 4Drop a step here
- 5Drop a step here
- 6Drop a step here
Test your knowledge
What are the three core steps of RAG?
The short version
RAG is an open-book exam: instead of memorizing everything (retraining), the student looks up the relevant pages at question time and answers from them — citing the page.
In more depth
RAG
RAG gives a frozen model fresh, private knowledge without retraining. At query time you retrieve relevant chunks (vector search), augment the prompt with them, and generate a grounded, citable answer. Because the output is built from retrieved text, hallucination drops and knowledge stays current. The quality ceiling is retrieval — bad chunks, bad answer.
Interview Questions
References & Further Reading
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required