Definition
Retrieval-augmented generation (RAG) is a technique where an AI system first retrieves relevant passages from a knowledge base and then has a language model answer using those passages, usually citing them.
How it works
- Documents are split into passages and indexed, often as embeddings in a vector database.
- A question is matched to the most relevant passages, then reranked.
- A model writes the answer from those passages and cites them.
Why it is popular
Answers stay current without retraining, sources can be shown, and permissions can be enforced at retrieval time.