What is retrieval-augmented generation?
Short answer
Retrieval-augmented generation, or RAG, supplies a language model with relevant passages from a separate knowledge base at request time. This lets a response use up-to-date sources and show its evidence. Reliability depends on finding the right passages, representing them accurately and applying the same access restrictions as the source system.
On this page
Separate the failure modes
An index can capture source, document version and section. A retrieval system searches the eligible passages, and a language model uses the selected evidence to draft its answer. The application preserves source information, access rules and a clear outcome when evidence is missing.
Test relevant and irrelevant questions, contradictory document versions and restricted material. An index can be corrected independently of the prompt or model, provided testing shows which step lost the correct evidence.
Choose document boundaries that preserve meaning
A passage about a policy exception may depend on the heading and a preceding paragraph. Keep enough surrounding context for the user to verify whether the exception applies. Store source, version and access metadata alongside the passage.
Evaluate retrieval separately from generation. A missing passage is a search or indexing problem. A correctly retrieved passage that is misrepresented points to a different failure. Test both separately alongside the privacy and access boundaries that determine which content can be shown.
Worked example
An assistant looks up the current travel policy and shows the relevant passage and version. If different editions conflict, it highlights the problem before suggesting a conclusion.
How to proceed
- Version approved source documents and divide them into meaningful passages.
- Retrieve evidence based on the question and the user’s permissions.
- Evaluate retrieval quality, factual accuracy and authorization separately.
- Risks and boundaries
- An answer may quote an irrelevant passage or misrepresent the right one. Opening a linked source should be part of the review.
- Decision criteria
- Use RAG when the answer needs to depend on information that can be updated and checked independently of model training.
Frequently asked questions
Does RAG require training a new model?
The retrieval step can add information at request time without training a new model.
What does a citation show?
It identifies a possible source. The actual passage needs to support the precise claim.
How can I identify a quality problem?
Check whether the source was retrieved correctly, the response interpreted it accurately and the user was allowed to see it.
Sources
Giminger Consulting
Discuss how to apply this guidance to your organization.