What Is Retrieval-Augmented Generation?

Sharmeen Saleem
Written by Sharmeen Saleem
5 min read

What Is Retrieval-Augmented Generation?

Definition: Retrieval-augmented generation (RAG) is a technique where an AI model looks up relevant information from an outside source before it writes an answer. The retrieved text is added to the prompt, so the answer can use current facts and show its sources. Many AI search tools work this way, so a page must be retrieved to be cited.

The term comes from a 2020 research paper led by Patrick Lewis, with co-authors from Facebook AI Research (now Meta AI), University College London and New York University, according to NVIDIA.

This page is about RAG as it affects AI search visibility, not how to build a RAG system.

How Does RAG Work?

IBM, AWS and NVIDIA describe the same basic flow. A RAG system adds a retrieval step before the model writes.

  1. A user asks a question.
  2. The system searches a knowledge source for relevant material. In an enterprise system this is often a vector database, where documents are stored as numerical vectors and matched to the question. In AI search, the source is the web or a search index.
  3. The retrieved text is added to the user’s prompt. IBM calls this an augmented prompt.
  4. The model writes the answer from the question and the retrieved text, and can cite where it came from.
  5. The knowledge source is kept up to date so the answers stay current.

RAG doesn’t make a model error-proof. IBM notes that it can reduce the risk of hallucinations but can’t remove it.

Do ChatGPT, Perplexity and Google Use RAG?

The engines describe their own systems in their own words, and none of the three pages below uses the phrase “retrieval-augmented generation.” But each one describes the same pattern: look up sources, then write the answer with links.

Engine What its own documentation says
ChatGPT Searches the web automatically when your question might benefit from it, and shows inline citations and a Sources list (OpenAI help)
Perplexity Searches the internet in real time and compiles the findings into an answer with numbered footnotes linking to the sources (Perplexity help)
Google AI Overviews and AI Mode May use “query fan-out”: several related searches across subtopics and data sources, with more supporting pages found while the response is generated (Google Search Central)

Sources: OpenAI Help Center, Perplexity Help Center, Google Search Central. Checked November 22, 2026. These products change, so re-check before relying on a detail.

ChatGPT doesn’t search every time. It searches when it judges that web information would help. A question it can answer from training alone may produce no citations at all.

How Does RAG Affect Which Sources AI Cites?

In a RAG-style answer, the model writes from what was retrieved. A page that isn’t retrieved can’t be cited, however good it is. Retrieval comes first, and writing comes second.

That gives you three gates a page has to pass:

  • Can it be found? Google says a page can appear as a supporting link in AI Overviews and AI Mode if it is indexed and eligible to be shown in Search with a snippet.
  • Can it be read? Wellows’ LLM SEO guide notes that most AI crawlers fetch pages without running JavaScript, so content that only loads client-side may be invisible to them.
  • Is it chosen? Of everything retrieved, the model uses some pages and skips others. No engine publishes a formula for this.

The third gate is the one nobody outside the engines can see directly. You can only measure its results.

What Does Retrieval Look Like in a Real AI Answer?

Articos, an AI user research platform, tracked its visibility in Wellows. On a startup validation prompt, it wasn’t cited in ChatGPT’s answer on 11 May 2026. On 14 June 2026, its startup validation guide appeared twice in the same answer, at positions 2 and 4. Read the full Articos case study.

An answer carrying cited sources is what retrieval produces. It doesn’t show what happened inside ChatGPT, only the result: on that prompt, the page went from absent to cited.

Source: Wellows case study, Articos. One brand, one prompt, two dates.

How Is RAG Different from Training a Model?

Training and fine-tuning change the model itself. RAG leaves the model alone and gives it fresh material at the moment of the question. AWS lists this as a reason to use RAG: new data can be added without the cost of retraining the model, and responses can carry source citations that users can check.

For visibility, the difference matters. Training data is fixed at a cutoff, so you can’t change what a model learned. Retrieved material is fetched at answer time, so what you publish can reach an answer.

RAG is also one part of a wider field. Wellows’ generative information retrieval guide treats RAG as a technique within it.

What Can Content Teams Do About RAG?

Start with what the engines document, then add what is inference.

Documented:

  • Make sure the page is indexed and eligible for a snippet. Google says no additional technical requirements and no special optimization apply to AI Overviews and AI Mode.
  • Keep important content in the HTML, not behind client-side scripts (Wellows LLM SEO guide).

Inference, not documented by any engine:

  • IBM notes that RAG systems split documents into chunks, and that chunk size is a trade-off: too large and the text becomes too general, too small and it can lose meaning. Writing sections that make sense on their own may help. Treat this as a hypothesis and test it against your own citation data.

For the full approach, see our guide to generative engine optimization, or the GEO Checker, which compares your pages with the ones AI engines cite for a prompt.

How Can You Measure the Effect of RAG on Your Brand?

You can’t watch retrieval happen, so measure its results.

  1. Fix a prompt set. Use the unbranded questions your buyers ask, and keep the set the same each period.
  2. Run each prompt on each engine, more than once. AI answers vary from run to run.
  3. Record whether each answer cites your domain and whether it names your brand. These are separate outcomes.
  4. Calculate the rates across all answers. Citation rate is answers that cite your domain divided by answers sampled. Mention rate is answers that name your brand divided by answers sampled. Report the sample size beside each.
  5. Compare against competitors and over time. A page that moves from absent to cited, as in the Articos example, is the clearest sign that retrieval is reaching you.

Wellows does this daily across ChatGPT, Google AI Overviews, Google AI Mode, Perplexity and Gemini. The AI Visibility Score shows your share of citations against competitors, and the methodology page explains how it is measured. For more on the metrics, see our guide to AI visibility metrics.

Conclusion:

RAG puts a lookup step before the answer, which is why AI search cites some pages and not others. You can’t see retrieval from outside, so measure what it produces: whether your domain is cited, and whether your brand is named, across a fixed set of prompts and repeated runs.

See how AI describes your brand today with the free AI Brand Report.


What is retrieval-augmented generation?
Retrieval-augmented generation (RAG) is an AI architecture pattern in which a language model queries an external knowledge source to fetch relevant information before generating an answer, grounding its response in the retrieved material rather than relying solely on pre-training weights.

What does RAG stand for?
RAG stands for retrieval-augmented generation. “Retrieval” refers to querying an external database or search index for relevant passages, “augmented” refers to injecting that retrieved context directly into the model’s prompt, and “generation” refers to the LLM synthesizing the final answer from the combined input.

Where does retrieval-augmented generation pull information from?
It pulls data from whatever external repository the system is connected to. In enterprise applications, this is typically private documentation, PDFs, or internal databases indexed as embeddings in a vector store. In consumer AI search engines, retrieval pulls from live web search indexes and crawled web pages.

How are retrieved documents used in RAG?
Top-matching text segments returned by the retriever are appended to the user’s original query to construct an augmented context prompt. The language model processes both the instructions and the injected passages to synthesize a grounded response and attach inline citations to the source URLs.

Do ChatGPT and Perplexity use RAG?
Both platforms execute a search-then-synthesize workflow with inline source citations: ChatGPT triggers web search dynamically when external context improves accuracy, and Perplexity retrieves live search results across queries. While neither consumer help center explicitly brands its consumer interface as “RAG,” their architectures follow the same retrieval-and-grounding pattern.

How does RAG affect which sources AI cites?
Retrieval operates as a strict pre-generation gate: a URL cannot be cited in an answer if the retriever fails to surface it first. Crawlability, indexation, semantic relevance to generated sub-queries, and passage readability all govern whether a page clears retrieval, though commercial AI engines do not disclose their exact re-ranking weights.

How can content be optimized for RAG?
Search engines document the foundational prerequisites: ensure target pages are indexed, allow AI search crawlers in robots.txt, maintain snippet eligibility, and render core text in clean server-side HTML. Tactical formatting—such as structuring self-contained, question-led sections and front-loading direct answers—should be treated as an experimental hypothesis and validated against multi-run citation tracking data.

Does RAG stop AI from making things up?
No. While grounding responses in external documents reduces hallucination rates compared to ungrounded generation, RAG cannot guarantee error-free outputs. A system can still hallucinate if the retriever fetches outdated or conflicting sources, or if the language model misinterprets or over-extrapolates from an accurate passage.

Summarise this article

ChatGPTGeminiPerplexity

Share this article

About the Author

Sharmeen Saleem
Sharmeen Saleem

I'm a Content Strategist at Wellows, an AI visibility platform that helps brands track how they're cited across ChatGPT, Gemini, Perplexity, and Google's AI features. I create the… More about me