Retrieval-augmented generation (RAG) connects a language model to a search step. The model does not rely only on what it learned in training: it first retrieves relevant text and then writes its answer from that. AI assistants that search the web live work on the same idea, with web pages as the source.
The term comes from a research paper by Lewis and colleagues from 2020. The researchers combined the memory stored in a trained model with an external index that the model queries through a retrieval component. In their experiments, that index was Wikipedia.
Why does it matter?
The search step is the moment when an AI system can find your page and link to it. In its guide to generative AI features, Google treats grounding as another name for RAG, and writes that its AI features rely on the core ranking systems of Google Search for this. A page that cannot be found or read takes no part in that step.
Example
In outline, a RAG answer works like this:
user's question
-> one or more searches
-> pages and passages found
-> language model writes the answer
-> answer with source linksCommon mistake
Thinking that RAG guarantees a correct answer. Google writes about Grounding with Google Search that it can reduce hallucinations. Reducing is not ruling out: an error in the source or in the summary remains possible.
See also grounding and How do AI assistants decide which websites to mention?.