Retrieval augmented generation
Retrieval augmented generation, or RAG, is a method in which the system searches a defined knowledge base for relevant passages before answering and hands them to the language model together with the question. The model then writes from text in front of it rather than from memory, and every claim carries a source a person can check. The bottleneck is almost never the model, it is retrieval: what is not found does not exist as far as the answer is concerned.
What does retrieval augmented generation mean?
Retrieval augmented generation is a method in which a system searches a defined knowledge base for relevant passages before answering and passes them to the language model along with the question, so that the answer is built from text at hand rather than from model memory.
The term gets confused with three other ways of getting knowledge into an AI system. They differ in effort, freshness and verifiability:
| Approach | How knowledge gets in | Freshness | When it fits |
|---|---|---|---|
| Retrieval augmented generation | Documents are retrieved at run time and passed along | Immediate, as soon as the document is updated | Knowledge changes, evidence is required |
| Fine-tuning | Model weights are further trained on examples | Frozen at training time | Style, format and task patterns must stick |
| Context in the prompt | Text is pasted into the request by hand | Always current, but manual | One-offs, small volume, no operation |
| Classic search | The person reads the hits themselves | Immediate | Nothing needs writing, something needs finding |
The most expensive misconception is that fine-tuning teaches the model your product data. Fine-tuning shapes behaviour and form. Anyone expecting current factual knowledge that changes next week needs retrieval, not training.
We find that RAG models generate more specific, diverse and factual language than a state-of-the-art parametric-only baseline.
Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, NeurIPS 2020
What the flow actually looks like
RAG is not a product, it is a chain of five steps. Each of them can ruin the answer, and four of them have nothing to do with the language model.
In sales, such a chain typically covers three jobs. It answers questions about your own offering without anyone digging through a shared drive. It supplies the basis for drafts by pulling the trigger event and the matching reference. And it condenses call notes into preparation that points at specific sentences from earlier meetings. In all three, the real value is not the wording but the traceability: the proposed claim sits next to the document it came from, and the reviewer decides in seconds instead of minutes.
There are cases where building it is not worth it. If your knowledge base is five documents everybody already knows, the effort exceeds the benefit. If the answers should come from structured fields, contract terms or revenue figures for instance, an ordinary query is more precise and cheaper than a text search followed by generation. And if the sources themselves are contradictory, unmaintained and ownerless, RAG only makes that state visible faster. That, incidentally, is the most common quiet benefit of such a project: it exposes the true condition of your own documentation.
-
Step 1, the knowledge base.
You decide which documents count at all: product material, pricing logic, reference texts, call notes, the CRM. What is not in here cannot be cited later. What is in here twice shows up later as a contradiction.
-
Step 2, chunking.
Documents are cut into passages. Chunks that are too large dilute the search; chunks that are too small tear context apart. Tables inside PDFs are the classic case where chunking destroys the answer before anyone has asked a question.
-
Step 3, search.
Retrieval runs on semantic similarity, usually combined with a classic keyword search. That combination matters more than it sounds: product names, part numbers and proper nouns are found reliably by keyword search and missed regularly by pure semantic search.
-
Step 4, hand-off.
The best passages go to the model with the question, plus the instruction to answer only from them and to claim nothing where coverage is missing.
-
Step 5, an answer with citations.
Every claim carries a pointer to document, section and date. Without that pointer, RAG is just a more complicated way of guessing, because nobody reading the answer can tell whether it came from the source.
Use case 1: the source was right, it just was not valid any more
Constructed example scenario, not a client case. A maintenance contract vendor builds a knowledge base for its sales team. Everything on the shared drive goes in: proposal templates, service descriptions, technical sheets. From day one the answers are convincing and carry a source.
Six weeks later a rep commits to a response time that has not existed in that form for two years. The source existed, it was cited correctly, and it was an archived 2023 version. The case became expensive because the commitment was in writing.
The cause was missing curation, not missing technology. The fix was three rules: every document carries a validity date and a status, superseded versions are removed from the knowledge base rather than renamed, and the answer shows the source date next to the claim. Since then an outdated source is visible in the answer before it reaches a proposal.
Use case 2: the system could do it, it just never found it
Constructed example scenario, not a client case. A team sets up an assistant to answer questions about product variants. Two weeks in, the mood is poor: many questions return "I have nothing on that", although the information demonstrably sits in the knowledge base. The debate is about the model and about switching vendors.
Measurement says something else. Across 30 real questions, the correct passage was among the retrieved hits only about half the time. The cause was chunking: the variants lived in PDF tables that fell apart on import into row fragments with no column headers. A passage reading "variant C, 400 mm" with no context is almost invisible to a semantic search.
The fix touched only the data side: tables were imported structurally, every passage received the document title and heading as a header line, and the search gained a keyword component. The model stayed the same. What stood out was how quickly the vendor-switching debate disappeared afterwards.
What a dependable RAG chain requires
| Component | Concrete target | Common failure |
|---|---|---|
| Source selection | Deliberately curated knowledge base with an owner | Dumping the whole shared drive in |
| Chunking | Passages along document structure, tables kept structured | Fixed character length across everything |
| Metadata | Title, date, validity, access right per passage | Bare text with no provenance |
| Search method | Semantic search combined with keyword search | Vector search only, proper nouns lost |
| Hand-off volume | Few good passages instead of many mediocre ones | Stuffing the context and hoping |
| Citation display | Pointer with date next to the claim | A source list at the end with no mapping |
| Empty answer | "Nothing on that" is a permitted result | Falling back to memory when coverage fails |
| Permissions | Retrieval respects the asker's access rights | One knowledge base, everyone sees everything |
| Measurement | Retrieval hit rate measured separately from answer quality | User sentiment only |
A one-hour diagnostic for your team
This order shows within about an hour where your chain breaks.
-
Collect 30 real questions from daily sales work, not invented ones
For each, note which document holds the answer.
-
Ask them and log one thing only
was the correct passage among the retrieved hits? That hit rate is your actual metric.
-
Only then judge the wording
A poor answer on a correct hit is a model or instruction problem; everything else is data work.
-
Look for duplicates and superseded versions
Two documents with contradictory claims produce random answers depending on which one ranks first.
-
Check what the system does when coverage is missing
If it writes something anyway, the most important instruction in the chain is absent.
-
Check permissions
can someone reach content through a question that they could not open in the file system?
Blog and articles
More terms
- Glossary
EU AI Act
The EU AI Act is Regulation (EU) 2024/1689. It classifies AI systems by risk and attaches different duties to each tier. Three points matter for…
- Glossary
Hallucination
A hallucination is a language model output that reads as fluent and confident but is not supported by any source. It is not a defect, it is the…
- Glossary
Human-in-the-loop
Human-in-the-loop describes a working model in which an AI system researches, scores and drafts, while a named person approves every output that…
- Glossary
Training data
Training data is the set of examples a model derives its patterns from. In sales that usually means your own history: won and lost opportunities,…