Artificial Intelligence

What is Retrieval-Augmented Generation?

Quick answer

A technique that improves AI answers by first retrieving relevant documents and then giving them to a language model as context.

Retrieval-Augmented Generation, explained

Large language models only know what was in their training data, which can be outdated or lack private information. Retrieval-augmented generation (RAG) adds a search step. When a user asks a question, the system finds relevant passages from a knowledge base, such as company documents or blog articles, and includes them in the prompt so the model can answer based on that material.

A typical RAG pipeline splits documents into chunks, converts them into embeddings, stores them in a vector database, and retrieves the closest matches for each query. RAG can reduce hallucinations, keep answers current without retraining, and allow citations to sources. Its quality depends heavily on good document preparation and retrieval accuracy.

Related terms

Guides that mention Retrieval-Augmented Generation