AI Glossary Term

What does “RAG (Retrieval-Augmented Generation)” mean?

Definition

A method that retrieves external knowledge and feeds it into generation at inference time.

How RAG (Retrieval-Augmented Generation) works

Diagram for RAG (Retrieval-Augmented Generation), steps in order: Question; then Retrieve relevant passages from your documents; then Add them to the prompt; then Model answers using the passages; then Answer with citations.QuestionRetrieve relevant passages from yourdocumentsAdd them to the promptModel answers using the passagesAnswer with citations

Example

A company chatbot answers staff questions about HR policy. It first searches the policy documents for relevant paragraphs, hands them to the model, and the model answers based on those paragraphs and can point to the source.

Why it matters

RAG lets a model use current or private information without retraining and makes answers easier to check. It reduces, but does not eliminate, made-up answers.

Common questions

RAG vs fine-tuning?

RAG supplies knowledge at answer time and is easy to update. Fine-tuning changes the model's behavior or style.

What can go wrong?

If retrieval finds the wrong passages, the answer may be wrong, and the model may still add unsupported details.

What does RAG need?

A document collection, a way to search it, often using embeddings and a vector database, and a model to write the answer.

Learn more in our free guides

Test yourself

See also