Retrieval-augmented generation (RAG)
Definition
Retrieval-augmented generation is a method in which relevant company documents are searched first and the retrieved passages are given to the language model as context. The model answers from those passages, which makes answers current, source-linked and auditable.
RAG is the standard way to make a model useful on internal knowledge — price lists, contracts, technical manuals, past correspondence — without retraining anything.
Quality depends on the retrieval layer, not the model: how documents are split, how they are indexed, how access rights are enforced, and whether the answer cites the passage it used.
In practice
- Keeps answers tied to a named source document and version
- Respects per-user access rights when the index is built correctly
- Cheaper and faster to update than fine-tuning
Related terms
- Vector databaseA vector database stores text, images or records as numeric embeddings and finds the entries closest in meaning to a query. It is the search layer behind retrieval-augmented generation, enabling semantic lookups where keyword search fails.
- Large language model (LLM)A large language model is a statistical model trained on very large text corpora that predicts likely continuations of text. It can classify, summarise, translate and draft, and it is the reasoning component inside most AI agents — but it holds no live company data by itself.
- HallucinationA hallucination is a confident but false output from a language model — an invented figure, clause or reference. It is a property of statistical text generation, which is why production systems verify outputs against source data instead of trusting them.