Skip to content

Retrieval-augmented generation (RAG)

Also called RAG, retrieval augmented generation

What is retrieval-augmented generation?

Retrieval-augmented generation (RAG) is a technique where an AI system first retrieves relevant documents, such as web pages or internal files, and then gives them to a language model to write its answer. The model answers from the retrieved text rather than only from what it learned in training, which makes answers more current and lets it cite sources.

A robot moves retrieved documents from a basket into a knowledge base, demonstrating retrieval-augmented generation.

The term comes from a 2020 research paper by Patrick Lewis and colleagues at Facebook AI Research. In AI search, the “retrieval” step is usually a web search, sometimes several (query fan-out), followed by fetching and reading the top pages. The “generation” step is the written answer, with citations pointing back to the retrieved pages.

For SEO, RAG is the reason classic search visibility still matters in AI search. A page that isn’t found in the retrieval step can’t be used or cited, however good it is.

Why retrieval-augmented generation matters for SEO

Most AI answers that cite sources are built with some form of RAG. Your page goes through two filters: first it must be retrieved (indexed, crawlable, ranking for the query or a sub-query), then the model must find it useful enough to use and cite. SEO handles the first filter; clear, specific content handles the second.

RAG systems often read only part of a page, or a few passages from it. Pages where the key answer is stated clearly, rather than buried in a long introduction, are easier to use.

How to make pages work for RAG

  1. Make sure the page can be retrieved: indexed, not blocked to the relevant crawlers, and ranking for the queries it answers.
  2. Put a clear answer near the top, and use descriptive headings so each section makes sense on its own.
  3. Use text for important facts. Facts locked inside images or scripts the crawler can’t render may be missed.
  4. Write naturally for people. Google says there is no need to split content into tiny chunks for AI systems.

Retrieval-augmented generation FAQ

Is RAG the same as grounding?

They are closely related. RAG is the technique of retrieving documents and generating from them; grounding is the goal of tying an answer to verifiable sources. RAG is the most common way to ground an answer.

Does ChatGPT use RAG?

When ChatGPT searches the web, it retrieves pages and writes its answer from them with citations, which is a form of RAG. Without search, it answers from its training data alone.

Related SEO terms

Back to the SEO glossary

Put the terms to work

Every term here is something OpenSEO measures. It is open source: start online in a minute, or run it on your own server.