karaza
AI fundamentals

Retrieval-augmented generation

Also called RAG

What is retrieval-augmented generation?

A setup in which an AI tool first searches a set of documents for relevant passages, then uses them to write its answer.

How it works

The documents are indexed in advance. When you ask a question, the system pulls the closest matching passages and adds them to the prompt, so the answer draws on your material rather than only the model’s training data.

Example

An HR chatbot answers “How many days of annual leave do I get?” by pulling the matching section of the company handbook.

Reviewed by Mahmoud, founder of Karaza, L3 in Education and TeachingUpdated