
Summary
Key points of this document
- Where are the design challenges?
- How to define the boundaries?
- Effective implementation details
Overview
Even if RAG appears to be working, answer quality fluctuates with document additions, splitting methods, model changes, and prompt changes. To enable discussions about quality, an evaluation dataset must be started small and continuously nurtured. An evaluation dataset is not a scorecard, but an observation device for discussing where degradation occurred in search, generation, citation, or refusal.
Where are the design challenges?
If RAG quality confirmation relies solely on manual visual checks, it becomes difficult to explain whether it has improved or deteriorated. Especially when documents increase, questions that were previously answered correctly might be influenced by other documents.
Not all business questions can be included in evaluation data. Also, AI answers are not perfectly consistent every time. It is more realistic to design evaluations as regression tests to check if operational risks have increased, rather than as strict unit tests.
RAG quality does not simply improve as the number of documents increases. As similar documents grow, search rankings fluctuate, old and new procedures get mixed, and prompts become longer. An evaluation set is the minimum foundation for treating these fluctuations as differences, not just feelings.
How to define the boundaries?
Evaluation data includes questions, expected source documents, key points of desired answers, and conditions under which not to answer. We separately check if expected documents are in the top search results, if the answer aligns with the source, and if it avoids answering without a basis.
Evaluation data separates questions, expected sources, key points to include in the answer, and conditions under which not to answer. For example, even for the same question, whether the search reached the correct document, whether the generation included the key points, and whether it could refuse when there was no basis are different evaluation axes.
Effective implementation details
Data is managed in JSON or CSV, with categories and importance assigned to each question. For automated evaluation, we check search recall, key point matching in answers, citation ID matching, and the presence of prohibited expressions. Even when using LLM-as-a-judge, the judgment prompt and reasons for judgment are saved to track changes in the evaluation itself.
In implementation, evaluation cases are managed in JSON, withquestion_id,expected_chunk_ids,must_include,must_not_include,risk_levelattributes. Execution results save top search results, prompt length, answer, citations, and judgment reasons, allowing failed cases to be re-executed later.
- Search evaluation checks if expected chunks are within top-k results. It should be treated separately from generation evaluation.
- Even when using LLM-as-a-judge, save the judgment prompt and the version of the judgment model.
- Always include unanswerable questions to detect failures where the system attempts to answer forcibly.
Observe how it breaks
In CI, instead of running all cases every time, a small set of high-importance cases is run. A broader set is executed in nightly or manual jobs, reporting differences before and after changes. Failed questions are classified by their root cause: search, document splitting, prompt, model, or data deficiency.
In CI, it's more sustainable to check for regressions with a small set of high-importance cases rather than running all cases every time. Broader sets are delegated to nightly or manual jobs, comparing search recall, citation matching, prohibited expressions, and response time differences with previous results.
Discarded options and trade-offs
Increasing evaluation data too much leads to higher execution time and verification costs. Conversely, too little data lacks representativeness. It's often more sustainable to start with about 20 questions that have a significant business impact and add more based on incidents or inquiries.
If evaluation is too strict, even minor variations in expression are treated as failures, slowing down development. Conversely, if it's too lenient, quality degradation might be missed. A balance is needed: strict judgment for high-risk business questions, and observing trends for low-risk questions.
Decision-making criteria for the field
RAG evaluation is not a one-time measurement of AI intelligence. Creating a mechanism to quickly detect degradation, assuming documents and models continuously change, is the first step towards making RAG usable in practice.
RAG improvement is not about repeatedly tweaking prompts, but about classifying how it breaks and making it reproducible. An evaluation dataset becomes a design asset for sharing that classification within the team.


