RAG (Retrieval-Augmented Generation)

Last Updated: July 29, 2026 | By Mihail Sebastian | AI Dictionary

A technique where a language model retrieves documents from an external source and grounds its answer in them instead of relying on memory alone.

What is RAG (Retrieval-Augmented Generation)?

Retrieval-augmented generation (RAG) is a technique in which a language model retrieves relevant documents from an external source and uses them as context when writing its answer. Instead of answering from whatever it absorbed in training, a RAG system answers from evidence it looked up seconds ago.

That makes RAG the standard mitigation for hallucination: answers trace back to real sources, and the knowledge base stays current without retraining the model.

How RAG Works

A RAG pipeline runs in three steps. First, the user’s question is converted into a numerical vector (a word embedding) and matched against a pre-indexed knowledge base – company documents, manuals, a wiki. Second, the best-matching passages are inserted into the model’s prompt alongside the question.

Third, the model writes its answer with those passages in view, and the system attaches citations that show which source supports each claim.

This differs from fine-tuning, which bakes new knowledge into the model’s weights. RAG adds knowledge at query time: update the documents and the next answer reflects the change, with no training run.

Applications of RAG

Example of RAG

An insurance company builds a support chatbot. A customer asks whether water damage from a burst pipe is covered. The retriever searches that customer’s policy documents and pulls the clauses on water damage.

Those clauses go into the prompt, and the model writes an answer that quotes the relevant clause and links to it. Without retrieval, the model would answer from general knowledge of insurance policies – plausible, generic, and possibly wrong for this customer’s actual contract.

Related AI terms: Hallucination · Fine-tuning · Guardrails · Generative AI

Did you like the RAG (Retrieval-Augmented Generation) gist?

Learn about 250+ need-to-know artificial intelligence terms in the AI Dictionary.

Mihail Sebastian — Writes about AI governance, regulation, and the technology behind them. Placeholder bio — replace with a real credential line. About

Read the Governor's Letter

Stay ahead with Governor's Letter, the newsletter delivering expert insights, AI updates, and curated knowledge directly to your inbox.

By subscribing to the Governor's Letter, you consent to receive emails from AI Guv.
We respect your privacy - read our Privacy Policy to learn how we protect your information.

Browse All AI Terms A–Z

Every term in the dictionary, in alphabetical order. Jump to a letter or scroll the full list.

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z