System Design Atlas

Knowledge assistant with source references

02 / 10Worked example

Requirements

How do we identify a useful and permissible answer?

Fluent text can miss the question or contain unsupported claims. Retrieval means finding and selecting relevant passages. We evaluate the whole path: finding permitted evidence, selecting it and providing a comprehensible answer with clear limits.

Starting point The boundary requires an answer from accessible evidence that can be checked against the original.

Assumptions for the example case

Example design: one operator's internal knowledge, a bounded document collection and existing authentication. Numbers and targets are assumptions. The assistant reads knowledge; tool actions and open-web research are outside scope.

Check access, retrieval, source fidelity and latency together

Four independent quality axes for question Q-17

Quality objective

Access protection

Only permitted versions and passages reach the answer path.
Test ideaWithdrawal of rights during generation: withhold entire output; no unchecked streaming.

Quality objective

Retrieval quality

At least 90% of answerable test questions find an expected supporting passage in the top 10 (HitRate@10).
Test ideaEvaluate reference questions with known passages under equal rights.

Quality objective

Source fidelity

In the domain review sample, the referenced passages support every material claim in A-17.
Test ideaTest sample assigns each statement to a passage and DV-17.

Quality objective

Runtime

At least 95 % of responses are completed under assumed load within 12 seconds.
Test ideaMeasure p95 per section; use load profile from 5,000 questions per day.
  • Product behaviour
  • Test evidence

The four targets complement one another. Each requires its own evidence and test.

The four quality dimensions have separate tests and must all hold for the same answer.

Business requirements and rules (functional)

Further reading
Function or ruleExpected resultEvidence
Enforcement of accessDo not display content outside of the current document rights.Ask the same question under different roles and after revoking access.
Finding appropriate evidenceFind relevant passages in the approved collection for answerable questions.Run curated test set with expected document locations.
Source fidelityEssential statements must be supported by assigned passages.A domain review sample evaluates each claim together with its supporting passage.
Identifying knowledge gapsUnanswerable and contradictory cases become visible.Deliberately missing and contradictory sources in the test set.

Enforcement of access

Expected result
Do not display content outside of the current document rights.
Evidence
Ask the same question under different roles and after revoking access.

Finding appropriate evidence

Expected result
Find relevant passages in the approved collection for answerable questions.
Evidence
Run curated test set with expected document locations.

Source fidelity

Expected result
Essential statements must be supported by assigned passages.
Evidence
A domain review sample evaluates each claim together with its supporting passage.

Identifying knowledge gaps

Expected result
Unanswerable and contradictory cases become visible.
Evidence
Deliberately missing and contradictory sources in the test set.

Quality goals and their validation (non-functional)

Further reading
Retrieval quality
Proposed target: At least 90% of answerable test questions have an expected supporting passage among the first 10 results. This is the hit rate @10 (HitRate@10), not recall over all relevant evidence. A curated test set checks this assumption.
Response time
Proposed target: 95% of complete responses remain below 12 seconds in the load test. Search, model and output are measured separately; timeout and model error are technical errors, not knowledge gaps.
Up-to-date new content
Proposed goal: prepare normal changes within 15 minutes. A version is only released for responses after full indexing.
Revoked permissions
The output queries the current authorization status. An outdated search index must not replace this check. For non-verifiable rights, the response is withheld.
Evaluation basis
An initial test set could contain 50 typical questions with expected evidence, 10 unanswerable questions and role variants. These counts are a starting proposal; product quality also needs evaluation beyond this set.

Terms in this step

Hit rate @10 (HitRate@10)
The proportion of answerable test questions with at least one expected supporting passage among the first ten results. Recall measures the proportion of all relevant evidence retrieved and is evaluated separately here if needed.

Try it yourself

Set targets for access, retrieval, source fidelity and latency. Add a test for revoked permissions.

A hint for your attempt

A fluent text is not a measure of quality. Check the reference and statement together and treat gaps in knowledge as a permitted result.

Compare with a possible solution
Retrieval
Access test: Only currently permitted evidence remains in each role's candidate set; revoking access results in 0 protected passages in output. Retrieval test: At least 90% of answerable questions find an expected passage in the top 10 (HitRate@10). A question without evidence is a defined negative case.
Output
Source-fidelity test: A domain review sample checks whether each cited passage supports its claim; a valid link alone is insufficient. Latency test: Under the agreed load, 95% finish within 12 seconds. Revocation test: Start with valid permissions, revoke read access during generation and await output; expect a withheld status without answer text. Technical failures receive a separate error response.

Apply to your project

Which test questions, role variants and knowledge gaps form your first quality set?

In step 3, the target values determine quantities, context limits and load tests.