Skip to content
RankX AI

Cookie settings

Choose which cookies we can use. You can change this at any time from “Cookie settings” in the footer.

Essential

Security, bot protection and remembering your choice. The site needs them to run, and they do not identify you. Always on.

Google Analytics cookies that tell us which pages are read and which links are followed, so we can improve them. Off until you switch it on.

Tells advertisers when their advert led to your visit. Includes the Meta (Facebook) pixel and the LinkedIn Insight Tag, which set cookies on this domain (LinkedIn also on linkedin.com) and can be told if you later start a trial.

More in the cookie policy and the privacy policy.

AI search glossary

RAG (Retrieval-Augmented Generation)

RAG, or retrieval-augmented generation, is the technique of fetching documents at question time and giving them to a language model to answer from, rather than relying on what the model learned in training. The 2020 paper that named RAG describes it as combining parametric and non-parametric memory.

Category
Retrieval mechanics
Reviewed

One answer, built at question timeIllustrative

  1. Question

    A question arrives.

    Where can I buy replacement shaker cabinet doors in the UK?

  2. Retrieve

    Documents that match it are fetched, at question time.

    halewick.co.ukdiyguide.co.ukkitchenforum.co.uk

  3. Augment

    The passages are given to the model with the question.

  4. Generate

    The model answers from them, not from training alone.

    Cited

FIG. 01Retrieval-augmented generation: fetch documents first, then answer from them

Where does the term RAG come from?

From Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (opens in a new tab), submitted on 22 May 2020 by Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel and Douwe Kiela. The abstract defines the models as combining “pre-trained parametric and non-parametric memory for language generation”, where the parametric memory is the trained model and the non-parametric memory is a searchable index.

The paper’s index was Wikipedia. Five years on, the non-parametric memory is the live web, and the retrieval step is the one an assistant runs when it decides your page is worth reading. The architecture has changed a great deal since, and the vocabulary has not: parametric and non-parametric memory are still the two halves any honest description of an assistant’s answer has to separate.

Why does the parametric and non-parametric split matter to a publisher?

Because it divides an assistant’s answer into the half you can influence this week and the half you cannot influence at all. The retrieved half is documents fetched now, so publishing a better page changes it as soon as the index catches up. The trained half was fixed at a knowledge cutoff months ago, and nothing you publish reaches it until the next model.

That split is also why no tool can honestly separate the two in a live answer. When an assistant names your brand, there is no field in the response saying whether the name came from a retrieved page or from training. Every product claiming to isolate training-data influence is estimating, and the estimate is unverifiable. It is also why the same brand can be described accurately by one assistant and be a year out of date in another on the same afternoon: one of them retrieved, and one of them remembered.

Is “RAG” the same thing as an assistant searching the web?

Close enough for a marketer, and not close enough for an engineer. RAG names a family of architectures with a retriever and a generator; a consumer assistant with web access is one instance of it, wrapped in query rewriting, fan-out, reranking and citation formatting that the original paper did not describe.

The reason to keep the technical definition anyway is that it tells you where to look when something is wrong. If your page is not in the index, no amount of writing helps; if it is retrieved and not used, the problem is the passage rather than the page.

  • GroundingGrounding is the step that ties a model’s answer to sources it retrieved, so the reply can cite them rather than assert them.
  • EmbeddingAn embedding is a list of numbers representing a piece of text, positioned so that texts with similar meaning sit close together.
  • ChunkingChunking is the step that splits a page into passages so a retrieval system can select one without the rest.
  • Query Fan-OutQuery fan-out is Google’s own term for how AI Overviews and AI Mode answer a question: the engine breaks the question into subtopics and issues many searches at once, then writes one answer from the results.

This definition of RAG (Retrieval-Augmented Generation) was checked against the following sources. Definitions are reviewed quarterly and edited only when they are wrong, so the reviewed date above moves on a real correction and not on a schedule.

Every entry is listed on the RankX AI glossary index, and this page is available as Markdown at /glossary/rag.md.

Start here

See where you show up in AI answers today.

Start with your website. RankX AI recognises your platform, suggests the questions to track and audits your pages, with first results minutes after setup.

7-day free trial. No credit card required. On Shopify, install the app and Shopify bills your plan.