Stage 2 · Teens · Working with LLMs

Retrieval-Augmented Generation

Grounding model outputs in external knowledge at query time.

LLMs only "know" what was in their training data, and that has a cutoff date. Retrieval-Augmented Generation (RAG) solves this by fetching relevant external documents at query time and inserting them into the prompt as context.

Retrieval-Augmented Generation (RAG)
User question
Search / retriever
vector similarity
Retrieved documents
top-k chunks
LLM
question + documents in context
Grounded answer
User asks a question

Step through how a question becomes a grounded answer.

All lessons in Stage 2: How AI works