Retrieval-Augmented Generation (RAG) is an AI architecture that lets a large language model pull relevant information from an external source — a document store, database, or the live web — and use it as context before answering, instead of relying only on what it memorised during training.
A RAG system runs in three steps. First it retrieves: the user's question is turned into a numerical vector embedding and matched against a vector database to find the most semantically similar passages. Then it augments: those passages are inserted into the prompt alongside the original question. Finally it generates: the model writes an answer grounded in the supplied text, frequently citing which document each fact came from.
Two chronic weaknesses of language models drove its adoption. A base model's knowledge is frozen at its training cutoff, and it will state wrong details with total confidence — a failure known as AI hallucination. Feeding the model current, verifiable source text at query time addresses both problems.
Example: a bank's support assistant kept quoting outdated fees because that data lived in its training set. After it was wired to RAG over the current rate sheet, the same question — "what is the wire-transfer fee?" — returned the live figure with a link to the source PDF. No retraining was needed; updating the underlying document instantly updated the answers.
AI Overviews, ChatGPT search, Perplexity, and similar tools are essentially RAG systems pointed at the web: they retrieve pages, then synthesise an answer. Your content can only be quoted if it is retrievable and clearly relevant to the query, which reframes optimisation around being a strong retrieval candidate.
Optimising to be the source a RAG engine selects is the heart of generative engine optimization.