# What is retrieval-augmented generation (RAG)?

> RAG retrieves documents at query time and gives them to a language model to write a cited answer. How ChatGPT, Claude, Google, Bing and Perplexity use it.

Canonical: https://promptlyfound.com/ai-search/rag
Updated: 2026-11-20

## Short answer

Retrieval-augmented generation (RAG) is a method in which an AI system **retrieves documents at query time and gives them to a language model** to write its answer. Google says AI Overviews and AI Mode use it, under the name grounding, with pages from the Google Search index. RAG lets an answer use pages published after training and cite them.

## Key findings

- Google says AI Overviews and AI Mode use retrieval-augmented generation, which it also calls grounding, and retrieve pages from the Google Search index. [4]
- To appear in Google's generative AI features, a page must be indexed and eligible to show in Google Search with a snippet, and the site must be included in Search generative AI features in Search Console. [4]
- ChatGPT search rewrites a prompt into one or more targeted queries and sends them to its search providers. [6]
- Only 1.5% of URLs from OpenAI's own index appeared in Bing's top 20 results for the same queries. [7]
- Copilot Studio generative answers rewrite the user's message into a Bing query, then run grounding, provenance and semantic similarity checks on the results. [5]

ChatGPT search, Claude with web search, Google AI Overviews, AI Mode, Microsoft Copilot and Perplexity all retrieve web content before they answer. Because of that retrieval step, a page can be cited as soon as it is indexed, long before it could reach a model's training data.

Retrieval-augmented generation (RAG) is a method in which an AI system retrieves documents at the time of a query and passes them to a language model. The model uses them to write its answer, as [Google Cloud's explainer on RAG](https://cloud.google.com/use-cases/retrieval-augmented-generation) describes.[1] Without retrieval, a model can answer only from what it learned in training.

## Why language models need retrieval

Retrieval lets an AI answer use your newest pages and link to them. Training fixes the weights of a model, and the model has no information about events after its training data ends, a date called its knowledge cutoff. A model asked about a later event can decline to answer, or, as [IBM's explainer on retrieval-augmented generation](https://ibm.com/think/topics/retrieval-augmented-generation) notes, it can produce a plausible answer with no basis in fact.[2]

An answer from the weights alone is called closed-book inference. An answer with retrieved documents in the prompt is open-book inference: the model reads the documents before it writes.

Retrieval fixes three limits of a model that answers from training alone:

- An answer can use pages published after the training cutoff, because retrieval happens at query time.
- Retrieved documents give the model facts to base its answer on. A model with the correct fact in its prompt is less likely to invent one.[2]
- The system knows which documents it retrieved, so it can cite them. AI search products show links next to their answers for this reason.

## The four steps of a RAG pipeline

[Wikipedia's article on retrieval-augmented generation](https://en.wikipedia.org/wiki/Retrieval-augmented_generation) describes four steps that most RAG systems follow.[3]

1. Before any query arrives, the system splits documents into passages, converts each passage into a vector embedding and stores the embeddings in a vector database.
2. At query time, the system converts the query into an embedding. A similarity search finds the stored passages whose meaning is closest to the meaning of the query.
3. The system adds the retrieved passages to the context window of the model, together with the query.
4. The model writes an answer based on the passages. The system cites the passages that the answer used.

A vector embedding is a list of numbers that represents the meaning of a passage. Passages with similar meanings have similar vectors. Vector retrieval compares vectors, often by cosine similarity. A passage can therefore match a query that uses other words. Many systems also run a keyword search next to the vector search.

Document structure affects the first step. A passage that makes one claim under a descriptive heading becomes a chunk that can be matched to a query. A long paragraph that mixes several ideas is harder to match. Once retrieved, it is also harder for the model to use.

## Semantic retrieval and keyword ranking

Keyword work still counts for Google's AI answers, because Google retrieves pages with its core ranking systems. Traditional search ranking uses signals such as keyword matches, links from other sites and user behavior. Vector retrieval uses semantic similarity, which measures how close the meaning of a passage is to the meaning of the query.

In vector retrieval, a passage does not need the exact query terms to match. A passage that explains how transformers handle long sequences can match a query about transformer attention and long context in different words. A passage that repeats keywords without answering the question matches poorly.

Many retrieval systems use both methods. [Microsoft's documentation of hybrid search in Azure AI Search](https://learn.microsoft.com/en-us/azure/search/hybrid-search-overview) describes one request that runs full-text search and vector search in parallel and merges the results with Reciprocal Rank Fusion.[15] [Anthropic's post on Contextual Retrieval](https://www.anthropic.com/news/contextual-retrieval) describes RAG systems that find chunks with BM25 keyword matching and with embeddings, then combine the two lists. Anthropic notes that embeddings can miss an exact match, such as an error code, that BM25 finds.[16]

Google's AI features retrieve pages with Google's core Search ranking systems, as the next section shows. [Google's page on how it ranks results](https://www.google.com/search/howsearchworks/how-search-works/ranking-results/) says the most basic signal that information is relevant is content that contains the same keywords as the search query.[14] So keyword matches, links and other ranking signals can affect which pages reach a Google AI answer. [Semantic search and keyword search](https://promptlyfound.com/ai-search/semantic-search) compares the two methods in more detail.

## Grounding in Google AI Overviews and AI Mode

[Google's guide to generative AI features in Search](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide), revised July 10, 2026, says these features use RAG, a technique Google also calls grounding.[4]

> "Retrieval-augmented generation (RAG): A technique (also known as grounding) 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 from our Search index."

Google's AI answers draw on the same index as its standard results, so there is no separate AI index to get into. Google retrieves from its Search index. To appear in generative AI features, a page must be indexed and eligible to show in Google Search with a snippet. The guide adds a second condition: the site must be included in Search generative AI features in Search Console.[4] [Google's help page on the Search generative AI control](https://support.google.com/webmasters/answer/16908024) says inclusion is the default for all properties.[10] SEO best practices still apply, the guide says.[4]

The same guide describes query fan-out, in which the model writes related queries to fetch more results for the question. Google's page [AI features and your website](https://developers.google.com/search/docs/appearance/ai-features) says both AI Overviews and AI Mode may use it.[11] Google's systems do not need content split into small pieces, the guide adds. They can find the relevant part of a page that covers several topics.[4]

## How each platform uses RAG

The retrieval source tells your team where a page has to be indexed for each platform. The four steps are the same across platforms, and the retrieval source and the number of searches differ.

  <thead><tr><th scope="col">Platform</th><th scope="col">Retrieval source</th><th scope="col">How retrieval works</th></tr></thead>
  <tbody>
    <tr><th scope="row">ChatGPT search</th><td>OpenAI's own index and third-party search providers</td><td>The prompt is rewritten into one or more targeted queries</td></tr>
    <tr><th scope="row">Claude</th><td>The web, when web search is on</td><td>Claude generates search queries, can run several searches in sequence, and cites its sources</td></tr>
    <tr><th scope="row">Google AI Overviews</th><td>Google Search index</td><td>Core Search ranking systems retrieve pages, and the model writes a summary with links to them. Google says it may use query fan-out</td></tr>
    <tr><th scope="row">Google AI Mode</th><td>Google Search index</td><td>Core Search ranking systems retrieve pages. Google says it may use query fan-out: the model generates several related queries and retrieves results for each</td></tr>
    <tr><th scope="row">Microsoft Copilot</th><td>Bing</td><td>Copilot generates a short search query from the prompt, sends it to the Bing search service and uses the results to compose the answer</td></tr>
    <tr><th scope="row">Perplexity</th><td>The web, at query time</td><td>Language models such as GPT-6.2 Sol and Claude Sonnet 5.5 interpret the question, and Perplexity summarizes the retrieved sources with numbered citations</td></tr>
  </tbody>

Microsoft describes Copilot web search in [Data, privacy, and security for web search in Microsoft Copilot and Microsoft Copilot Chat](https://learn.microsoft.com/en-us/copilot/plan/manage-public-web-access). When web search is on, Copilot builds a search query from terms in the user's prompt and sends it to the Bing search service. The query is a few words long. Copilot composes its response from the results Bing returns.[13] Microsoft documents a similar sequence for generative answers in Copilot Studio in [its guide to using public websites to improve generative answers](https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/generative-ai-public-websites). These answers also use Bing as a knowledge source. The query that reaches Bing is a rewritten version of the user's message, with context from earlier turns of the conversation. After retrieval, the system runs grounding, provenance and semantic similarity checks before it summarizes the results.[5]

[OpenAI's help article on ChatGPT search](https://help.openai.com/en/articles/9237897-chatgpt-search) says ChatGPT search rewrites a prompt into one or more targeted queries for its search providers. After it reviews the first results, it can send more specific queries.[6] RESONEO captured 1,200 ChatGPT answers, 88,000 search results and 26,900 distinct pages in July 2026 and published its analysis, [Inside ChatGPT's retrieval stack](https://searchengineland.com/chatgpt-retrieval-stack-index-cache-pages-485036), in Search Engine Land on August 17, 2026. Of the URLs from OpenAI's own index, only 1.5% appeared in Bing's top 20 results for the same queries.[7]

[Perplexity's help article on how Perplexity works](https://www.perplexity.ai/help-center/en/articles/10352895-how-does-perplexity-work) says it searches the web in real time and uses language models such as GPT-6.2 Sol and Claude Sonnet 5.5 to understand a question. In Search, a person can leave the model on Best, which picks a suitable model for each question.[12] Perplexity also built Sonar, an in-house model that [its post introducing the new Sonar](https://perplexity.ai/hub/blog/meet-new-sonar) says it trained for answer factuality and readability.[8] According to [Anthropic's announcement of web search on its API](https://anthropic.com/news/web-search-api), Claude searches the web only when web search is turned on. Without it, Claude answers from its training data.[9]

## Content requirements that follow from RAG

> Google's guide states the crawlability and non-commodity requirements. The other requirements follow from how the pipeline works. No platform has published a test of each one.

- Make sure retrieval systems can reach the page. Blocked resources, content that needs JavaScript to render, and noindex directives on canonical pages keep a page out of the pipeline. Run the [AI page check](https://promptlyfound.com/tools/ai-page-check) to see a page's noindex rules and the text it has without JavaScript.
- Write each passage to make one claim that makes sense without the rest of the page. Retrieval works on passages, so a passage that stands alone can be used alone.
- Answer the question each passage is meant for in precise terms. Vague or hedged text matches queries poorly, and so does text heavy with jargon.
- Name the source of each claim. Systems that run grounding checks can use a claim with a named source more easily than an unattributed one.
- Publish what the model cannot already know. If it has a reliable answer from training, retrieval adds less. Original data, research and first-hand experience give the model information it cannot produce alone. Google's guide asks for non-commodity content of this kind.[4]

[What AI platforms say about visibility](https://promptlyfound.com/geo/what-platforms-say) collects what each platform has published on these points.

## RAG and training data

Training data is what a model learned before its release, fixed at a cutoff date. RAG retrieves content at query time. A page can be retrieved and cited through RAG as soon as it is indexed. That can be long before it could appear in a future training run. The two are separate routes into AI answers. [How language models work](https://promptlyfound.com/llms/how-llms-work) covers the training side, and [Common Crawl](https://promptlyfound.com/crawlers/common-crawl) covers one of the main sources of training data.

Rankings do not show how often AI answers cite a page. [Citation share](https://promptlyfound.com/measurement/citation-share) measures that.

## Sources

1. What is Retrieval-Augmented Generation (RAG)?. Google Cloud. https://cloud.google.com/use-cases/retrieval-augmented-generation
2. What is retrieval-augmented generation?. IBM. https://ibm.com/think/topics/retrieval-augmented-generation
3. Retrieval-augmented generation. Wikipedia. https://en.wikipedia.org/wiki/Retrieval-augmented_generation
4. Optimizing your website for generative AI features on Google Search. Google Search Central, 2026-07-10. https://developers.google.com/search/docs/fundamentals/ai-optimization-guide
5. Use public websites to improve generative answers. Microsoft Learn, 2026-10-28. https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/generative-ai-public-websites
6. Searching the web with ChatGPT. OpenAI Help Center. https://help.openai.com/en/articles/9237897-chatgpt-search
7. Inside ChatGPT's retrieval stack. Search Engine Land, 2026-08-17. https://searchengineland.com/chatgpt-retrieval-stack-index-cache-pages-485036
8. Meet new Sonar. Perplexity. https://perplexity.ai/hub/blog/meet-new-sonar
9. Introducing web search on the Anthropic API. Anthropic, 2025-05-07. https://anthropic.com/news/web-search-api
10. Search generative AI control. Google Search Console Help. https://support.google.com/webmasters/answer/16908024
11. AI features and your website. Google Search Central. https://developers.google.com/search/docs/appearance/ai-features
12. How does Perplexity work?. Perplexity Help Center, 2026-11-17. https://www.perplexity.ai/help-center/en/articles/10352895-how-does-perplexity-work
13. Data, privacy, and security for web search in Microsoft Copilot and Microsoft Copilot Chat. Microsoft Learn, 2026-10-29. https://learn.microsoft.com/en-us/copilot/plan/manage-public-web-access
14. How Google determines ranking results. Google Search. https://www.google.com/search/howsearchworks/how-search-works/ranking-results/
15. Hybrid search using vectors and full-text search in Azure AI Search. Microsoft Learn, 2026-08-31. https://learn.microsoft.com/en-us/azure/search/hybrid-search-overview
16. Introducing Contextual Retrieval. Anthropic, 2024-09-19. https://www.anthropic.com/news/contextual-retrieval

---

This is a plain-text copy of https://promptlyfound.com/ai-search/rag from Promptly Found. The web page is the canonical version and includes the charts.
