Skip to content
AIDownload

Explainer · Updated November 28, 2026 · 3 minute read

What is retrieval-augmented generation (RAG)?

The short answer

Retrieval-augmented generation (RAG) is a technique in which an AI system looks up relevant documents before it answers and gives them to the language model along with the question. The model then writes its answer from that material, which lets it use current or private information that was never part of its training.

How RAG works

A language model on its own answers from what it absorbed during training. That knowledge stops at a cutoff date and does not include a company's internal files. RAG adds a search step in front of the model.

When a question comes in, the system searches a collection of documents for passages that look relevant. It places the best matches in the prompt, together with the question and an instruction to answer from them. The model reads all of it and writes a reply, often with citations that point back to the sources.

Where RAG is used

RAG sits behind many products that answer questions about specific material.

  • AI search tools such as Perplexity retrieve web pages and cite them in the answer.
  • Company assistants answer staff questions from internal policies and manuals.
  • Customer support bots answer from a product's help pages.
  • Coding assistants often search a project for relevant files before they suggest a change.

How it compares with fine-tuning

Fine-tuning changes the model itself through extra training. RAG leaves the model untouched and changes what it is shown at the moment of the question. Updating a RAG system means updating the document collection, which can be done at any time and needs no training.

RAG suits questions that depend on specific facts or documents. Fine-tuning is the better choice when the model already has the information and the problem is how it responds, such as tone or output format. Some applications skip retrieval and place whole documents in the prompt, which a long context window allows but which costs more per question as the material grows.

Limits

RAG reduces made-up answers, known as hallucinations, but does not remove them. If the search step returns the wrong passages, the model may answer confidently from poor material, or ignore the documents and fall back on its training. Retrieved pages can also contain text written to manipulate the model, a problem known as prompt injection.

Common questions

What does RAG stand for?

RAG stands for retrieval-augmented generation. Retrieval is the search step, and generation is the model writing the answer.

Do you need a vector database for RAG?

No. Retrieval can run on any search system, including ordinary keyword search or a web search engine. Vector databases are common because they find passages by meaning when the wording differs.

Is RAG the same as an AI searching the web?

Not exactly. A chatbot that searches the web before it replies is doing one form of RAG, and the same approach works over any collection of text, such as a company's private documents.

Written and reviewed by AI DownloadHow we write and review explainers

RAG in the news

Research · Nov 2 · arXiv cs.AI + cs.CL

SoK: Agentic Retrieval-Augmented Generation (RAG): Taxonomy, Architectures, Evaluation, and Research Directions

This Systematization of Knowledge paper offers a unified framework for Agentic RAG, where LLMs autonomously handle multi-step reasoning, memory management, and iterative retrieval. It models these retrieval-generation loops as finite-horizon partially observable Markov decision processes and builds a taxonomy and modular architecture breakdown on top of that.

Why it matters. Agentic RAG is spreading fast in industry but remains fragmented and inconsistently evaluated, so a shared formal framework could help standardize how these systems are built and judged.

Research · Nov 24 · arXiv cs.AI + cs.CL

Retrieval-Augmented Generation in the Agentic Era: Tradition, Present, and Prospect

This survey maps retrieval-augmented generation along a single lifecycle, from offline indexing through pre-retrieval, retrieval, post-retrieval, and orchestration. It treats indexing and orchestration as core components, frames agentic workflows as their own paradigm, and also covers evaluation, applications, and open questions.

Why it matters. As RAG shifts toward agent-driven pipelines, a unified lifecycle view gives practitioners and researchers a common framework for building and evaluating these systems.

Research · Oct 8 · arXiv cs.AI + cs.CL

A Survey of Secure Retrieval-Augmented Generation

This survey reviews 135 works on attacks, defenses, and security evaluation for retrieval-augmented generation, treating secure RAG as a problem of protecting external knowledge access. It introduces the SLOT taxonomy (attack surface, defense layer, objective, target scope) and finds three mismatches: attacks outpace defenses and evaluation for certain targets, attacks outnumber defenses at the earliest pipeline stage, and fluent, corpus-fitting attacks evade anomaly-based defenses.

Why it matters. As RAG becomes a default way to ground LLMs, this map of where attacks outrun defenses helps builders and researchers prioritize the gaps that matter most.

Keep reading

Follow the news behind these terms

The digest covers what happens in AI each day, with terms linked to these explanations.