The problem it solves
A language model learns from a fixed collection of text up to a certain date. It knows nothing about events after that date, about private documents it never saw or about details too obscure to have been learned well. When asked about such things, it may say it does not know, or it may produce a plausible but wrong answer, sometimes called a hallucination. Retraining a model every time information changes would be slow and expensive, so engineers needed another way.
Open-book answers
Retrieval-augmented generation, usually called RAG, gives the model an open book. When a question arrives, the system first searches a collection of documents, such as a company's policies, a product manual, medical guidelines or the web, and retrieves the passages most likely to contain the answer. These passages are inserted into the prompt along with the question, and the model is instructed to answer using them. The term was introduced in a 2020 research paper led by scientists at Facebook AI Research.
How the search works
Many RAG systems use semantic search based on embeddings, which are lists of numbers representing the meaning of text. Documents are split into chunks, and each chunk is converted into an embedding and stored in a special database called a vector database. The question is converted in the same way, and the system finds chunks whose meanings are closest, even if they use different words. Many systems combine this with traditional keyword search for better results.
Why businesses love it
RAG is one of the most common ways companies use generative AI. It lets employees ask questions in plain language about internal documents, helps customer service bots give accurate answers based on current policies and allows professionals to search large collections of legal, medical or technical information. Because the documents stay in the company's own systems and can be updated at any time, RAG avoids the cost of training a custom model and keeps information current.
Citations build trust
A major advantage of RAG is that answers can cite their sources. Users can click through to check the original document, which makes errors easier to catch and builds trust. AI search tools and assistants that browse the web use a similar approach, retrieving pages and summarising them with links. For organisations, the ability to trace an answer back to an official document is often essential for compliance and accountability.
Not a perfect fix
RAG reduces but does not eliminate errors. If the search step retrieves the wrong passages, the model may answer confidently from irrelevant material. If documents are outdated or contradictory, answers will be too. Models may still misread or embellish a source. Designing good RAG systems involves careful choices about how to split documents, how many passages to retrieve, how to rank them and how to instruct the model to say when the documents do not contain the answer.
Long context and RAG
As models gained the ability to read hundreds of thousands of tokens at once, some wondered whether RAG would become unnecessary, since entire document collections could simply be pasted in. In practice the two approaches complement each other. Long contexts are expensive and slower, and models can overlook details buried in very long inputs. RAG focuses the model on the most relevant material, while larger context windows allow more of it to be included.
Agentic retrieval
Newer systems go further, allowing AI agents to decide for themselves when and what to search, run several searches in a row, read results and refine their queries, much as a human researcher would. These agentic approaches can handle complex questions that require combining information from many sources. They also connect to databases, spreadsheets and other tools, so retrieval is not limited to text documents.
Why it matters
RAG is a practical answer to two of the biggest criticisms of chatbots: that they are out of date and that they make things up. By grounding answers in trusted, current sources and showing where information comes from, it makes AI more useful for work, study and decision-making. When you use an AI assistant that shows sources or answers questions about your own files, you are very likely using a form of retrieval-augmented generation.
Sources & further reading
- arXiv · Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al., 2020) ↗
- IBM Research · What is retrieval-augmented generation? ↗
- Google Cloud · What is retrieval-augmented generation? ↗
A simplified explanation of a technical topic. Photograph: original AI-generated illustration (Adobe Firefly). Reference organisations do not endorse this website.



