Retrieval-augmented generation (RAG)
Also known as: RAG, retrieval augmented generation
In short
Retrieval-augmented generation is a technique where a system retrieves relevant documents and places them in a language model's context, so the model answers from those sources rather than from memory alone. It is how AI answers come to have citations, and how live information reaches a frozen model.
The pipeline, step by step
- Query understanding. The question is interpreted and often expanded into several narrower research queries.
- Retrieval. Candidate documents are fetched — usually by semantic similarity, sometimes by keyword, often both.
- Selection. A small number of passages are chosen to fit the model's context window. This is a much harsher filter than retrieval.
- Generation. The model writes an answer using those passages.
- Attribution. Citations are attached to the sources used.
Steps two and three are where visibility is won or lost. Retrieval decides whether you are a candidate; selection decides whether you make the cut.
Why passages, not pages
RAG operates on chunks. A long page is split into segments and each is retrieved independently, which means a page can be pulled in on the strength of one good section and ignored entirely despite being excellent overall.
This is the technical reason behind the writing advice that runs through this glossary: make each section self-contained, lead with the answer, and put the point in the first sentence. A chunk that reads coherently on its own competes; one that depends on the paragraph above it does not — see passage retrieval.
What it does not fix
RAG reduces hallucination but does not remove it. A model can still misread a retrieved source, merge two sources incorrectly, or attach a citation to a document that does not support the claim. Grounded answers are checkable, which is genuinely valuable — but checkable is not the same as correct.
Frequently asked questions
- What is the difference between RAG and grounding?
- Grounding is the property you want — an answer anchored to verifiable sources. RAG is the dominant technique for achieving it. In everyday use the terms are often interchangeable, but grounding describes the goal and RAG describes the plumbing.
- Why do AI products use RAG instead of retraining?
- Retraining is slow and expensive; retrieval is instant and cheap. RAG lets a model answer about something published this morning without touching the model, and it produces citations as a by-product, which retraining does not.
- Does RAG mean my content can influence AI answers?
- Yes, and that is the whole reason AI visibility is actionable. The retrieval step runs fresh on every question, so what gets retrieved today is decided by today's web rather than by a training run months ago.
Related terms
- Grounding (AI)
Grounding is the practice of connecting a language model's answer to specific external sources retrieved at answer time, rather than relying on what the model memorised during training. A grounded answer can cite where each claim came from, which is what makes citations — and therefore AI visibility — possible at all.
- Large language model (LLM)
A large language model is a neural network trained on very large amounts of text to predict likely continuations of language. That single capability produces answering, summarising and writing. It is the component underneath ChatGPT, Claude, Gemini and the AI features inside search engines.
- Semantic search
Semantic search matches queries to content by meaning rather than by matching words. Text is converted into vectors — numerical representations where similar meanings sit close together — so a query can retrieve a passage that answers it without sharing any of its vocabulary.
- Passage retrieval
Passage retrieval is the practice of splitting documents into sections and retrieving and ranking those sections independently, rather than treating a page as one unit. It is why a long page can be pulled into an answer on the strength of one paragraph, and ignored despite being strong overall.
Related guides
- Generative Engine Optimization (GEO): the complete guide
GEO is the practice of getting your brand named and cited inside AI answers. What it is, how it differs from SEO, and the levers that measurably work.