Skip to content
ML Academy

Introduced on day 48

Retrieval-augmented generation (RAG)

A pattern in which relevant passages are retrieved from a corpus at request time and supplied to a language model, so answers can use documents the model was not trained on.

In detail

A RAG system is a pipeline of ingestion, chunking, indexing, retrieval, optional reranking, context assembly, generation and validation. Updating the corpus updates the assistant without retraining. It does not remove hallucination: the retrieved evidence can be missing, stale or ignored, and retrieved text is untrusted input.