Skip to content
AI

RAG

Retrieval-Augmented Generation

RAG pairs a language model with an external knowledge base queried in real time, so answers are grounded in specific sources instead of relying only on the model's memory.

Before answering, the system retrieves the most relevant passages from a document base, often a vector database, then feeds them to the model as context. The model generates its answer from those excerpts.

RAG reduces hallucinations and allows answers to cite verifiable sources. It's the technique behind most AI assistants that respond with links, and well structured content has a better chance of being retrieved.