Retrieval-Augmented Generation (RAG)
Also known as: Retrieval-Augmented Generation, Retrieval Augmented Generation
Fetch relevant docs at inference time and stuff them into the prompt so the model can answer from real data.
A pattern that augments an LLM with an external retrieval step: relevant documents are fetched from a knowledge base and injected into the prompt context, reducing hallucination and grounding responses in real data.
In practice
Default architecture for LLM apps that need fresh or domain-specific knowledge. Expect deep questions on chunking, retrieval quality, and the read-vs-write trade-off versus fine-tuning.
How it compares
RAG injects context at inference time without changing weights; fine-tuning bakes knowledge into the weights.
Comparisons that include Retrieval-Augmented Generation (RAG)
Related topics
Practice questions
Related terms
Embeddings
Dense numeric vectors that capture meaning; close vectors = similar text.
Vector Database
A database tuned for fast approximate nearest-neighbor search over millions of high-dimensional vectors.
Chunking
Cutting documents into retrievable pieces before embedding them.
Context Window
The max number of tokens a model can attend to at once.
Hallucination
When a model confidently makes up something that isn't true.
AI System Design
End-to-end design of production LLM systems: ingestion, retrieval, serving, eval, monitoring.