Illustration of documents connected to a search lens and an answer card.
LLMs5 min read

How to evaluate AI answers grounded in documents

Evaluating answers from an AI that consults documents requires reviewing retrieval and writing separately. An answer can sound correct while using the wrong passage, or retrieve the right source and misinterpret a condition.

This tutorial helps you build a small evaluation with questions, expected evidence and a consistent way to record failures. You can perform the exercise before choosing a specialized evaluation platform.

1. Prepare questions with references

Choose real situations the collection should answer and record their corresponding sources. Include a question about an exception and another whose answer is absent from the documents.

In a fictional example, a procedure says incomplete requests return to the requester. A question about who approves a request without a quantity should lead to that condition, not to invented authorization.

Case Expected evidence
Direct question Passage containing the main rule
Exception question Condition and exception procedure
Old source available Identified current version
Missing information Answer identifying the absence

Microsoft’s RAG evaluation guidance distinguishes retrieval quality from answer quality. That separation underpins our checklist, independently of the specific tools described in the documentation.

2. Evaluate what retrieval found

Before reading the final answer, inspect the selected passages. Check whether they address the question, are current and belong within the user’s authorized access.

If required evidence was not retrieved, record a retrieval failure. Rephrasing the answer alone does not fix the absence of the rule the model needed to consult.

Compare the first results with the expected document. Also save queries that return substantial related content but omit the necessary information.

3. Check the answer’s claims

Divide the text into verifiable instructions and find evidence for each one. A reference at the end of a paragraph does not guarantee support for every sentence.

Check whether the answer addresses the question and preserves limits and exceptions. A summary may retain the general rule while omitting precisely the condition relevant to the case.

Evaluate the answer using the question and supplied passages.
List each claim and its supporting evidence.
Flag unsupported claims, omitted conditions and incorrect references.
Distinguish retrieval errors from interpretation errors.
Do not use external knowledge to complete the answer being evaluated.

AI can help prepare this report, but its judgment also needs checking. Using another model as a judge does not automatically make the evaluation objectively correct.

4. Use simple, repeatable criteria

Classify each case as correct, partly correct or incorrect, explaining why. Keep the criteria consistent between tests so comparisons reflect changes to the system.

Record missing evidence, outdated sources, misinterpretation and incomplete answers separately. Those categories suggest different improvements to the collection, retrieval or instructions.

Do not hide a serious exception inside an overall average. A single access-control or unsupported-authorization failure may matter more than several easy answers.

5. Change one thing at a time

Changing documents, passage sizes and instructions simultaneously makes it difficult to identify what helped. Choose one change, repeat the same questions and compare results.

Add cases when real use reveals an important failure. The evaluation collection should represent the application’s work, not only examples it already handles well.

6. Document the decision to use it

Keep the collection version, relevant configuration, questions and results. Decide which errors need correction before expanding access and which responses require a person’s review.

If problems start with sources, revisit knowledge base organization. To review retrieval, see how to compare text and semantic search.

Frequently asked questions

What should I evaluate in a RAG answer?

Assess whether retrieval found the right evidence and whether the answer uses it to address the question while preserving conditions and exceptions.

Does a citation guarantee that a sentence is correct?

No. Open the source and check that its passage actually supports the claim and belongs to the appropriate version.

How can I compare two configurations?

Use identical questions and criteria, record the collection version and change one condition at a time to understand its effect.