Retrieval-augmented generation
Definition
A technique where a language model first looks up relevant documents, then writes its answer using them, so answers can be grounded in real sources.
In plain English
RAG works like an open-book exam. Before answering, the system searches a collection of documents, usually using embeddings to find passages with similar meaning, and pastes the best matches into the model’s prompt.
This lets the model use information it was never trained on, such as your own files, and makes it easier to show where an answer came from.
Example
A school chatbot searches the student handbook for “late submission” and gives the model those paragraphs before it answers, instead of relying on what the model remembers.
Draft, not yet reviewed by a person · Updated Nov 2026