RAG (retrieval-augmented generation)

RAG (retrieval-augmented generation) is a technique where an AI model first retrieves relevant documents, for example web pages, and then writes its answer based on that retrieved information instead of relying only on its training data.

RAG, short for retrieval-augmented generation, is the method behind most AI tools that cite sources. A language model on its own can only use what it learned during training, which goes stale and has gaps. With RAG, the system first fetches relevant information from an outside source, adds it to the prompt, and then lets the model write an answer using that material.

How RAG works

  1. Query. The user asks a question. The system may rewrite it or split it into several search queries.
  2. Retrieval. It searches an index, such as a web search engine or a company's own document store, and picks the most relevant pages or passages.
  3. Augmentation. The selected passages are added to the model's context, together with the original question.
  4. Generation. The model writes an answer based on the retrieved text and, in most consumer products, adds citations to the sources it used.

Google AI Overviews and AI Mode, ChatGPT search, Perplexity and Microsoft Copilot all use some form of this approach on the open web. Businesses use the same technique internally, for example for chatbots that answer questions from manuals or help center articles.

Why RAG matters for SEO and GEO

RAG is the reason classic SEO still matters for AI visibility. If the retrieval step is based on search results, a page that does not rank or is not indexed simply never reaches the model. Once a page is retrieved, the model tends to use passages that answer the question clearly and in a self-contained way. In short, RAG rewards two things: being found, and being easy to quote.

It also explains why AI answers can change from day to day. The model may stay the same, but the retrieved pages differ depending on the index, the query wording and freshness.

Practical tips

  • Make sure important pages are crawlable by both search engines and AI crawlers.
  • Break long content into clear sections with descriptive subheadings, so individual passages make sense out of context.
  • Put the key answer or definition early in each section.
  • Keep facts up to date. Retrieval systems often prefer fresh sources for time-sensitive questions.
  • Get mentioned on sites that already rank well for your topics. Those pages are the ones being retrieved.

Common mistakes

Hiding content behind scripts, tabs or logins that crawlers cannot read, and writing passages that only make sense if you read the whole page. Another misconception is that RAG removes errors completely. It reduces hallucinations, but a model can still misread or mix up retrieved sources.

Questions about RAG (retrieval-augmented generation)

What is RAG in simple terms?

RAG means an AI looks things up before it answers. It retrieves relevant documents first and then writes a response based on them.

Does ChatGPT use RAG?

When ChatGPT searches the web, it uses a retrieval step to fetch pages and bases its answer on them, which is a form of RAG. Without search, it answers from its training data.

Why does RAG matter for SEO?

Many AI answer engines retrieve pages through search. If your page is not indexed or ranking, it is less likely to be retrieved and cited.

Related terms