Skip to content
All terms
Glossary

RAG (Retrieval-Augmented Generation)

A technique where a language model first retrieves the relevant passages from your own documents, then bases its answer on them.

A language model knows nothing about your company. It has never seen your contracts or your manuals, and asked anyway, it will invent a plausible-sounding answer. Retrieval-augmented generation fixes this by inverting the order: the passages that match the question are found in your documents first, and only then handed to the model along with the question.

The decisive side effect is traceability. Because it is known which passages fed the answer, every statement can ship with its source. In regulated environments that is not a convenience feature but the condition under which the output may be used at all - a summary nobody can check against the file is not a basis for a decision.

RAG is often weighed against fine-tuning, though the two solve different problems. Fine-tuning changes how a model answers: tone, format, domain language. RAG changes what it can answer about. If your knowledge changes weekly, RAG is the right choice, because a new document takes effect immediately instead of triggering a new training run.

In practice RAG systems rarely fail at the model and almost always at the retrieval step before it. If the wrong passages come back, the best model does not help - it just states the wrong basis more convincingly. That is where the work sits: how documents are split, how search copes with jargon and abbreviations, and what happens when nothing relevant exists. A system that then says "no basis found" is worth more than one that guesses.

The service behind it

AI & Automation