What RAG does
- 01
A question arrives
Someone asks about a policy or product
- 02
Search your documents
The retriever finds the best passages
- 03
Add them to the prompt
The model sees your content
- 04
Grounded answer
The reply is based on those passages
Retrieval-augmented generation feeds outside information to a model at the moment you ask a question. A search step finds relevant passages, and the model writes its answer from them.
Researchers describe it as a way to cut hallucination and improve quality when the answer needs knowledge the model was not trained on.
Because the retrieved text becomes part of the model's input, the quality of the retriever matters a great deal. See our entry on retrieval augmented generation.