Retrieval-augmented generationRAG

nounalso called retrieval augmented generation

Definition

Retrieval-augmented generation (RAG) is a technique in which an AI system first retrieves relevant documents from an index and then gives them to a large language model to write its answer, so the response can cite current sources instead of relying only on what the model memorized in training.

Updated 6 min read8 cited sources

On this page8 sections

Why it matters for founders and small teams

RAG is the step where an AI engine goes looking for sources, and it’s the only point in the process where a page published this week can beat a brand the model has known for years. For a founder without a content team, that’s the opening: you can’t change what a model memorized, but you can make your pages the ones its retrieval step finds and quotes.

How does retrieval-augmented generation work?#

Retrieval-augmented generation works in two steps: a retriever searches an index for passages relevant to the question, then a large language model writes the answer with those passages placed in its prompt, citing the ones it used.

The technique was named in a 2020 paper by researchers at Facebook AI Research, University College London and New York University (Lewis et al.), which paired a text generator with “a dense vector index of Wikipedia, accessed with a pre-trained neural retriever.” The paper called the two halves parametric memory — what the model learned — and non-parametric memory, the index it can search. Every AI answer engine now runs a scaled-up version of that design, with the web as the index.

  1. 1

    The question is rewritten into searches

    Engines rarely search the exact prompt. They write narrower sub-queries — query fan-out — and run them in parallel.

    Your lever: Title pages and sections the way a buyer’s follow-up question would be searched.

  2. 2

    The retriever pulls candidates from an index

    Keyword matching and semantic search run over Google’s, Bing’s, Brave’s or the engine’s own index. Perplexity runs both at once and merges the results.

    Your lever: Be crawlable by the engine’s search bot and indexed where it looks.

  3. 3

    Pages are split into passages and reranked

    Documents are broken into chunks, and a more precise model reranks them against the question. Only the top few survive.

    Your lever: Make each section answer one question in its first sentence.

  4. 4

    The model writes from the survivors

    The surviving passages go into the model’s context, and it writes an answer grounded in them, attaching citations to the claims they support.

Google describes the same pattern for AI Overviews: RAG is used “to improve the quality, accuracy, and freshness of AI responses by relying on our core Search ranking systems to retrieve relevant, up-to-date web pages” (Google Search Central).

RAG vs fine-tuning: what's the difference?#

RAG gives a model new information at answer time by retrieving documents, while fine-tuning changes the model’s weights with extra training — so RAG handles fresh, citable facts, and fine-tuning shapes style and behavior.

Retrieval-augmented generationFine-tuningTraining data alone
When knowledge is addedAt the moment of the questionIn an extra training runBefore the model’s release
FreshnessAs current as the indexFrozen at the fine-tuneFrozen at the knowledge cutoff
Can it cite sources?Yes — the retrieved pagesNoNo
What a site owner can influenceAccess, indexing and passagesNothingSlowly, through training data

The two aren’t rivals inside an AI product. A model is fine-tuned once to behave like a helpful assistant, and RAG then supplies the facts question by question. For marketers the distinction that matters is control: you’ll never fine-tune ChatGPT, and you can’t edit what it memorized. RAG is the part of the system that’s open to you — every engine that cites sources is retrieving them, and retrieval can be earned page by page.

Worked example

The RAG Funnel

A way to see how few passages survive each step of retrieval-augmented generation — and why the passage, not the page, is what you’re writing. Stage sizes are illustrative, anchored to published figures where they exist, for a fictional project tool called Plannora.

  1. 1

    Sub-queries the engine writes

    A buyer asks ChatGPT for the best project tool for a five-person team. Nectiv measured about 7.6 fan-out searches per ChatGPT prompt after August 2026; round down to 7.

    7 searches

  2. 2

    Candidate pages retrieved

    Assume ten results per sub-query, then remove pages that appear in more than one search.

    ~50 pages

  3. 3

    Passages in the pool

    At roughly one passage per 150-word section, a 2,000-word page yields about 13. 50 pages × 13.

    ~650 passages

  4. 4

    Reranked short list

    Anthropic’s published RAG setup retrieves 150 chunks and reranks them down to 20 for the model. Assume the same cut to 20.

    20 passages

  5. 5

    Cited in the answer

    Attrifast’s 2026 study measured a median of 3.1 domains cited per ChatGPT answer. Call it 3.

    3 sources

  6. =

    Odds for any one passage

    3 ÷ 650 — the share of the pool that makes it into the answer.

    under 0.5%

The result: Plannora’s pricing page could be retrieved for three of the seven sub-queries and still lose if a competitor’s section answers “price per user for five people” in its first sentence. The funnel shows where effort pays: being indexed and matching the sub-queries gets you into the pool of 650, and a passage that answers first is what survives the last two cuts.

Free to use and adapt. If you cite it, link to rankbox.xyz/glossary/retrieval-augmented-generation.

Why does retrieval-augmented generation matter for SEO?#

Retrieval-augmented generation matters for SEO because the retrieval step runs on search indexes: a page that isn’t crawlable, indexed and matched to the engine’s sub-queries can’t be retrieved, and a page that isn’t retrieved can’t be cited.

That makes classic SEO the entry ticket, not the whole game. Retrieval works on sub-queries and passages, so a page can be cited for a follow-up question it answers well while ranking nowhere for the prompt the user typed.

~8%

of ChatGPT citations rank in Google's or Bing's top 10 for the original prompt

Ahrefs, Aug 2025

37.9%

of pages cited in Google AI Overviews rank top 10 for the typed query

Ahrefs, Mar 2026

28.6%

of Perplexity's citations rank in Google's top 10 — the highest overlap of any assistant

Ahrefs, Aug 2025

Each engine retrieves from a different place — Google’s index for AI Overviews and Gemini, Bing plus OpenAI’s own index for ChatGPT, Brave for Claude, and Perplexity’s own 200-billion-URL index — so being findable means being indexed in all of them. The AI SEO guides cover each engine’s source and crawler.

How do you optimize content for retrieval-augmented generation?#

Optimize for retrieval-augmented generation by removing anything that blocks retrieval, then writing passages a retriever can match and a model can quote: descriptive headings, the answer in the first sentence, and specific names, numbers and dates.

  1. Let the search bots in, and check your CDN, whose AI-bot toggles can override robots.txt. See AI crawlers.
  2. Put the text in the HTML. Only Google’s pipeline renders JavaScript; OpenAI’s, Anthropic’s and Perplexity’s fetchers read raw HTML.
  3. Match the sub-question in titles, H2s and URL slugs. Ahrefs found the titles of pages ChatGPT cited were semantically closer to the prompt than uncited titles (0.602 vs 0.484), and closer still to its fan-out queries.
  4. Answer first, then expand. Growth Memo found 44.2% of ChatGPT citations came from the first 30% of a page. See answer-first content.
  5. Make sections stand alone. A retrieved chunk arrives without the paragraphs around it, so name the subject instead of writing “it” or “as above.”
  6. Stay current. Perplexity filters stale pages before ranking, and Ahrefs found assistants cite newer pages than classic search does. See content freshness.

Common mistakes with retrieval-augmented generation#

The most common RAG mistakes are assuming a top ranking for the head term is enough, hiding the answer behind JavaScript or a long intro, and writing sections that only make sense in context — each one stops a page at retrieval or extraction.

Myth

RAG engines just show Google's top results.

Reality

Engines retrieve for their own sub-queries from their own indexes. Only about 8% of ChatGPT’s citations rank top 10 for the original prompt.

Myth

An llms.txt file feeds my content to RAG systems.

Reality

No major engine has confirmed reading other sites’ llms.txt files. Retrieval runs on search indexes and crawlers.

Myth

Being retrieved means being cited.

Reality

Retrieval only puts a page in the pool. A reranker cuts the pool to a short list, and the answer cites a few sources — a median of about three domains per ChatGPT answer in Attrifast’s 2026 study.

Myth

Longer, more comprehensive pages always win.

Reality

Retrieval scores passages. A long page with the answer buried in paragraph nine loses to a short section that answers first — Google says there’s “no ideal page length.”

Sources

  1. 1.Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksLewis et al., NeurIPS 2020 · arxiv.org
  2. 2.Optimizing your website for generative AI featuresGoogle Search Central · developers.google.com
  3. 3.Architecting and evaluating an AI-first search APIPerplexity Research · research.perplexity.ai
  4. 4.Introducing Contextual RetrievalAnthropic · anthropic.com
  5. 5.AI search overlap with Google and BingAhrefs · ahrefs.com
  6. 6.How many AI Overview citations rank in the top 10?Ahrefs · ahrefs.com
  7. 7.ChatGPT tripled its fan-out queriesNectiv · nectivdigital.com
  8. 8.AI search citations by vertical, 2026Attrifast · attrifast.com

Know someone who’d find this useful? Send it their way.

Written by

Rankbox Team

The team behind Rankbox. We study how ChatGPT, Perplexity, Gemini, and Google AI Overviews choose their sources, and publish what we learn so you can put it to work.

See which AI answers cite you today

Enter your site to see how often ChatGPT, Perplexity, Gemini, and Google cite your brand, and exactly what to publish next.

No credit card required · Free 7-day trial