Retrieval-augmented generation
Also called: RAG
By HubAI editorial team · Source checked: 24 October 2026What does it mean?
A workflow that retrieves relevant material and supplies it to a generative model when answering. The retrieval system and the model have separate jobs, and either can fail.
Picture this
A staff assistant finds passages from your holiday policy, passes them to the model and drafts an answer with links back to the policy.
Where you’ll come across it
Internal knowledge search, customer support and document questions. It can help use changing information without retraining the model for every update.
What it doesn’t mean
RAG does not grant permission to read a file or guarantee a correct answer. Apply document permissions before retrieval and test whether the chosen passages really answer the question.
Follow the answer back to its evidence
A short exercise · use fictional or non-sensitive material.
- Use a fictional policy containing a rule and an exception. Keep a second, outdated version clearly marked.
- Ask a question that depends on the exception and inspect the passages selected by the search step.
- Check the final answer against those passages, including the version date. A plausible answer with the wrong source is a failed test.
Did retrieval find the right material, and did generation use it faithfully?
Did that make it clearer?
Likes are a private on-page choice, not a public rating. For a correction or complaint, send the pre-filled form to our editorial inbox. Nothing is sent until you submit it.Check the source
Written and explained by HubAI. The reference below lets you go deeper; it is not an endorsement of a particular product.
Technical reference: huggingface.co ↗