How do you test the answers your application gives?
Part 7 of 7: Start here
To decide whether a change helped your application, run the same questions before and after it and compare the answers. Choices about whole documents or selected passages, how passages are divided and ranked, and how citations and refusals work can all change them.
A small set of real questions, each recorded with the passage that settles it and the expected answer, shows which change helped and which broke an answer. Save the exact request and reply for every run, compare runs question by question, and check any automatic judge against a person's grades before relying on it.
Start with real questions and checked answers
Collect questions from users where possible, and keep the set small. For each, record the expected answer and the passage or passages that settle it, including any condition or exception.
Recall is the share of the needed passages that search returns. One team reported on Hacker News around 90% recall when it first built its setup, but when the first actual users tried it, it "could barely answer anything (closer to 30%)".
The author said the team relied on exact keywords too much when testing, because it knew the test knowledge base, while real users do not know the exact terminology used in the articles.
The missing documents and recall collection gathers related builder reports.
Take a traveller who asks whether their insurance covers a flight cancelled by a strike. The policy covers cancellations but excludes those caused by industrial action. Record that exclusion, the cover clause it limits, and the expected answer: the cancellation is not covered. Write the question as the traveller would, with "strike" rather than the policy's term "industrial action".
Include questions the documents cannot answer. If the insurer's policy wordings and claims guidance say nothing about unused concert tickets, the expected reply is that the documents do not say whether that loss is covered.
Save the evidence behind each run
The application builds a request containing the question, instructions and either the document's full text or selected passages. Save that exact request, preserving passage order.
When the application searches for passages, also save the ranked results and their scores. Keep the reply and its citation data alongside them.
Record the document versions, settings used to divide passages, search and ranking settings, answer instructions and model used. These records let you compare what changed without trying to reconstruct an earlier run.
Change one thing and compare each question
Change one thing at a time, such as passage boundaries, ranking or answer instructions, and run the same set again. When the documents change, review the expected answers against the new wording and retain the old versions for comparison.
For each question, compare whether the settling passage reached the request, whether the reply matches the expected answer, and whether each citation opens the right passage and supports the full statement. For questions without an answer in the documents, check whether the reply correctly identifies what is missing.
If the needed passage is absent from the request, inspect search, filtering, ranking and request assembly. If it is present but the reply fails to account for it, record that separately. The output alone cannot show why.
Document changes deserve their own tests. One RAGFlow user reported that deleted PDF passages still appeared in references after repeated deletion and re-uploading.
A contributor said this was a known issue when files were deleted during parsing. A pull request addressing it was merged; no one in the issue confirmed the fix against the reporter's case.
The stale answers after updates collection gathers related reports. Include a question whose answer changes when a document is replaced or removed.
Separate finding evidence from writing the answer
Retrieval is the step that searches the documents for passages relevant to the question. Its measures concern what search found; answer measures concern what the reply says.
In Ragas, Context Recall breaks the expected answer into claims and checks which of them the retrieved passages support, so each test question needs its expected answer written down.
Ragas's Faithfulness measures the share of the reply's claims supported by the retrieved passages, without needing an expected answer. A reply can support everything it says while leaving part of the question unanswered, so check completeness separately.
Ragas's Answer Relevancy measures how well the reply matches the question's intent, without checking factual accuracy, and penalizes incomplete answers. Choose measures for the failures you need to detect, and keep their results separate.
Check an automatic judge before relying on it
A model judge is a model prompted to grade another model's answer. OpenAI's evaluation guidance recommends checking automated scores against human labels before scaling their use.
Give the judge the question, supplied passages, reply and explicit grading rules. You can begin with separate pass or fail decisions about whether the reply answers the question, whether its statements have support, and whether a refusal is justified.
A 2026 study tested eight automatic scorers against existing human labels of support for answer sentences and claims. For answer support, their rankings reversed between datasets, and none stayed among the best on every dataset. A prompt-based model judge avoided the scorers' chance-level collapses but was not uniformly best. The authors recommend checking scorer choice on the target dataset.
When you set up the judge, a person can grade a sample of replies and compare those grades with the judge's. A person can also read changed results, refusals and citations, and the questions where an error matters most.
For each disagreement, read the saved request and source passage before changing the application or the judge. Keep those reviewed cases in the question set.
A first setup and a repeatable check
First decide whether the evidence fits in one request. When it does not, select passages for the question. Keep each passage with the wording that makes it apply, such as its heading or condition.
Confirm that the settling passage reaches the request. Check that each citation opens the passage supplied and that its text supports the statement. The reply should decline when the documents lack the answer and answer when the request holds what settles the question.
Start with the checked questions and saved records, then add automatic grading once it agrees with a person's grades. Keep the records from each run, inspect every question whose result differs from the run before, and repeat the comparison after every change.
Join the waitlist: one email when there is something to try.