Skip to content

What is RAG (retrieval-augmented generation)?

RAG, or retrieval-augmented generation, is a way for an AI chatbot to look up relevant information in outside sources, like a company's documents, before it answers. That makes answers more current, more specific and easier to check.

Updated September 24, 2026

RAG, short for retrieval-augmented generation, is a technique that lets an AI model look things up before it answers. Instead of relying only on what it learned in training, the system first searches a set of documents, such as a company's help center or internal files, and hands the most relevant passages to the model along with your question.

How it works

  1. Index the documents. Files are split into chunks and turned into numbers (called embeddings) by an AI model, then stored in a searchable vector database.
  2. Search. Your question is turned into numbers the same way and matched against the index to find the closest passages. Many systems mix this with ordinary keyword search.
  3. Augment the prompt. The best passages are added to your question.
  4. Generate. The model writes an answer using that context and can cite where the information came from.

Why companies use it

  • No retraining. To update what the system knows, you add new documents instead of training the model again.
  • Fresher answers. It can draw on current data, not just what the model saw during training.
  • Checkable answers. Replies can point to their sources, so people can verify them.

This is also how many "chat with your documents" tools and customer-support bots work.

The limits

RAG is only as good as its search step: if the right passage isn't found, the answer suffers. Models can only read a limited amount of text at once (their context window), so retrieval has to return short, relevant results. And when private files are involved, access controls matter, so each user only retrieves what they're allowed to see.

Where it came from

The name comes from a 2020 paper by Patrick Lewis and colleagues, which paired a text generator with a searchable index of Wikipedia. Lewis has joked that the team would have picked a better acronym had they known it would catch on.

RAG is often compared with fine-tuning, which changes the model itself. Many products use both.

Quick questions

What is the difference between RAG and fine-tuning?

Fine-tuning changes the model itself. RAG leaves the model alone and looks facts up at the moment it answers, which IBM compares to an open-book exam.

Does RAG stop AI hallucinations?

It reduces them by grounding answers in real documents, but it doesn't eliminate them. If the search step misses the right information, the model can still get things wrong.

Do you need to retrain a model to add new information to RAG?

No. You add or update the documents and their search index, and the model can use them right away.

Who invented RAG?

The term comes from a 2020 research paper led by Patrick Lewis, presented at the NeurIPS conference that year.

Sources: AWS: What is RAG?, IBM Research: What is retrieval-augmented generation?, NVIDIA: What is retrieval-augmented generation?, Lewis et al. (2020), the original RAG paper