AI news
AI model reviews
AI tools
How-to guides
Our staffAboutContact

What does RAG stand for in AI? Retrieval‑augmented generation explained

RAG stands for retrieval-augmented generation: the AI looks things up in a set of documents before it answers. Here's how it works, where it helps and where it still fails.

Library room lined with shelves full of books
Photo: Peter Herrmann on Unsplash

RAG stands for retrieval-augmented generation. It's a way of making an AI chatbot look things up in a trusted set of documents before it writes an answer, instead of relying only on what it memorised during training. If you've ever asked a company's help bot about its refund policy and got an answer that quoted the actual policy, there's a good chance RAG was doing the work.

It's one of the most useful ideas in applied AI right now, and also one of the most oversold. I think it's worth understanding both halves.

RAG in AI stands for retrieval-augmented generation

Take the three words one at a time. Retrieval means fetching relevant text from a collection of documents: a policy manual, a product wiki, a legal database, last quarter's sales reports. Augmented means that text gets added to the question you asked. Generation is the language model writing its reply, now with those passages in front of it.

The term comes from a 2020 paper by Patrick Lewis and 11 co-authors titled "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks". Their version paired a language model with "a dense vector index of Wikipedia". The authors pointed out that large models store facts in their parameters but struggle to update that knowledge or show where an answer came from. RAG was their fix.

The name stuck, though the meaning has loosened. Today people call almost any setup where a model reads retrieved documents before answering "RAG", whether or not it follows the original paper's design.

The mechanics: retrieve, augment, generate

A typical RAG system has two phases. The first happens once, ahead of time. Anthropic's write-up on contextual retrieval lays out the standard recipe clearly:

  1. Split the documents into chunks, usually no more than a few hundred tokens each.
  2. Run each chunk through an embedding model, which turns text into a list of numbers (a vector) that captures its meaning.
  3. Store those vectors in a vector database that can search by similarity of meaning as well as by matching words.

The second phase happens every time someone asks a question, and it's quick: the question is turned into a vector too, using the same embedding model so that questions and chunks can be compared on the same scale. The database finds the chunks closest in meaning, and the system pastes the best few into the prompt alongside the question. The model then answers, ideally citing those chunks.

Here's an analogy that I find genuinely helpful. A model without RAG is a student sitting a closed-book exam: it can only use what it remembers, and when memory fails it sometimes bluffs. RAG turns it into an open-book exam. The student still has to understand the question and write the answer, but now there's a textbook on the desk. The catch is obvious once you put it that way. An open book only helps if you turn to the right page.

That's why the retrieval step matters so much. If it pulls the wrong chunks, the model writes a fluent answer from the wrong material.

RAG in products you've probably used

You've probably met RAG without the label. Customer support bots that answer from a company's help centre are the classic case. Internal "ask the wiki" assistants at large firms are another.

Google's research notebook tool, NotebookLM, is a clear consumer example. Its site now calls it Gemini Notebook and promises that "The responses you get will always be grounded in the information you provide." You upload sources (PDFs, notes, web pages) and it answers from them. One of its featured public notebooks draws on 267 sources covering earnings reports for 50 large companies.

Legal research is a high-stakes example. LexisNexis and Thomson Reuters both built RAG-based assistants into their research products, Lexis+ AI and Westlaw AI-Assisted Research, which retrieve real case law before drafting an answer. Search assistants that show their source links, such as Google's AI Mode, work on a related idea, with the open web as the document collection.

Cloud providers sell the plumbing. AWS, for instance, has a whole explainer on RAG aimed at companies that want to connect a model to their own data "without the need to retrain the model."

Benefits and limitations

The appeal is easy to see. Retraining a large model on your company's documents is slow and expensive, and it goes stale the moment a policy changes. With RAG, you update the documents and the next answer reflects it. You also get citations, so a person can check where a claim came from.

The table below compares RAG with the two other common ways to give a model specialist knowledge. It's my own summary, so treat the "best for" column as a rule of thumb.

ApproachWhat it doesUpdating knowledgeBest for
RAGLooks up relevant passages at question timeEdit or add documentsLarge, changing document sets that need citations
Fine-tuningRetrains the model on examplesRetrain againTeaching a style, format or narrow skill
Long contextPastes everything into the promptChange what you pasteSmaller collections that fit in the model's window

That last row deserves a note. Anthropic's own guidance says that if a knowledge base is under 200,000 tokens (about 500 pages), you can often skip RAG and include the whole thing in the prompt. Plenty of teams build retrieval pipelines they don't need.

Now the limits, which are real. RAG reduces hallucinations; it doesn't remove them. The clearest evidence comes from a 2024 preregistered study by Varun Magesh, Christopher Manning, Daniel Ho and colleagues at Stanford, "Hallucination-Free? Assessing the Reliability of Leading AI Legal Research Tools". LexisNexis had promised "hallucination-free" legal citations. The researchers found that the tools from LexisNexis and Thomson Reuters each hallucinated between 17% and 33% of the time. That was better than GPT-4 on its own, but a long way from zero.

Why does it still go wrong? Retrieval can miss the right passage, especially when a chunk loses the context around it (a paragraph that says "the company's revenue grew 3%" without naming the company is hard to find). Anthropic reported that adding context to each chunk cut failed retrievals by 49%, and by 67% when combined with reranking. Those are its own numbers on its own test sets, so I'd read them as a sign of how much room retrieval has to improve, not a promise for your data.

The model can also misread a correct passage, or blend it with what it half-remembers. And it's only as good as its documents. Feed it an outdated policy and it'll quote the outdated policy with total confidence.

Practical takeaways for you

If you're a regular user, the main lesson is to check the citations. A cited answer is easier to verify, not automatically correct. Click through on anything that matters.

If you're choosing an AI tool for work, ask the vendor where its answers come from and how often the source collection is refreshed. A vendor that can't explain its retrieval step probably hasn't measured it.

If you're building something, start by asking whether you need RAG at all. A few dozen pages may fit in the prompt. When you do need it, spend most of your effort on retrieval quality and a test set of real questions; in my view that's where most RAG projects succeed or fail, far more than in the choice of model. Our guide to how large language models work covers the model side, and if you're weighing a career in this, how to become an AI engineer treats RAG as a core skill.

The next phase: agents and longer context

Two trends pull in different directions. Context windows keep growing, which shrinks the set of problems that need retrieval at all. At the same time, AI agents increasingly decide for themselves when to search, what to search for and whether the results are good enough, then search again. Some people call that "agentic RAG"; it's the same retrieve-then-generate idea run in a loop.

My guess is that the acronym fades before the technique does. Retrieval will likely become a default feature of most AI tools, the way spell-check is a default in word processors, and fewer people will think to name it. The hard part (finding the right page in the book) won't go away, though. If anything, the legal study suggests it's where the remaining errors live. For a wider view of where AI tools are going, see our piece on agentic AI.

FAQ

What does RAG stand for in AI?

RAG stands for retrieval-augmented generation. It's a technique where an AI system first retrieves relevant passages from a set of documents, adds them to your question, and then generates an answer based on them. It helps models give current, specific answers with sources, though it doesn't stop every mistake.

What does RAG in AI stand for?

Same thing: retrieval-augmented generation. The phrase was coined in a 2020 research paper led by Patrick Lewis. In practice, people now use "RAG" for any chatbot or AI assistant that looks up documents, databases or web pages before it writes a reply, like support bots and research notebooks.

Keep reading