System Design Atlas

Knowledge assistant with source references

07 / 10Worked example

Critical flow

What happens if a document is blocked during the response?

Search may return permitted results before a document is blocked during generation. Current permissions are checked before search, before the model call and before output. Search results, model context and the complete answer draft are separate checkpoints.

Starting point Q-17 has found permitted hits; before the release, the rights of D-17 changes.

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.

Track Q-17 until the last rights and source verification

An admissible question will receive a proven answer.

Person asking
Answer API
SQL knowledge base
Model service
  1. 01 Person asking → Answer APIBind Q-17 + requestKey
  2. 02 Answer API → SQL knowledge baseLoading Role and Rights
  3. 03 SQL knowledge base → Answer APIAllowed DV-17
  4. 04 Answer API → SQL knowledge baseFind 10 candidates
  5. 05 SQL knowledge base → Answer APIPassages + versions
  6. 06 Answer API → SQL knowledge baseCheck rights before model transfer
  7. 07 SQL knowledge base → Answer APIRemaining authorised
  8. 08 Answer API → Model serviceQ-17 + 6 selected supporting passages
  9. 09 Model service → Answer APIDraft response
  10. 10 Answer API → SQL knowledge baseRecheck permissions before output
  11. 11 SQL knowledge base → Answer APIIssuance still permitted
  12. 12 Answer API · Local processingStructural check: references, status and permissions complete
  13. Source fidelity requires separate human acceptanceA structural validator checks references and format; domain truth needs a separate review of each claim.
  14. 13 Answer API · Local processingCreate A-17, status and evidence references
  15. 14 Answer API → Person askinganswered · A-17 + references

Result: Output contains only approved evidence and its traceable answer references.

Rights check, retrieval, model context and output remain separate checkpoints of the critical path.

Deviations in the critical path

Too weak evidence
Before calling the model, ask for clarification or return `insufficient_evidence`. Calibrate similarity scores against the test set; they are not a universal truth threshold. Test: Weak evidence must not produce an unjustifiably confident draft.
Invented source reference
An unknown evidence ID fails answer validation. Structural checking verifies the reference; whether the passage supports the claim needs additional domain quality review. The negative test must expose no unchecked text fragments.
Model too slow
A timeout ends the attempt with technical feedback; unchecked text stays withheld. Permissions revoked during generation cause the entire draft to be withheld. Unverified fragments are neither extracted nor returned as a separate answer.

Terms in this step

Context windows
The limited amount of text that a model can process together in a request.

Try it yourself

Trace Q-17 through authorisation, search, the model and output validation. Predict outcomes for revoked permissions and weak evidence.

A hint for your attempt

Rights before searching limit candidates. Re-checking before output prevents a now-locked context from being output.

Compare with a possible solution
Revoked permissions
Permissions revoked during generation cause the backend to withhold the entire A-17 draft. Test: Revoke access before search, before the model call and before output; expect 0 protected text fragments and an explicit withheld status.
Weak evidence
Weak evidence produces `insufficient_evidence`; the gap and test result remain visible. Conflicting evidence produces `conflicting_sources`; model failure produces a separate technical error response.

Apply to your project

What change between request and output could create an inadmissible response in your system?

The sequence's observable failures guide retrieval extensions in step 8.