The essentials
- Definition: RAG is an AI architecture that, before generating an answer, retrieves relevant documents (web pages, an internal database) and supplies them to the language model as context.
- Why: it fixes the two weaknesses of LLMs — the knowledge cut-off and hallucinations — by grounding the answer in cited sources.
- Where: ChatGPT with search, Perplexity, Google's AI Overviews and AI Mode, Copilot, and most enterprise assistants.
- What's at stake: being "retrieved" (indexed, findable, extracted) then "selected" (a clear, reliable, consistent passage) is exactly the mechanism of GEO.
The aim of RAG (Retrieval-Augmented Generation) is an artificial intelligence architecture in which a language model doesn't answer solely from what it learned during training, but first receives relevant documents retrieved at the moment of the question: web pages, articles, product pages, internal documents. The model then writes its answer from those sources and can cite them. It is the mechanism that makes websites appear in the answers of ChatGPT, Perplexity or Google's AI Overviews, and therefore the technical heart of GEO.
Why RAG exists
A LLMs on its own has two weaknesses: its knowledge stops at its training date, and it sometimes produces plausible but false statements — hallucinations. Retraining a model for every news event is impossible; supplying it with up-to-date, verifiable documents at question time solves both problems at far lower cost. RAG turns the model from a "memory" into a "reader": it reads what you give it and synthesises it.
The stages of a RAG system
| Step | What happens | The equivalent in an answer engine |
|---|---|---|
| 1. Indexing | Documents are split into passages, converted into vectors (embeddings) and stored in a database | The engine crawling and indexing the web |
| 2. The question | The user's question is rephrased and sometimes broken into sub-questions | AI Mode's query fan-out |
| 3. Retrieval | The passages closest to the question are selected (vector and keyword search) | Selecting the candidate pages |
| 4. Ranking and filtering | The passages are reordered by relevance and reliability; duplicates are removed | Choosing which sources to cite |
| 5. Generation | The model writes the answer from the selected passages, with the citations | The answer displayed with links |
Where RAG is used
- Answer engines: Perplexity, ChatGPT with search, Copilot, AI Overviews and Google's AI Mode, which retrieve web pages in real time.
- Enterprise assistants: a chatbot answering customers from the product documentation, an internal assistant searching procedures, a sales tool drawing on the CRM.
- Analysis tools: an assistant that reads a dashboard's data or a platform's reports before commenting on them.
- Customer service: answers grounded in the company's knowledge base, with the source shown so it can be checked.
What RAG changes for a site's visibility
In an answer engine, a page passes through two filters. The first is retrieval: the page must be indexed, accessible to AI crawlers, and contain a passage whose meaning matches the question; these systems work on passages of a few hundred words, not on whole pages. The second is selection: among the passages retrieved, the model keeps those that answer directly, are consistent with each other, and come from sources judged reliable. Content structured into self-contained sections, with a direct answer under each heading, dated figures and a clear entity, passes both filters; content that is long, diffuse or inconsistent with other sources is retrieved but not selected. How to write for these systems is covered in structured content for LLMs, and how they work in full in AI engines explained.
The limits of RAG
- The quality of the sources: if the documents retrieved are false or out of date, so is the answer; RAG reduces hallucinations, it doesn't remove them.
- The chunking: a passage taken out of context can be misunderstood; hence the value of sections that stand on their own.
- Coverage: a page absent from the index or blocked can't be retrieved, however good it is.
- Cost and latency: every question triggers a search; systems limit how many documents they read, so competition to be selected is fierce.
How GreenRed helps
Rather than juggling several tools, GreenRed's GEO and AI module brings these metrics together in a single dashboard, compares them over time and tells you which actions come first. You can try it free, with no card, from the Pricing.
Frequently asked questions
What is RAG in artificial intelligence?
An architecture in which the language model receives relevant documents retrieved at question time (web pages, an internal database) before answering, and writes its answer from those sources while citing them. It fixes the knowledge cut-off and reduces hallucinations.
What is the difference between RAG and training the model?
Training fixes the model's knowledge once and for all, at great expense. RAG supplies the model with up-to-date documents at every question, without retraining it. Answer engines and enterprise assistants use RAG to answer on recent or specific facts.
Why does RAG matter for GEO?
Because it is the mechanism by which a site gets cited: your page must first be retrieved (indexed, accessible, containing a passage matching the question) then selected (a direct answer, reliability, consistency). Writing self-contained sections with verifiable facts answers exactly how it works.
Can a small business use RAG?
Yes: a customer assistant built on your product documentation, an internal assistant on your procedures, or an analysis tool that reads your marketing reports. AI platforms offer these building blocks without heavy development; the quality depends mostly on the document base you supply.