THE DIRECT ANSWER

Retrieval-augmented generation, or RAG, supplies relevant information to a model when it answers a question. A typical workflow retrieves passages and asks the model to use them. Reliability depends on source quality, retrieval and faithful interpretation, not just adding citations.

Two connected stages

A RAG system first finds relevant material, then supplies it to a model that produces an answer. This can connect an assistant to a changing document collection without retraining the model for every update. It does not ensure the retrieved passages are current, complete or correctly interpreted.

Trace one answer backwards

Suppose an employee asks about parental leave. A useful system must find the policy for the right location and employment situation, then preserve its conditions in the response. If the wrong document is retrieved, a beautifully written summary may still be wrong. If the correct document is retrieved, the model can still omit an exception.

Improve the weakest step

Test retrieval and answer quality separately. Record the query, passages, document versions and final response. Add questions that have no supported answer and check whether the assistant admits the gap. Keep permissions attached to the underlying sources. A practical first RAG project is a small, well-maintained collection with a clear owner; an enormous uncurated document dump makes errors harder to diagnose.

A worked example

For a fictional leave-policy assistant, store the current policy with its effective date. Retrieve the passage relevant to a request and require the answer to cite it. Add an old policy and an unanswerable question to the test. If the assistant uses the old rule, investigate retrieval and version handling before changing the wording of the final answer prompt.

COMMON QUESTIONS

Questions readers ask

Does RAG eliminate hallucinations?

No. It can provide evidence, but the system may retrieve the wrong material or misrepresent correct material. Test the full pipeline and its handling of missing information.

SOURCES & NOTES

Follow the evidence.

AI-assisted explanation with linked technical references. Examples are illustrative learning exercises, not reported customer deployments or experimental results.

  1. Lewis and colleagues: Retrieval-Augmented Generation

Public sources support the factual background. Analysis and illustrative exercises are identified in the text. How we assess AI · Editorial standards

Spot a factual error or an outdated detail?