One Good Answer Isn't Enough to Pass a RAG Project Review
A student submits a service that answers questions from internal documents. We ask about travel expenses. The service gives an amount and a link. We open it: the amount is there, but the document is last year's policy. T
A student submits a service that answers questions from internal documents. We ask about travel expenses. The service gives an amount and a link. We open it: the amount is there, but the document is last year's policy. The current version has a different limit.
Now there is something to investigate. Did both versions reach the index, or only the old one? Did retrieval find the right section? Did the model receive the whole passage? Until we know that, one answer tells us very little about the work. We do not even know which part of the project needs fixing.
That error makes a useful starting point for a course assignment. The student has to find its cause, change the service, and check whether the change broke other answers. Let's work through what the student needs to submit and what the instructor can assess. The company, documents, and amounts below are fictional. This is a proposed assignment, not a report from a course I have taught.
December follows one policy, October another
We assemble a small collection: a travel policy, an exception-approval procedure, expense-report instructions, and earlier versions. The service answers questions about travel expenses. Approving reimbursements and making payments are outside the assignment.
Version 2 of travel-policy sets a meal-expense limit of 1,800 rubles per day. Version 3, effective November 1, 2026, sets it at 2,500 rubles. A separate document, travel-exceptions, says that exceeding the limit requires advance approval from a manager. We give that document one version, numbered 1.
We keep the old policy. Someone may ask about an October trip, in which case an answer from the new version would be wrong. Filtering out every old document would fix the December answer and break the October one.
The instructor and student need to agree on how dates work. For example, a question without a date refers to current rules; a historical question explicitly includes the trip date. Each document retains an identifier, version, and effective period. We can then check the version selection without guessing what the question writer meant.
What to inspect when an answer is wrong
Return to the December answer of 1,800 rubles. The instructor opens the run output and finds only the final response. It cannot tell them whether version 3 was missing from the index, ranked too low, or ignored during generation.
We therefore need the retrieved passages with their versions, alongside the actual context sent to the generator. If retrieval returned ten passages but only three reached the model, that difference matters. We retain both outputs; otherwise a missing passage is easy to mistake for a model error.
The rest of the submission supports the same investigation:
- documents with versions and effective periods;
- chunking settings, the representation model, retrieval limits, and filters;
- questions with expected sources and answer requirements;
- outputs before and after the fix;
- an explanation of the change, remaining errors, and run commands.
For a small project, two directories, runs/baseline and runs/revision-1, are enough. They retain run outputs and references to the versions of the corpus, configuration, and generation instructions used. If the student overwrites the original outputs after fixing the issue, the instructor has to take their account of the earlier error on trust. Saved runs let them investigate it together.
Model-access credentials do not belong in these materials. An instructor can inspect the run configuration without receiving a token in the report.
One question about the limit is not enough
If every question asks for the current amount, we learn nothing about whether the service distinguishes document versions. We need a question about an October trip. We also need one that our policies cannot answer at all; otherwise the system's ability to acknowledge missing evidence goes untested.
Each question below serves a different purpose.
"What meal-expense limit applies to a December trip?" This checks straightforward use of the current version. We expect version 3 and 2,500 rubles. An answer of 1,800 rubles citing version 2 is still wrong, even if the quotation accurately represents that old document.
"What limit applied to a trip on October 15?" Now version 2 is required. This question reveals whether the fix for December has discarded the history.
"Can I spend 3,000 rubles a day on meals without additional approval?" The amount alone is insufficient. We need the current limit from travel-policy and the exception procedure from travel-exceptions. The answer must explain the approval requirement without promising that reimbursement is guaranteed.
"Will a visiting consultant's meals be reimbursed?" Our corpus covers employees only. It says nothing about consultants. Applying the same conditions to a consultant would add an assumption to the documents. We expect the service to explain that gap and suggest clarifying which rules apply.
"How much can I spend on the trip?" The user has not specified meals, accommodation, or transport. Even the correct meal allowance may answer the wrong question. The service first needs to clarify the expense category.
A single reference answer is awkward for these cases. The student may explain a rule correctly in different words. It is more useful to record which conclusions must survive, which documents support them, and what the answer must not promise.
Check the meaning, not matching words
For the question about 3,000 rubles, the expected result can be recorded like this:
{
"id": "travel-exception-current",
"question": "Can I spend 3000 rubles a day on meals without approval?",
"as_of": "2026-12-01",
"expected_source_revisions": [
"travel-policy@3",
"travel-exceptions@1"
],
"expected_behavior": "answer_with_sources",
"required_claims": [
"The normal limit is 2500 rubles per day",
"Exceeding the limit requires advance approval"
],
"forbidden_claims": [
"Reimbursement of 3000 rubles is guaranteed"
]
}
required_claims and forbidden_claims describe meaning. Finding the number "3000" in an answer tells us little. "You definitely won't get the 3,000 rubles reimbursed" mentions the same amount while making a different claim. That refusal may also be unsupported: the document allows approved exceptions.
The consultant question needs a different check. Its expected_behavior is insufficient_evidence; the main criterion is that employee rules are not attributed to the consultant. An empty expected-source list does not mean that retrieving zero documents automatically passes. The response the system gives when evidence is missing matters too.
Finding the document does not settle the answer
The approval question requires two documents. Only one appears in the first three retrieval results. Document recall for this case is 1/2.
We will call the measure document_recall_at_k: the fraction of expected document versions found within the first k results. This applies the usual definition of recall to a limited result set. Precision and recall are defined in Introduction to Information Retrieval.
Here is the calculation for our case:
def document_recall_at_k(expected, retrieved, k):
if k <= 0:
raise ValueError("k must be positive")
expected = set(expected)
if not expected:
raise ValueError("use a separate no-answer check")
found = set(retrieved[:k])
return len(expected & found) / len(expected)
expected = ["travel-policy@3", "travel-exceptions@1"]
retrieved = ["travel-policy@3", "travel-policy@3", "expense-report@1"]
print(document_recall_at_k(expected, retrieved, 3))
Output:
0.5
Two passages from one version do not become two retrieved documents. They occupy two result positions, while the second required document is still absent from the first three. Evaluating individual passages would require different relevance labels. We cannot mix those two counting methods.
Suppose retrieval finds both documents after the fix and the measure reaches 1.0. We inspect the answer, and it still says that approval is unnecessary. The evidence was available, but the model used it incorrectly. The reverse can happen too: the response contains the right amount despite retrieval missing the supporting document. A lucky answer does not explain what will happen on the next similar question.
The connection between claims and the supplied context needs a separate assessment. Ragas provides Faithfulness for that purpose. An answer can, however, follow an old policy faithfully and still be wrong for a December trip. The policy's effective date needs an additional check.
A fix starts with a cause you can locate
Open the run that gave 1,800 rubles for December again. Is version 3 absent from the index? Check document ingestion. Is it indexed but absent from the results? Inspect metadata, filters, and retrieval output. Was it retrieved, but the relevant paragraph never reached the model? Inspect passage selection and truncation.
If the full paragraph specifying 2,500 was supplied and the response still says 1,800, move to generation and the citations supporting the conclusion. The proposed change now has a cause that the student can point to in the run materials.
The student changes version filtering to use the trip date, then reruns the question set. Changing the model, chunking, and instructions at the same time would make it difficult to tell which change helped. First, test the explanation selected for this error.
Sometimes the reference labels are wrong. The instructor may have assigned the current policy to a historical question. That can be corrected, but both system variants then need to be evaluated on the same corrected set. Otherwise their scores come from different assignments.
Four answers improved, two got worse
Consider an illustrative report with 24 questions. Before the change, 18 pass; afterward, 20 do. The overall result rises from 75% to approximately 83.3%.
Open the individual cases. Four answers have genuinely improved. But two historical questions that passed before now fail: the filter keeps only current documents. The net gain is therefore two, although six cases changed.
The instructor needs to see all those transitions. The student has fixed the current allowance and lost historical behavior. A report containing only 83.3% hides that consequence.
The number 24 was chosen for this calculation. It is not a required assignment size. On a small set, a difference of one or two answers identifies cases worth investigating; it does not by itself establish that one model is superior.
What grade does this work deserve?
The student has found the cause of the December error and corrected it. That part of the assignment is complete. The requirement to answer historical questions remains unmet. Both judgments can be supported by specific results, without arguing over whether the aggregate percentage looks high enough.
The same applies to the other skills. Retained documents and effective periods make version handling inspectable. Retrieval output and model context show whether the student can distinguish a retrieval error from an evidence-use error. Comparing runs reveals whether they notice the consequences of their own fix. A final answer alone leaves those skills untested.
A repeat run needs dependencies, configuration, and instructions. A hosted model may phrase its next answer differently, so we assess retained outputs separately from the ability to run the check again. Equivalent meaning does not require byte-for-byte identical responses.
Some problems justify returning the work regardless of the grading scale: invented measurements, unavailable source documents, exposed secrets, or no way to check the results. Those conditions need to be stated before submission. The student should know exactly what to fix and what to show again.
For our case, the feedback can be specific: "The October trip uses the current policy. Check the date filter and rerun the full set: the corrected December answer must keep working." The student can act on that. "Poor RAG quality" does not reveal the next task.
That next task is already clear: retain the correct December answer and restore the October one. The student knows which two cases to inspect, and the instructor can see how the chosen fix affects the other questions.
References
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.