---
title: "Retrieval-augmented generation"
url: https://marketingsignals.com/glossary/retrieval-augmented-generation
type: Page
---

# Retrieval-augmented generation

What is RAG? Retrieval-augmented generation explained: where it came from, how AI search tools use it and how retrieval decides which pages get cited.

GEO glossary

## Retrieval-augmented generation (RAG)

Retrieval-augmented generation (RAG) is a method where an AI system first retrieves relevant documents, such as web pages, and passes them to a language model that writes the answer from them. It is the approach behind AI search tools such as ChatGPT search and Perplexity, which ground answers in current pages and cite them.

## Where does RAG come from?

The term comes from a 2020 paper, Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, by Patrick Lewis and colleagues at Facebook AI Research and University College London. It paired a pre-trained language model with a dense vector index of Wikipedia, searched by a neural retriever. The authors noted that models relying only on training data struggle to update their knowledge or show where an answer came from.

## How RAG works in AI search

Each platform differs in the details, but the steps are broadly the same.

- Turn the question into one or more search queries
- Retrieve candidate pages from a search index
- Split pages into passages and score each against the query
- Pass the best passages to the model as context
- Write the answer and link the pages it used

## How retrieval decides which pages get cited

A page can only be cited if it is retrieved, and only retrieved if it is in the index the assistant searches. Google says a page must be indexed and eligible to show with a snippet to appear as a link in AI Overviews or AI Mode. OpenAI says sites that opt out of OAI-SearchBot will not be shown in [ChatGPT search](https://marketingsignals.com/service/ai-search-optimisation/chatgpt-seo) answers.

After that, passages compete on relevance. Perplexity says its index divides documents into fine-grained units that are scored individually against the query. A paragraph that names the subject and answers one question directly is easier to match than an answer spread across a page.

## Example

A tenant asks Perplexity how much notice a landlord must give. The system searches, splits candidate pages into passages and keeps the few that state the rule most directly. A letting agent's guide with a heading for each type of notice and the period in its first sentence gives the retriever a clean match. A page that buries the figure in a long introduction may never reach the model.

## Related terms

- [Query fan-out](https://marketingsignals.com/glossary/query-fan-out)
- [AI citations](https://marketingsignals.com/glossary/ai-citations)
- [Semantic search](https://marketingsignals.com/glossary/semantic-search)
- [Perplexity](https://marketingsignals.com/glossary/perplexity)
- [Large language model (LLM)](https://marketingsignals.com/glossary/large-language-model)

## Further reading

- [How to Write Content for SEO That Converts and Ranks](https://marketingsignals.com/insights/how-to-write-content-for-seo-that-converts-and-ranks)

Our [AI SEO & GEO](https://marketingsignals.com/service/ai-search-optimisation) service puts this into practice for brands in the UK and US.

## Sources

- [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al., arXiv 2005.11401, 22 May 2020)](https://arxiv.org/abs/2005.11401)
- [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, UCL Discovery](https://discovery.ucl.ac.uk/id/eprint/10100504/)
- [AI features and your website, Google Search Central](https://developers.google.com/search/docs/appearance/ai-features)
- [Overview of OpenAI crawlers, OpenAI](https://developers.openai.com/api/docs/bots)
- [Introducing the Perplexity Search API, Perplexity](https://www.perplexity.ai/hub/blog/introducing-the-perplexity-search-api)

## Ready To Get Found In AI Search?

Get in touch for a friendly, informal chat with our team about how we can help your business thrive online.
