← Concept Index

Retrieval & knowledge

Retrieval-augmented generation (RAG)

Also called: grounding, chat with your documents

DEFINITION

RAG fetches relevant documents at the moment you ask, and puts them into the model's context so the answer is based on supplied text rather than only on training memory.

WHY IT MATTERS

It's how you get current, source-backed answers without retraining, and how 'chat with your PDF' works. But it only helps if the right passage was actually retrieved — a bad search quietly produces a confident, ungrounded answer.

COMMONLY CONFUSED WITH

Fine-tuning. RAG supplies facts at use time and can cite them; fine-tuning changes the model's behaviour and can't easily stay current.