What is retrieval-augmented generation (RAG)?

Retrieval-augmented generation (RAG) is an AI technique that retrieves relevant documents from an index, such as a search engine or a vector database, and passes them to a language model before it writes its answer. ChatGPT search, Gemini and Google AI Mode use this approach to answer with current information and cite their sources.

Why retrieval-augmented generation matters

Retrieval-augmented generation decides what an AI model knows at the moment it answers, and the paper that named it showed this plainly. Its authors built two indexes from Wikipedia, one from December 2016 and one from December 2018, then asked their model who held 82 world leader positions that had changed between the two dates. With the matching index, it answered 70% (2016) and 68% (2018) of the questions correctly. With the mismatched index, accuracy fell to 12% and 4%. Same model, different index, different answers.

The lesson carries over to brands: an outdated page produces an outdated answer. Ask an assistant "Does Acme CRM integrate with Shopify?" (an illustrative case). If the page it retrieves is an old integrations page that still says "coming soon", it answers no, even if the integration has shipped since.

How retrieval-augmented generation works

The term comes from a 2020 paper by Patrick Lewis and colleagues at Facebook AI Research, University College London and New York University, presented at NeurIPS 2020. Their system split Wikipedia into 100-word chunks, 21 million in all, and let a language model look them up. Web-scale systems follow the same four steps:

  1. Index. Documents are split into passages and stored, often as embeddings that capture meaning (see semantic search).
  2. Retrieve. The system turns the prompt into one or more queries and fetches the most relevant passages.
  3. Augment. The passages are added to what the model reads before answering.
  4. Generate. The model writes the answer from them and can cite where each fact came from.

Google says its AI features use RAG by "relying on our core Search ranking systems to retrieve relevant, up-to-date web pages from our Search index."

What RAG changes for a brand

RAG opens a second way into AI answers. Without retrieval, a model can only repeat its training data, which changes with each new model version. With retrieval, a page published or corrected today can shape an answer as soon as the engine finds it.

The catch is that retrieval runs through ranking. In C-SEO Bench, a 2025 benchmark of methods that rewrite pages for AI engines, most methods proved "largely ineffective", while traditional SEO strategies that improve a source's ranking in the model's context were "significantly more effective."

To see what the engines actually retrieve for your prompts, Hawkscan lists the cited pages from ChatGPT, Gemini, Microsoft Copilot and Google AI Mode, with how many answers cite each one and whether it mentions your brand.

Common questions

What does RAG mean in AI?

RAG stands for retrieval-augmented generation: the model retrieves documents first, then generates its answer from them. It is how AI assistants answer questions about recent events or niche topics that their training data does not cover well. Google also calls it grounding.

Does RAG stop AI hallucinations?

No. Retrieval reduces errors but does not remove them: the model can misread a source, pick an outdated one or cite the wrong page. OpenAI warns that ChatGPT's "search results and citations can be incomplete, outdated, or incorrect." See AI hallucination.

Sources

  1. arXiv (Lewis et al., NeurIPS 2020), Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks ()
  2. Google Search Central, Optimizing your website for generative AI features on Google Search ()
  3. arXiv (Puerto et al.), C-SEO Bench: Does Conversational SEO Work? ()
  4. OpenAI Help Center, Searching the web with ChatGPT

Your AI visibility starts here.

Your customers are already turning to AI for recommendations. Hawkscan gives you the full picture, so you always know where you stand and where to grow.