Skip to content
AI and answer engines

What is Retrieval-augmented generation (RAG)?

Retrieval-augmented generation is an architecture where a language model answers using documents fetched at query time rather than relying only on training data. The system splits sources into chunks, embeds and ranks them, places the best matches into the model’s context, and generates an answer from those.

Definition

Definition

Also written: RAG

Retrieval-augmented generation is an architecture where a language model answers using documents fetched at query time rather than relying only on training data. The system splits sources into chunks, embeds and ranks them, places the best matches into the model’s context, and generates an answer from those.

Understanding this explains most credible advice about writing for AI discovery. Because documents are chunked before retrieval, the unit that gets embedded, ranked and quoted is the passage — which is why self-contained paragraphs matter mechanically, not just stylistically.

Research on RAG pipelines also found that stripping HTML to plain text loses structural signal that improves retrieval, arguing for real headings, tables and lists over visually-identical div markup.

The usual error

Where this goes wrong in practice

Assuming a model "remembers" a site. In a retrieval system, content is fetched per query — which means it has to be reachable and readable at that moment.