Retrieval-augmented generation is an architecture in which a language model retrieves relevant documents at answer time and conditions its generated response on that retrieved content. Abbreviated RAG, it is the standard pattern behind AI search surfaces: rather than answering purely from trained parameters, the system fetches evidence first and writes from it.

In one sentence

RAG is look-then-write: the model fetches documents about your question and composes its answer from them, which is the mechanism that lets web pages influence AI answers at all.

How RAG works

Three stages. Retrieve: the query, often expanded through fan-out, pulls candidate documents from an index. Condition: selected documents are placed into the model’s working context. Generate: the model writes an answer shaped by that context, typically with citations to the documents used. The architecture was formalised in the research literature in 2020 and now underlies commercial AI search, with each surface differing in what it indexes, how it selects, and how faithfully answers track sources.

Worked example

A user asks which accounting tool suits a small UK charity. The system retrieves comparison articles, community threads and vendor pages written long after the model’s training ended, and its answer names a tool launched last quarter, citing the pages that covered it. Without retrieval, that tool could not have been in the answer. Illustrative example of the mechanism.

Why RAG matters

RAG is the reason AI visibility is a practice rather than a lottery: it re-creates an ecosystem in which publishing changes outcomes. Everything upstream and downstream in this Index hangs off its stages: grounding is the outcome RAG produces, selection decides which retrieved documents matter, and absorption decides which of those actually write the answer. A brand invisible to the retrieve stage has no route into anything that follows.

What affects a page’s RAG presence

Evidenced factors: presence in the surface’s index and accessibility to its crawlers, per platform documentation. Factors with practitioner evidence: passage-level relevance to the query’s sub-questions, freshness, and the extractability of the page’s core claims once retrieved. These are treated as working hypotheses until tested.

Related concepts

References

Author: Harpal Singh · Last reviewed: 7 August 2026