Evaluating RAG: did the assistant fail to find the evidence, or find it and answer incorrectly?

July 21, 2025

“I'm an ordinary member on the team plan. Nine days ago I accidentally deleted a board. Can it still be recovered? Can I do it myself?”

Suppose you're responsible for the support assistant in a collaborative whiteboard product. It retrieves passages from the help center, then asks a language model to read them and answer the user. This is retrieval-augmented generation (RAG). The assistant replies, “Yes, just click Restore in the trash.” The user follows the advice but can't find the button.

What would you change? If search found only “retained for 30 days,” the model never saw the permissions rule. If search found “from day 8, an administrator must submit the request” but the assistant still told the user to click, inspect the answering step. To distinguish these failures, retain at least the user's question, what the model actually saw, and what it ultimately said. We'll evaluate the same support ticket end to end. The product and rules are fictional.

Evaluation design: distinguish retrieval and answer errors with one ticket

Step 1: Look it up yourself and define a correct answer

Suppose the help center contains the following three passages on related topics. A, B, and C are identifiers for checking the sources.

IDHelp center text
A · Plans and retentionBoards deleted on the personal plan are retained for 7 days. On the team plan they are retained for 30 days. They are permanently removed when the period expires.
B · Restore permissionsWithin the plan's retention period, the original creator can restore a board during the first 7 days after deletion. From day 8, only a workspace administrator can submit a recovery request.
C · File exportWorkspace administrators can export boards from the admin interface. Export download links remain available for 30 days.

We need two facts. A establishes that day 9 is within the team plan's retention period. B tells us who can act then. C also mentions “administrator,” “board,” and “30 days,” but it's about exports. We can now create the first evaluation case: one question and scoring criteria written in advance.

  • Question: A team-plan member deleted a board 9 days ago. Can it still be recovered, and who handles it?
  • Required evidence: A and B. Either one alone leaves a condition missing.
  • Reference answer: The board is still within the 30-day retention period. Ask a workspace administrator to submit a recovery request. An ordinary member can no longer restore it by themselves.
  • Pass criteria: State both that a request is still possible and that an administrator must make it. Different wording is fine. The source promises only that a request can be made, so “recovery is guaranteed” goes beyond the evidence.

This preparation determines whether later numbers mean anything. Make “30 days” the only expected answer, and the assistant could copy the export link lifetime and still get full marks.

Step 2: Inspect just the search results. How highly did the evidence rank?

Suppose search returns A, C, B, in that order. To limit the amount of text the model receives, the application takes only the first two passages. Engineers often call this top-k: take the first k ranked items. Here k is 2. The correct permissions passage is third in the search results, but the answering model reads only A and C.

There are two ways to count. Recall@k asks how much of the required evidence appears in the top k. Precision@k asks how many of the top k items actually support this question. We've labeled two required passages, and each retrieved passage appears only once.1

Materials given to the modelRecall@k: required passages found / all required passagesPrecision@k: relevant passages / passages retrieved
Top 1: A1 / 2 = 50%1 / 1 = 100%
Top 2: A, C1 / 2 = 50%1 / 2 = 50%
Top 3: A, C, B2 / 2 = 100%2 / 3 ≈ 67%

Going from the first row to the second gives the model more text but still no permissions rule. There are two changes we can test separately. Increase k from 2 to 3 to include B, or keep the two-passage budget and rank B ahead of C. If reranking returns A and B, both metrics are 100% on this question. Repeat the test on other questions before deciding to keep the change.

Real systems sometimes deduplicate, truncate, or rerank after search. For diagnosis, save both the original result order and the final text sent to the model. Then you can distinguish never finding B from losing it along the way.

Step 3: Does a complete set of passages guarantee a passing answer?

Give the same question three responses. For each, check whether every claim follows from the material the model actually saw and whether it resolves the user's problem according to the reference answer. The first property is called faithfulness.2

Materials seenAssistant's answerJudgment
A, C“Team boards are retained for 30 days, so day 9 is within the period. The information I have doesn't say who can act.”Its claims are supported and it acknowledges the gap, but the user still doesn't know whom to ask. Investigate why B was third.
A, B“You're still within the period. You can restore it yourself from the trash.”The first sentence is supported; the second contradicts B. The evidence arrived. Check how the model applies the day-8 condition.
A, B“You're still within the 30 days. Ask a workspace administrator to submit a request. It will be restored within two hours.”The retention period and operator are correct, but the turnaround promise is invented. Searching only for “administrator” would incorrectly pass this answer.

For a real error, try an inexpensive controlled comparison. Keep the question, model, and answering instructions fixed. Manually replace the materials with the labeled A and B, then ask again. If the answer becomes correct, trace retrieval and filtering first. If it still tells an ordinary member to click, you have reproduced an answering failure even with complete evidence. Keep both inputs and outputs in the same ticket. That's easier to diagnose than “the model made something up.”

Step 4: Turn one worked example into a first evaluation set

Start with the same help documents and change just one condition in the question. See whether the passing answer changes with it.

Test questionWhat it checksEssentials of a passing answer
Team plan, deleted 9 days ago. Can I restore it myself?Use retention and permissions togetherA request is still possible; the administrator handles it.
What about the personal plan, also on day 9?Does the assistant repeat “ask an administrator” for every plan?The 7-day period has expired. A says it has been permanently cleared.
Team plan, I'm the creator, and I deleted it 3 days ago. What now?Can the assistant reverse its action advice when conditions change?Within retention, the original creator can self-restore.
A team administrator has submitted the request. What's the maximum number of hours to recovery?Can it identify missing information when no deadline is documented?The available documentation promises no turnaround time.

For each question, keep a row with the question, document version, human-labeled evidence and answer points, retrieved passages and order, final materials sent to the model, and final response. Count invented deadlines separately on questions like “how many hours at most?” No passage supports a specific number, so forcing a recall calculation would give a zero denominator.

Change only one stage in the next round. For example, keep the model and answering instructions fixed and change the search ranking. On the same questions, compare which ones went from wrong to right and which went from right to wrong before summarizing passes by category. Four demonstration questions are enough to exercise the evaluation pipeline. To judge production performance, hold out real support tickets from debugging and include the ways users actually ask.

Evaluation in practice: prepare data, chunk text, and assess answers with Ragas

In July 2025 I wanted to compare ways to split documents, so I looked for papers to see which questions researchers tested and how they scored results. I chose MuSiQue for multi-hop questions and Ragas as an evaluation reference because both appeared repeatedly in the RAG research I read. I may also have asked Cursor to compare candidates. After choosing a direction, I specifically asked how Ragas scores answers and whether semantic matching uses vectors.

On July 18 I read A New HOPE. Its Figure 5 applies eight chunking configurations to the same material, calculates both the authors' HOPE metric and Ragas scores, then compares their correlation. The same material can be scored under different rules. For my experiment, I first needed to choose questions and understand what each number actually measured.3

Use MuSiQue to prepare questions, reference answers, and supporting passages

I downloaded the MuSiQue development set. Its multi-hop questions require combining several pieces of evidence. The file musique_ans_v1.0_dev.jsonl contains one complete record per line. In each record, question holds the question, answer and answer_aliases give the reference answer and alternatives, and the paragraphs marked is_supporting were used to construct the question. They correspond to the manually labeled A and B in the support ticket.4

Give the search system the candidate passages and reserve the support labels for scoring. Now ask the same question twice. How many pieces of evidence are found when indexing original paragraphs? How many when using fixed-length chunks instead?

Prepare the fixed-length comparison with a Qwen tokenizer

A fair comparison uses the same text for both methods on each question. One version retains original paragraphs. The other concatenates them in order and uses a local Qwen tokenizer to convert them into tokens, the text units it recognizes, preparing chunks of 256 or 512 tokens. The experiment loads local files with AutoTokenizer.from_pretrained("./tokenizer", local_files_only=True). This ensures “256” is counted by the same rules on every run.5

Rechunking changes boundaries: a supporting passage can straddle two chunks. To compute the recall defined earlier, preserve the source paragraph IDs and text ranges for each chunk, then check whether the chunks sent to the model collectively cover the sentences required to answer.

How far did my first program get? It scanned all candidate chunks for each question, checking whether any chunk contained the final answer or an alias. With the original paragraphs, all 2,417 questions hit. The notebook output was Recall = 1.000. That number came from the original-paragraph comparison group. On the whiteboard ticket this check would amount to “Can I find the word ‘administrator’ anywhere in the help center?” Even if B misses the top two, C contains “administrator” and passes. What I measured was answer-text coverage. To evaluate the actual response, the assistant still needs to retrieve materials and answer, and we need to save both.

Use Ragas to check which answer claims the source supports

For an automatic review of the whiteboard ticket, create one evaluation record containing the question, the passages the answering model saw, and its response. Select the faithfulness metric and configure the language model Ragas will use as judge. If the assistant saw only A and C, the judge should see only A and C too. Including the manually labeled B would falsely suggest the assistant had the permissions rule. The original RAGAs paper describes faithfulness by asking whether “the claims that are made in the answer can be inferred from the context”. One approach splits an answer into individually testable statements, checks support for each, and calculates the proportion supported.2

For example, split the third response into “within the period,” “administrator must apply,” and “recovery within two hours.” Under this split two of three claims are supported, giving faithfulness of 2/3. This is a hand-scored example using that rule. For a user waiting to recover production materials, a single false deadline could fail the entire answer. Per-claim scores locate the offending sentence. The product's acceptance criteria determine whether the answer passes.

I also asked whether “semantic matching” meant calculating the distance between two vectors. In the Chinese ticket, “可以自助恢复” (“can self-restore”) and “不能自助恢复” (“cannot self-restore”) differ by remarkably little text but send the user toward opposite actions. Semantic similarity helps retrieve candidate passages. Evaluating the answer also requires checking whether the material supports this particular conclusion. Calibrate an automatic judge against the human-scored examples first, especially checking negations, expired provisions, and unsupported promises.2

If I could add only one regression test to this assistant today, I'd choose “team plan, day 9.” Its acceptance criteria fit in a sentence: the material sent to the model must specify both retention and who can act; the answer must direct the user to an administrator without promising a turnaround time the documents don't give. The next time someone changes chunking, search, or model, if the assistant again directs an ordinary member to a button they can't see, the saved search results and answer will show where the process failed.

References

Footnotes

  1. Manning, C. D., Raghavan, P., & Schütze, H. (2008). Introduction to information retrieval. Cambridge University Press. Chapter 8, §8.3, denominators and formulas for precision and recall. The table above computes both ratios on the top k items. ↩

  2. Es, S., James, J., Espinosa Anke, L., & Schockaert, S. (2024, March). RAGAs: Automated evaluation of retrieval augmented generation. Proceedings of EACL: System Demonstrations, 150–158. ACL Anthology. See §3, opening paragraph on faithfulness, followed by the method for decomposing statements and judging support. ↩ ↩2 ↩3

  3. Brådland, H., Goodwin, M., Andersen, P.-A., Nossum, A. S., & Gupta, A. (2025, July). A new HOPE: Domain-agnostic automatic evaluation of text chunking. Proceedings of SIGIR ’25. ACM. Figure 5, comparing HOPE and Ragas under eight chunking configurations. ↩

  4. Trivedi, H., Balasubramanian, N., Khot, T., & Sabharwal, A. (2022). MuSiQue: Multihop questions via single-hop question composition. Transactions of the Association for Computational Linguistics, 10, 539–554. Abstract and dataset construction; dgslibisey. (n.d.). MuSiQue: musique_ans_v1.0_dev.jsonl [Data set]. Hugging Face. Development set file used in the experiment. ↩

  5. Qwen. (2024, January 13). Qwen-tokenizer [Tokenizer files]. Hugging Face. Tokenizer configuration and token merge rules used in the experiment. ↩

© 2025 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2025-07-21). Evaluating RAG: did the assistant fail to find the evidence, or find it and answer incorrectly?. https://caiborui.com/blog/2025-07-21-zh-rag-evaluation-retrieval-and-answers-entrans

@misc{borui2025-7b0f0037,
  author = {borui},
  title = {{Evaluating RAG: did the assistant fail to find the evidence, or find it and answer incorrectly?}},
  year = {2025},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2025-07-21-zh-rag-evaluation-retrieval-and-answers-entrans}
}