Retrieval-augmented generation (RAG) means an AI looks things up before it answers: it retrieves relevant pages or documents, then writes the answer from them. It is why live AI search can cite a page published after the model was trained.
This term is part of our guide to improving AI search visibility. Updated 24 November 2026.
What is retrieval-augmented generation?
A plain language model only knows what was in its training data, up to its knowledge cutoff. RAG adds a lookup step. Before answering, the system searches a collection of documents, picks the passages that match the question, and gives them to the model along with the question. The model then writes its answer from those passages.
The term comes from a 2020 paper by Patrick Lewis and colleagues. They described RAG models as ones “which combine pre-trained parametric and non-parametric memory for language generation”. In plain words: the model’s own learned knowledge, plus a searchable store. In their version, the store was “a dense vector index of Wikipedia, accessed with a pre-trained neural retriever”.
How does RAG work, step by step?
- The question comes in, for example “Which accounting software suits a 10-person firm?”
- The system turns it into one or more searches. Google says its AI features may run several related searches across subtopics, which it calls query fan-out.
- It retrieves matching passages: web pages for an AI search tool, or internal files for a company chatbot.
- The passages are added to the model’s input next to the question.
- The model writes the answer from them and, in most AI search tools, links the sources it used.
How is RAG different from fine-tuning or training?
| Training or fine-tuning | Retrieval-augmented generation |
|---|
| What changes | The model itself | The material handed to the model per question |
|---|
| How fast new facts get in | Only with a new model version | As soon as the page can be found |
|---|
| Can it cite where a fact came from? | No | Yes, the retrieved source |
|---|
| Who can influence it | Model makers choose the data; your pages count only if they were in it | Anyone who publishes a page the retriever finds |
|---|
Why can AI search cite pages newer than the model?
Because the page reaches the model at answer time, not training time. A model trained months ago knows nothing published since its cutoff, but when ChatGPT search, Perplexity, Claude with web search or Google’s AI features retrieve your page today, the answer can use it and cite it. That is the opening generative engine optimization works with: you do not have to wait for the next model.
Google says this directly. Its guide to generative AI features in Search describes them as “relying on our core Search ranking systems to retrieve relevant, up-to-date web pages from our Search index”. So for Google, the retrieval step is its normal Search index, and a page “must be indexed and eligible to be shown in Google Search with a snippet” to be used. Google's newer AI optimization guide adds one condition: the site must be included in the Search generative AI features setting in Search Console.
Retrieval does not always happen. OpenAI says that, like any other tool, the model “can choose to search the web or not based on the content of the input prompt”. When it does not search, no new page can be cited, and the answer comes from training alone.
What stops retrieval from finding your page?
If the retrieval step never finds your page, the model never sees it. The usual causes are a crawler blocked in robots.txt, a page that is not indexed or not allowed a snippet, text that only appears after JavaScript runs, or a page that does not clearly answer the question. And if a retrieved third-party page describes you wrongly, the answer can repeat the error with a citation attached.
- Check that search engines and AI search crawlers can reach the pages that describe what you sell.
- Check in Search Console that those pages are indexed, allowed a snippet, and that the site is included in the Search generative AI features setting.
- Check which pages AI answers retrieve for your buyers’ questions, and correct or replace the wrong ones.
Once a page is found, how it is written decides whether it gets quoted. That is covered in grounding, under how to become a source for grounded answers.
Frequently asked questions
What is retrieval-augmented generation (RAG)?
+
Retrieval-augmented generation is a method in which an AI system first looks up relevant documents, such as web pages or a company's own files, and then writes its answer using them. It lets the model use information that was not in its training data and cite where it came from.
Who came up with RAG?
+
The name comes from a 2020 paper by Patrick Lewis and colleagues, "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks". It combined a language model with a searchable index of Wikipedia that the model could retrieve passages from.
Do ChatGPT and Google AI Mode use RAG?
+
Their search features work on the same idea: retrieve web results, then write an answer from them with links. Google says AI Overviews and AI Mode may use query fan-out, running several related searches before answering. Retrieval does not always happen: OpenAI says the model can choose to search the web or not based on the prompt. The exact systems are not published in full.
Why does RAG matter for SEO and AI visibility?
+
Because the retrieval step decides which pages the answer can use and cite. A page that is not crawled, indexed or clearly relevant to the question never reaches the model, however good it is.
Does RAG stop AI from making things up?
+
It reduces made-up answers on facts the retrieved pages cover, but it does not stop them. The model can still misread a source, mix two sources or fill a gap the sources leave.
Sources
- Patrick Lewis and others, “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks” (arxiv.org/abs/2005.11401), arXiv 2005.11401, first posted 22 May 2020, checked 24 November 2026.
- Google Search Central, “AI features and your website” (developers.google.com/search/docs/appearance/ai-features), last updated 10 December 2025, checked 24 November 2026.
- Google Search Central, “Optimizing your website for generative AI features on Google Search” (developers.google.com/search/docs/fundamentals/ai-optimization-guide), last updated 10 July 2026, checked 24 November 2026.
- OpenAI, “Web search” (developers.openai.com/api/docs/guides/tools-web-search), API guide, checked 24 November 2026.