# Retrieval-augmented generation (RAG)

Category: [AI Search & GEO](https://seo-geo-glossary.com/en/glossary/category/ai-search-geo/) › [Retrieval & grounding](https://seo-geo-glossary.com/en/glossary/category/ai-search-geo/retrieval-grounding/) · Also known as: RAG, retrieval augmented generation

**Retrieval-augmented generation** (RAG) is a method in which a language model retrieves relevant information from an external source before answering and uses it in the response. This lets the model work with current or specialized content that is not in its training data and point to the sources it used.

## How does RAG work?

A RAG system works in three steps:

1. **Retrieval:** For the incoming question, the system searches a document collection for matching passages. This is often a vector search over embeddings, sometimes combined with classic keyword search.
2. **Augmentation:** The retrieved passages are added to the prompt together with the question.
3. **Generation:** The language model writes the answer based on the question and the added context.

Before any of this, the source documents are usually split into chunks, converted into embeddings and stored in a vector database. That indexing step runs once and is repeated when the content changes.

The term comes from a paper by Patrick Lewis and co-authors, first posted on May 22, 2020 and accepted at NeurIPS 2020. They combined a pretrained sequence-to-sequence model, which they called parametric memory, with a dense vector index of Wikipedia as non-parametric memory.

Compared with retraining or fine-tuning a model, RAG has practical advantages. The knowledge base can be swapped or updated without touching the model, and answers can cite their sources. The trade-offs are extra infrastructure and an added retrieval step before each answer.

## What does RAG mean for SEO and GEO?

Many AI search products follow this pattern. They search the web for a question, read the pages they find and summarize them. Google's Gemini API, for example, documents a flow in which the model runs searches, processes the results and returns an answer with citations. Perplexity runs PerplexityBot to surface and link websites in its answers.

For site owners, a page can only serve as a source if the relevant bot is allowed to fetch it and can read its content. Pages that answer a specific question in a clearly labeled section give a retrieval system an obvious passage to pick. For its own AI features, Google states that its systems understand pages covering several topics and that there is no need to break content into tiny pieces.

## Example

A company builds a chatbot for its product manuals. The manuals are split into sections and stored as vectors. When a customer asks "How do I reset the device?", the system fetches the three closest sections, passes them to the language model and shows links to the manual pages under the answer.

## FAQ

**Is ChatGPT a RAG model?**
The model itself is not. RAG describes an architecture built around a model. When ChatGPT uses web search or uploaded files to support an answer, that follows the RAG pattern.

**Does RAG prevent hallucinations?**
It can reduce them because the model works from retrieved text. It cannot rule them out. If retrieval returns the wrong passages or the model misreads them, the answer is still wrong.

**What is RAG in an LLM, with an example?**
A support assistant that looks up the current returns policy in the company's knowledge base before answering, then quotes and links it, is a typical RAG setup.

## At a glance

- **Type:** technique (architecture around a language model)
- **Steps:** retrieval, augmentation, generation
- **Since:** 2020, term from Lewis et al.
- **Docs:** [Lewis et al.: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (arXiv:2005.11401)](https://arxiv.org/abs/2005.11401)

Last checked: October 8, 2026

*Diagram: Retrieval-augmented generation.* In retrieval-augmented generation, the system first retrieves matching passages and passes them to the language model as context. Google calls the link between model output and verifiable sources grounding. The answer can only cite what was retrieved first (an inference from the method, not a Google statement).

## Not to be confused with

- [Grounding](https://seo-geo-glossary.com/en/glossary/grounding/index.md): describes the goal of anchoring an AI answer in external, verifiable sources, usually with citations. RAG is one technical way to get there.

## Related terms

- [Grounding](https://seo-geo-glossary.com/en/glossary/grounding/index.md)
- [Embeddings](https://seo-geo-glossary.com/en/glossary/embeddings/index.md)
- [Vector search](https://seo-geo-glossary.com/en/glossary/vector-search/index.md)
- [Large language model (LLM)](https://seo-geo-glossary.com/en/glossary/large-language-model/index.md)

## Sources

- [Lewis et al.: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, arXiv:2005.11401 (submitted 2020-05-22), NeurIPS 2020](https://arxiv.org/abs/2005.11401)
- [What is RAG (Retrieval-Augmented Generation)? – AWS](https://aws.amazon.com/what-is/retrieval-augmented-generation/)
- [Grounding with Google Search – Gemini API Docs](https://ai.google.dev/gemini-api/docs/google-search)
- [Google's guide to optimizing for generative AI features on Google Search – Google Search Central (updated 2026-07-10)](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide)
- [Perplexity Crawlers – Perplexity Docs](https://docs.perplexity.ai/docs/resources/perplexity-crawlers)

---

Last updated: October 8, 2026
URL: https://seo-geo-glossary.com/en/glossary/retrieval-augmented-generation/
