What is retrieval-augmented generation (RAG)?
Also known as retrieval augmented generation, retrieval-augmented LLM
Definition
Retrieval-augmented generation (RAG) is a method where an AI system first retrieves relevant documents or web pages, then uses them to write its answer. It lets models use fresh or specific information they were not trained on.
Key points
- RAG means an AI system looks things up first, then writes its answer from what it found.
- If a page is not found at the retrieval step, it cannot be used in the answer.
- Clear passages that answer one question fully are easier to retrieve and quote.
What does it mean in practice?
A customer asks an AI assistant which local gyms offer early morning classes. With RAG, the system runs a search, pulls a handful of passages from gym websites and listings, and passes them to the model. The model then writes an answer based on those passages, often with links.
The idea was set out in a 2020 research paper by Lewis and colleagues. AI search engines use their own versions of the approach, and each has its own way of choosing what to retrieve.
Why does it matter for AI search?
RAG is a big reason SEO still matters in AI search. If your page is not found at the retrieval step, it cannot be used in the answer. Being crawlable, indexed and relevant is the first step.
It also explains why clear passages help. The model often works with chunks of text rather than whole pages. A section that answers one question fully, in plain words, is easier to retrieve and to quote than a long page that wanders.
Our guide on how AI engines choose sources covers the patterns. AI citation tracking shows which pages actually get pulled in for your topics.
Related terms
These terms connect to RAG.
- Grounding, the broader idea of basing answers on looked-up information.
- Query fan-out, one way retrieval is widened.
- Citation, the links that show what was retrieved.
- Hallucination, the kind of error RAG aims to reduce.
Common questions
Is RAG the same as grounding?
What does RAG mean for my website?
Related reading
How AI engines choose sources
How AI engines choose sources, why ChatGPT, Perplexity and Google pick the pages they cite, what retrieval and grounding mean, and what usually wins.
AI citation tracking
AI citation tracking shows which domains and pages ChatGPT, Perplexity and Google AI Overviews cite for your prompts, and which of your URLs appear.
Grounding
A plain definition of grounding in AI answers, how it differs from answering from training, and what it means for your brand.
Query fan-out
A plain definition of query fan-out in Google AI Mode and AI Overviews, with an example and what it means for your content.
AI crawler
A plain definition of AI crawlers such as GPTBot and OAI-SearchBot, what each type does, and why blocking one can cost you visibility.
AI Mode
A plain definition of Google AI Mode, how it uses query fan-out, and how to see your AI Mode impressions in Search Console.