Component and End-to-End RAG Evaluation
In this article
- Explain why one end-to-end score cannot say whether the search or the answer step failed.
- Check a saved case for a retrieval hit, for supported claims and for task success, and read the three results together.
- Decide which stage to fix first from whether the gold passage came back and whether each claim is supported.
- Spot a correct answer that is still a retrieval failure, and a miss that comes from a gap in the gold labels.
- Terms defined here: gold passage, retrieval hit.
Overview
A support assistant looks up help text before it answers, and the score your team watches, the share of answers that come out right, has just dropped. That number tells you something broke. It does not tell you where, and a page missing from the search needs a different fix from a reply that misreads a page it was given.
You can find out with three yes-or-no checks on saved test questions: one on what the search returned, one on whether the answer sticks to what it was handed, and one on whether the customer got what they needed. Read them in a fixed order and a wrong answer points at the stage to fix. You will also see where each check can mislead you.
Two stages and one score
A RAG pipeline answers a question in two stages. Retrieval finds the evidence: it searches the documents and hands back a few chunks, short pieces of them. Generation writes the answer from that evidence: a language model reads the chunks with the question and replies. LangSmith's RAG tutorial builds its example app on this split: index the documents, retrieve chunks for the question, then pass the question and those chunks to the model [2]. If your search step reorders its results with a reranker, count a miss there as a retrieval miss too, because either way the evidence never reaches the answer step.
In an invented example, Brightline, a home-internet provider, runs a support assistant that puts the top 3 chunks of its help pages and router manuals into each request. Its team checks the assistant with an eval, a saved set of 60 questions, each one a case, run again after every change. Four of those cases show the problem.
Three of them are the refund question, "My router arrived 20 days ago. Can I still get a refund?" The right answer is no: the help page allows refunds up to 14 days after delivery, so the assistant should offer a person instead. The fourth is the E-42 question, "My BL-R7 shows E-42 and arrived 20 days ago. Can I return it, and how do I reset it?"
Here is what an end-to-end check sees, one verdict per case on whether the reply did what the customer needed (invented results):
| case | question | reply, shortened | task met |
|---|---|---|---|
| 1 | refund | "Yes. Refunds are open for a month after delivery." | no |
| 2 | refund | "Yes, you are within the window." | no |
| 3 | E-42 | No network; hold reset for 10 seconds; past the 14 days, a person can help. | yes |
| 4 | refund | "No, refunds close 14 days after delivery." | yes |
The score is 2 of 4. Before you read on, decide for cases 1, 2 and 4 which stage you would fix, and what you would need to see to be sure.
Three checks
The table cannot answer that: cases 1 and 2 carry the same "no", case 4 a "yes", and nothing shows which chunks reached the model or what the reply did with them. The Claude Cookbooks RAG guide treats separate evaluation of the search and of the whole system as essential [3], and Microsoft's RAG guide on Azure has you evaluate each earlier stage and confirm its results before you judge the model's answers [1]. [1,3]
The first check needs an answer key for the search. For each case, a person at Brightline marks the passage that holds the answer: a gold passage. For the refund question that is help-refunds#2, "A refund can be requested up to 14 days after delivery." The E-42 question draws on several facts, so it has three gold passages. Evaluation sets built this way store, next to each question, the chunks the search should return and a correct answer, and some questions need more than one chunk to answer. [3]
A retrieval hit then asks one thing: is at least one gold passage among the top 3 chunks? LlamaIndex's HitRate metric works this way by default: 1.0 when any retrieved id is in the expected ids, else 0.0 [4]. One match is enough because the question is whether any evidence arrived; whether all three E-42 passages arrived is a later, finer measure. It is a comparison of ids, so plain code answers it.
The second check looks at the reply. Split it into claims and ask, for each, whether a passage in the request states it: a supported-claim check. Microsoft's name for a score built on the same idea is groundedness, which measures whether the response rests entirely on the supplied context [1]. Plain code cannot do this, since a reply rarely repeats a passage word for word; a person or a model grader has to read both. A model grader is a separate model call that gets the claim, the passages and a written yes/no rubric, and is checked against a person's labels on a sample. A claim that matches the real policy but appears in no supplied passage is unsupported, because the model got it from somewhere other than the evidence. [1]
The third check is the correct answer (end to end): does the reply match the case's stored correct answer? The cookbook's end-to-end accuracy works like this: a model grader marks each answer correct or incorrect against the stored correct answer, and the score is correct answers over questions [3]. [3]
Each check compares a different pair of things:
| check | compares | result | stage it speaks for |
|---|---|---|---|
| retrieval hit | gold passage ids with the top 3 chunk ids | yes or no | retrieval |
| supported-claim check | each claim with the chunks in the request | yes or no per claim | generation |
| correct answer (end to end) | the reply with the case's correct answer | yes or no | the whole system |
Here is case 2 as saved, then the three checks run on it:
case 2 (invented trace)
question My router arrived 20 days ago. Can I still get a refund?
gold help-refunds#2
top 3 help-refunds#2, help-refunds#1, help-router-setup#1
reply "Yes, you are within the window."
claim 1 the customer is within the refund windowThe gold id is first in the top 3, so the hit is yes. Claim 1 fails support: help-refunds#2 sets 14 days, the customer said 20, and 20 is more than 14, so the passage contradicts the claim. Correct answer is no. The evidence arrived and the reply misused it, so generation failed. Replay the same saved request and change only the instructions.
The four cases, checked
Run the same three checks on all four cases:
| case | top 3 | hit | claims supported | task met | fix |
|---|---|---|---|---|---|
| 1 | help-router-setup#1, help-billing#3, help-delivery#1 | no | no | no | retrieval |
| 2 | help-refunds#2, help-refunds#1, help-router-setup#1 | yes | no | no | generation |
| 3 | manual-bl-r7#e42, manual-bl-r7#reset, help-refunds#2 | yes | yes | yes | none |
| 4 | help-router-setup#1, help-billing#3, help-delivery#1 | no | no | yes | retrieval |
Case 1 had no refund chunk at all, so the "month" came from nowhere in the request. No instruction can put a 14-day rule into a request that never held it: work on the search or the index and leave the prompt alone.
Case 4 is the trap. The reply is correct, so correct answer gives it a yes, yet the request is the same useless set of three chunks as case 1. The 14 days appear in no supplied passage, so the claim is unsupported: the model guessed, and the guess landed. Language model replies are nondeterministic, and the same request often brings a different reply [1], so the next customer with this question may get the "month" again. Case 4 is a retrieval failure that the end-to-end score counted as a pass. [1]
Case 3 passes all three, so only its end-to-end "yes" means what it seems to: what E-42 means, the 10-second reset and the 14 days each have a passage in the top 3.
Hit against support
Put the first two checks against each other and each cell names the stage to fix (the four saved cases fill three cells):
| search | every claim supported | a claim unsupported |
|---|---|---|
| hit | Case 3: now read correct answer | Case 2: generation; replay the same request |
| no hit | Check the gold labels first, then retrieval | Cases 1 and 4: retrieval; leave the prompt |
The bottom-left cell holds no saved case, but it happens. A reply that says "I can't find that, I'll pass you to a person" claims nothing unsupported, yet the evidence still did not arrive. Or the search returned a passage that does hold the answer, and nobody marked it as gold: supported claims with no hit point to that, so look at the labels before the search.
That gives the order: check the hit, then the support of each claim, and only then read the end-to-end score. A correct reply after a missed retrieval is a retrieval failure, never a pass.
Where the checks mislead
- An incomplete gold list. If a second help page repeats the 14-day rule and nobody marked it, a search that returns it scores no hit although the right evidence arrived. A miss with fully supported claims sends you to the labels before the search.
- A supported claim from a wrong passage. The support check compares the reply only with what was supplied. If the passage is wrong, a reply that repeats it passes. Microsoft notes that a grounded answer can still be incorrect when the source data has problems, and that when correctness is low you first make sure the supplied chunks are factually correct, then look at the prompt. [1]
- An average that hides a slice. Over 60 cases, a hit share can look healthy while every question about one manual misses. Read the checks per group of questions as well as overall.
:::note In practice LangSmith's RAG tutorial gives each evaluator its own pair: retrieval relevance compares the retrieved documents with the question, groundedness compares the answer with the retrieved documents, and correctness compares the answer with a reference answer [2]. Each one is a model acting as judge, and only correctness needs a reference answer stored in the dataset; its retrieval check judges relevance directly, so it needs no gold ids. [2] :::
:::note In an interview Asked why RAG answers got worse, say you would localize first: did the gold passage come back, is each claim supported by what was supplied, and only then what the end-to-end score says. The trade-off is cost: the hit needs gold labels a person writes, the other two a grader you have checked. Microsoft's guide also asks you to record results for single stages as well as end to end. [1] :::
Sources
- Develop a RAG Solution on Azure - Large Language Model End-to-End Evaluation Phase. Microsoft (MicrosoftDocs/architecture-center). Checked 25 Oct 2026.
- LangSmith docs: Evaluate a RAG application. LangChain. Checked 24 Oct 2026.
- Claude Cookbooks: Retrieval Augmented Generation guide. Anthropic. Checked 24 Oct 2026.
- LlamaIndex source: retrieval metrics (HitRate). LlamaIndex. Checked 12 Nov 2026.
Check yourself
Check yourself
Question 1 of 13
You need to know whether the search put evidence in front of the model. Which check do you run?
Your first check counts towards your result.