Retrieval-augmented generation (RAG)

Updated 2026-09-15

Retrieval-augmented generation is an architecture where a system retrieves relevant documents at query time and generates its answer from them. Every grounded AI answer you can influence with content is, in effect, a RAG pipeline pointed at the web.

How the pipeline works

A query is turned into one or more search requests, a retriever returns candidate passages, a ranking step keeps the few that look most relevant, and the model writes an answer conditioned on those passages. Visibility work touches two of those stages: being retrievable at all (indexed, crawlable, on-topic) and being the passage worth keeping (clear, self-contained, attributable). Nothing you publish influences the generation step directly.

Illustrative trace (example, not a real engine log)

A prompt about pricing triggers two searches, returns eleven passages, and the model writes from three of them. Your page was retrieved but not kept, because its pricing sentence spans a table the retriever returned without headers. The fix is a plain sentence next to the table, not more pages.

Common mistakes

  • Assuming being indexed is enough. Retrieval returns many passages and the model keeps few.
  • Writing passages that only make sense with the surrounding page, which lose to self-contained ones.
  • Treating RAG behaviour as fixed. Retrievers and ranking change without announcement.

Frequently asked questions

Do all AI answer engines use RAG?
All grounded answers work this way in outline, though the retrievers, ranking and citation habits differ enough that the same page can be kept by one engine and dropped by another.
Can we influence which passage gets retrieved?
Indirectly and reliably: self-contained paragraphs, explicit entities instead of pronouns, and one clear claim per block make a passage usable on its own, which is the property retrieval and ranking both reward.

Related terms