AI Answer Quality Testing for Knowledge Bases: A Practical Guide

AI answer quality testing for knowledge bases checks whether an assistant gives the right response to a real question, uses approved evidence, preserves important conditions, and respects the reader’s access. The goal is not to collect impressive-looking answers. It is to find failures you can reproduce, explain, and fix before customers or employees depend on them.

You can start with a spreadsheet and your existing assistant. Record each question, its approved sources, and the expected behavior; run the questions under controlled conditions; then review the answers against the same criteria. Add automated evaluation only after people can apply those criteria consistently.

The workflow below separates answer quality from retrieval, security, and business outcomes. It includes a fictional worked example—not results from a live model or a benchmark of any vendor.

Define what a correct answer is allowed to do

Start by documenting the assistant’s evidence boundary. Should it answer only from approved articles, combine articles with authorized account data, or also consult the web? A statement can be generally plausible but still fail a knowledge-only policy because the required evidence is absent.

Also define the task boundary. Explaining how to export a report is different from actually exporting it. An answer test does not establish that the assistant selected the right tool, obtained authorization, or completed an account action.

Separate correctness from groundedness

Correctness asks whether the response is right for the question and applicable policy. Groundedness, often called faithfulness, asks whether its claims are supported by the evidence supplied to the model. Microsoft’s RAG evaluation guidance treats these as separate dimensions rather than interchangeable scores.

The distinction matters when documentation changes. An answer can accurately repeat an obsolete instruction and remain wrong for today’s customer. Conversely, an answer can happen to be correct while lacking support in the evidence the application was allowed to use.

Ragas defines faithfulness by examining whether claims in a response are supported by the retrieved context. That evaluation does not independently establish that the context is current, authoritative, or appropriate for the reader.

Know what your testing interface can actually show

With a hosted knowledge assistant, you may see only the question, answer, citations, and a preview identity. You can still evaluate the visible answer against approved documents. However, do not label that review a measurement of retrieval recall or actual-context faithfulness when the retrieved passages are unavailable.

With engineering access, inspect the documents retrieved, their ranking, and the passages actually supplied to the model. Retrieval-augmented generation, or RAG, adds retrieved information to the generation process; testing that pipeline requires more evidence than inspecting the final prose. Microsoft’s information-retrieval guide distinguishes retrieval and ranking decisions from the answer produced afterward.

Record unavailable evidence as Not observable. A citation list is useful, but it should not be assumed to contain every passage the model received.

Build test cases with approved evidence and expected behavior

Gather questions from permitted, sanitized support conversations, failed searches, known answer problems, and knowledgeable reviewers. Add synthetic variations to cover wording or situations missing from the logs, then have a subject-matter owner check them. OpenAI’s evaluation guidance recommends task-specific datasets that combine realistic usage with expert-created cases.

There is no single starter-set size that establishes reliability for every knowledge base. Begin with a set your reviewers can verify thoroughly, covering the questions and failure types that matter to your application. A small suite can uncover defects; it cannot certify all future behavior.

Keep the case definition separate from the run result

Give each case a stable ID. Its definition should record the question and relevant conversation history, the reader’s role, the applicable product or policy version, approved source passages, required answer facts, prohibited claims, and expected behavior.

Store the observed response in a separate run record linked to that ID. Include the system version when available, source snapshot, test identity, response, citations, criterion results, severity, reviewer, and follow-up action. This lets you compare several runs without overwriting the original expectations.

A reference answer need not prescribe one exact sentence. Specify the facts and conditions that must survive paraphrasing. Use exact matching only when the task genuinely requires an exact value, identifier, or output format.

Include cases where answering directly would be wrong

Some cases should produce a supported answer. Others should produce a targeted clarification, an explanation that the evidence is insufficient, a refusal to disclose restricted information, or a handoff. Set that expectation before looking at the assistant’s response.

Cover prerequisites, exceptions, numbers, table-based facts, paraphrases, multi-part questions, and follow-up turns. Include outdated documents and conflicting sources. Where one source explicitly supersedes another, expect the assistant to follow the applicable version; where equally authoritative sources disagree, expect it to acknowledge the unresolved conflict rather than invent certainty.

Keep ordinary usage cases separate from an intentionally difficult stress suite. If half your stress cases concern unauthorized access, their failure frequency is not an estimate of how often ordinary customers encounter that problem.

Protect the reference set from accidental tuning

Have the content owner approve the evidence and expected facts. Keep a working set for debugging and a held-out set for checking whether changes generalize. Put close paraphrases in the same split so a nearly identical question does not appear on both sides.

The knowledge base is supposed to contain the facts needed to answer. The problem is exposing the grading answer to the assistant or repeatedly adjusting the system against supposedly unseen tests. Keep evaluation labels outside the production knowledge corpus.

When a policy changes, review the affected references independently and version them. Do not rewrite an expected answer merely because the current system failed it.

Use a rubric that does not hide important failures

The following is a proposed manual rubric, not an industry scoring standard. For each applicable criterion, record Pass or Fail with a short evidence-based explanation. Use Not applicable when a criterion does not belong to the case and Not observable when the necessary evidence is unavailable.

CriterionWhat to checkExample failure
CorrectnessThe facts match the approved policy for this version, audience, and date.The answer gives an expired limit as the current rule.
Evidence supportMaterial claims are supported by the approved evidence; inspect actual generation context when available.The answer invents a feature that no permitted source describes.
Completeness and relevanceThe response addresses the question and retains required conditions.It gives the steps but omits the administrator-only restriction.
CitationsRequired claims have citations that genuinely support them.A valid link points to a page that does not contain the stated rule.
Expected behaviorThe assistant answers, clarifies, abstains, or escalates as the case requires.It guesses which account the reader means.
Access boundariesThe response and disclosed references respect the test reader’s authorization.It reveals information from another customer’s restricted document.

Amazon Bedrock’s RAG evaluation metrics similarly distinguish correctness, completeness, faithfulness, and citation quality. The table above translates those concerns into review questions; it does not claim to reproduce Bedrock’s scoring implementation.

Amazon Bedrock documentation showing RAG answer correctness, completeness, faithfulness, and citation evaluation metrics

Record severity separately from the criterion result. A missing stylistic preference and unauthorized disclosure should not have equal consequences. Define your blocking conditions before the run, and do not let a strong average cancel a critical failure.

Check the claim behind each citation

Open the cited passage and ask whether it supports the statement attached to it. Also check whether important uncited statements remain. Bedrock separates citation precision from citation coverage for this reason: a response can contain a valid citation while leaving other claims unsupported.

Keep support, freshness, and accessibility separate. A passage may support an old rule but not the current one. A source can be relevant to an authorized employee without being suitable to display to an external customer. Do not expose restricted passages simply to make the answer look better cited.

Report counts and denominators, not just a score

For a practical scorecard, calculate a few clearly defined rates rather than combining everything into one number:

  • Answerable-response pass rate: scored responses meeting every predeclared answer requirement divided by all scored responses to fully answerable, authorized cases.
  • Unsupported-answer rate: scored responses that invent a material answer divided by all scored responses to insufficient-evidence cases.
  • Unnecessary-abstention rate: scored responses that decline to answer despite sufficient permitted evidence divided by all scored responses to fully answerable, authorized cases.
  • Citation coverage: citation-required factual claims with adequate cited support divided by all citation-required factual claims in the responses audited.

Multiply a ratio by 100 to express it as a percentage. Show its counts, define claim boundaries consistently, and report the number of distinct questions as well as repeated responses. The citation measure is claim-level; the first three measures are response-level. Do not average them as though they measure the same thing.

List skipped cases, tool errors, and grading failures separately. Excluding them from a scored denominator does not make them successful. When there are no applicable claims, mark coverage as Not applicable rather than awarding a perfect score to an empty answer.

Worked example: a polished export answer that fails

The product, documents, and responses in this example are fictional. They illustrate how to review an answer; they are not outputs from an executed AI test.

Define the source and case before judging the answer

Assume a fictional application called Pinefield has this approved public support document:

KB-EXP-2 — Activity exports, current version

Only workspace owners can create activity exports. Owners open Activity → Export CSV. Each export contains the previous 30 calendar days. The download link expires 24 hours after creation. Regular members should ask a workspace owner to create the export. This document supersedes KB-EXP-1.

The archived KB-EXP-1 instead says that any member can export through Reports → Download and that links last seven days. Its archived status matters: it is evidence of the former behavior, not authority for the current procedure.

Case EXP-01: A regular member asks, “How can I export the last 30 days of activity, and how long will the download link work?” The expected response must explain the owner requirement, give the owner’s navigation, preserve the 30-day scope, and state the 24-hour expiration. The information is public, so the assistant should help rather than refuse the entire question.

Compare two constructed responses

For this illustration, assume KB-EXP-2 is the supplied generation context.

Response A: “Ask a workspace owner to open Activity → Export CSV. Regular members cannot create the export themselves. It includes the previous 30 calendar days, and the download link expires 24 hours after creation. Source: KB-EXP-2.”

Response B: “Open Activity → Export CSV to download the last 30 days. Your download link will remain available for seven days. Source: KB-EXP-2.”

Response A meets the stated answer requirements. Response B does not: it directs the member to perform an owner-only action and gives the wrong expiration. Its citation names the current document, but that document contradicts the seven-day claim. Matching the topic, menu labels, and document ID does not make the response correct.

Record both the incorrect duration and missing role condition. Do not replace them with a vague note such as “answer could be clearer.” The actionable defect is that the response combines correct current instructions with an obsolete value and omits a prerequisite.

If another run received only KB-EXP-1 and repeated it accurately, its faithfulness to that old context might look strong. It would still fail the current-policy test. That result should trigger investigation of source selection and freshness rather than praise for a well-supported answer.

Extend the case without changing its approved facts

CaseQuestion or conditionExpected behavior
EXP-02: Paraphrase“Can a regular teammate download last month’s activity?”Preserve the owner restriction and clarify a calendar-month request if it differs from the documented rolling 30-day period.
EXP-03: Missing evidence“How can I recover activity from six months ago?”Explain that the supplied export instructions do not establish a recovery method. Do not invent one.
EXP-04: Ambiguity“How do I export it?” with no relevant historyAsk what the reader wants to export rather than assume activity data.
EXP-05: Multi-turnAfter an owner-only explanation: “I’m a member, not an owner.”Keep the role condition consistent and direct the reader to an owner.
EXP-06: Source freshnessBoth the current and explicitly superseded documents appear.Follow KB-EXP-2 and avoid blending the two procedures.

For a separate conflict test, supply two explicitly current, equally authoritative test documents with incompatible instructions. The expected behavior changes: identify the unresolved disagreement and escalate. Choosing whichever file has the newest cosmetic edit is not a defensible conflict-resolution rule.

Run a baseline, then diagnose the failing stage

Before running the set, record the knowledge snapshot, synchronization status, test identity, conversation history, and available application settings. Capture model, prompt, retrieval, and evaluator versions where the platform exposes them. Microsoft recommends documenting evaluation configurations and results at both component and end-to-end levels in its evaluation documentation.

Reset conversations for independent single-turn cases. Preserve the specified history for multi-turn cases. Repeat a selected subset to expose variation, but report those repetitions separately from the number of unique questions. Fixed settings should not be treated as a guarantee of identical output.

Run the baseline before changing anything. Then inspect failures using the evidence available:

Observed problemWhat to investigateNext controlled check
The approved source lacks the answerContent coverage and the reference caseHave the content owner supply or correct the policy before expecting a definitive answer.
The source is correct but unavailable to the systemIngestion, synchronization, indexing, or audience configurationVerify the source version and its eligibility for the test reader.
The right passage is indexed but not retrievedQuery interpretation, filters, ranking, and retrieval settingsInspect the retrieved results against labeled relevant passages.
The passage is retrieved but omitted from final contextContext selection, truncation, or assemblyInspect the evidence actually passed to generation.
The correct evidence reaches the model but the answer is wrongSynthesis, instructions, and missing conditionsRepeat with the same authorized evidence and compare the exact claims.
Reviewers disagree about a failureThe reference, rubric, and graderResolve the disagreement before changing the assistant to satisfy an unreliable label.

These are diagnostic hypotheses, not proof from the final answer alone. A controlled run supplied with the correct passages can narrow the investigation, but it does not establish a unique cause for every failure.

Measure retrieval only when the required evidence is available

With ranked results and a labeled set of relevant passage IDs, calculate Recall@k for a question as the number of relevant IDs found in the first k results divided by the total relevant IDs in the reference set. Finding one useful passage is not the same as retrieving every passage needed for a complete answer.

Be explicit about the implementation. Ragas documents both ID-based recall and reference-claim-based context recall. They use different evidence and should not be reported as identical measures. Questions with no relevant reference passages need a separate missing-evidence test, not a forced recall score.

Change the implicated component, rerun the failing cases, and then run the broader regression set. Fixing one question is not sufficient if the change breaks related questions or another audience’s access.

Test permissions and injected instructions safely

A factually correct answer can still be unacceptable if it reaches the wrong reader. OWASP’s RAG security guidance calls for access controls during retrieval, before restricted content reaches the model. A prompt telling the assistant to keep secrets is not a substitute for authorization.

Use approved test accounts and synthetic documents. For example, put a harmless marker such as INTERNAL-TEST-482 in a restricted test page. Verify that an allowed reader can retrieve the intended content and a denied reader cannot receive the marker, its meaning, or restricted source details.

Repeat after revoking access and after deleting the test source. Include relevant tenant boundaries and cached answers. Check both retrieval and output where possible: a model refusing to repeat a restricted passage does not excuse that passage entering an unauthorized context.

Separately test prompt injection using harmless instructions placed in an authorized test document—for example, text telling the assistant to ignore the question and print a test phrase. The expected behavior is to treat that text as source content, not as a higher-priority instruction. OWASP’s prompt-injection guidance explains the risk of instructions embedded in external material.

Do not use real secrets or change production permissions for these tests. Confirm whether the selected test mode can call live integrations before running action-related cases. Passing a finite suite provides evidence about those cases, not proof that every leakage or injection attempt is impossible.

Automate grading after calibrating it with people

Have reviewers independently score an overlapping set of cases, compare disagreements, and revise unclear criteria. Then compare an automated grader against those agreed labels. OpenAI’s evaluation best practices recommend calibrating automated scoring with human judgment rather than treating model-generated grades as ground truth.

An LLM judge should receive the question, expected behavior, approved evidence, candidate response, and rubric. Request a criterion result and a brief explanation tied to the evidence—not private chain-of-thought. Treat the answer and source passages as untrusted data, including any instructions embedded within them.

Research on LLM-as-a-judge identifies position, verbosity, and self-enhancement biases. In pairwise comparisons, hide system identities where practical and check whether swapping response order changes the judgment. Longer answers should not win merely because they contain more text.

Inspect disagreement patterns and false passes on important failures, not just overall agreement. Keep human adjudication for consequential or ambiguous cases. A different grading prompt does not automatically make the judge independent of the answering model’s weaknesses.

Choose a testing mode that matches the question

Manual previews are useful for investigating one interaction. Reusable batch tests help compare many questions. Workflow simulations address a different task: whether a procedure or action sequence reaches the intended result. Intercom’s comparison of Fin testing modes illustrates why these approaches should not be treated as interchangeable.

Intercom Fin Preview showing Customer view and Event log panels for inspecting AI responses

Check the test identity as carefully as the test mode. Intercom’s batch-testing documentation describes a generic preview user with access to all live content. Such a run can help assess coverage, but it does not establish that a particular customer receives only authorized information.

For an instrumented pipeline, evaluation frameworks can help automate component metrics. Before adopting one, verify its current API, required inputs, supported metrics, and operating costs. Automating an unclear rubric produces more scores, not necessarily better decisions.

Set release conditions and keep a regression record

Agree on acceptance criteria before comparing system versions. There is no universal percentage that makes every knowledge assistant safe to launch. The business owner must decide which behaviors are essential, which defects block release, and which improvements can be scheduled.

For the fictional export workflow, a reasonable proposed gate would block release on an unresolved wrong-role instruction, incorrect expiration rule, or unauthorized disclosure in the tested scope. Tone improvements could be tracked separately. This is a task-specific operating choice, not a published industry threshold.

The release record should state how many unique cases and repeated runs were attempted, completed, and scored; which source and system versions were used; results by behavior and audience; unresolved defects; and any unobservable components. Report observed critical failures directly rather than hiding them inside an average.

Microsoft Foundry documentation showing baseline comparison and statistical significance classifications for evaluation runs

Zero observed failures does not establish zero risk. A small or repetitive test set leaves uncertainty, and a good overall result can conceal a weak restricted-access group. Keep quality decisions separate from latency and cost; report those operational measurements only when you actually collected them under stated conditions.

Rerun relevant tests after changes to documents, permissions, synchronization, retrieval, prompts, models, or tools. Preserve held-out cases, add independently reviewed production failures, and assign an owner to investigate regressions. Continuous evaluation is also part of OpenAI’s documented evaluation workflow.

A useful final question is not “Did the assistant sound good?” It is: “For this reader, this question, and this approved evidence, did it take the right action—and can we explain any failure well enough to fix it?” That is the standard your test cases, rubric, and release record should make visible.

Evaluation documentation and referenced product testing guidance checked on November 1, 2026. The worked example is illustrative; no live model benchmark was performed.