RAG

Also called: retrieval-augmented generation

Filed under AI & modern tech

What RAG means in practice

The term comes from a 2020 research paper by Patrick Lewis and colleagues. Today it is used loosely for any setup that fetches information and adds it to the prompt, whether the search step uses embeddings, keywords or a live web search.

You hear it most in business settings: support bots that answer from a help center, internal assistants that search company wikis, and AI tools that cite their sources. If an answer comes with links to the documents it used, RAG or something like it is usually behind it.

One nuance: RAG reduces made-up answers but does not eliminate them. If the search step returns the wrong passage, the model can still give a confident, wrong answer.

A support bot that searches your help center for the refund policy, then answers using the passage it found, is using RAG.

Used in a sentence: We don’t need to retrain the model; we’ll use RAG over the product docs instead.

Often confused with

Fine-tuning
Fine-tuning changes the model’s weights through extra training. RAG leaves the model unchanged and feeds it information at question time, which suits facts that change often.
Search engine
A search engine returns a list of results for you to read. RAG uses search as one step, then has a model read the results and write a single answer.
Embeddings
Embeddings are a common way to run RAG’s search step, not RAG itself. RAG is the overall retrieve-then-generate pattern.

What is RAG? →

How it works, examples, and common questions, explained in plain English.

Common questions

What does RAG stand for in AI?

RAG stands for retrieval-augmented generation. Retrieval means fetching relevant information, augmented means that information is added to the prompt, and generation means the language model writes the answer. In project management, RAG usually means red-amber-green status, which is unrelated.

Who came up with the term RAG?

It was coined in the 2020 paper “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks” by Patrick Lewis and colleagues. Combining search with text generation existed before, but that paper named the approach and made it widely known.

Sources and further reading

  1. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al., 2020) — arXiv
  2. Introducing Contextual Retrieval — Anthropic

Read more