System Design Atlas

Knowledge assistant with source references

06 / 10Worked example

The overall architecture

How do the processing and response service share the released state of knowledge?

The import runs in the background; a question runs through the answer service. Both ways use versioned documents and the same current rights reference. For start-up, we combine relational metadata with a vector search in relational SQL storage.

Starting point Versions, rights and passages have been clarified; now two runtime paths with clear transfers are needed.

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.

Ingestion and answering use the same knowledge version

Container view · separate ingestion and response

Source systemD-17 and new DV-17
Person askingQ-17 In the role context
Source system → Ingestion-Worker: Version + Original
Answer API: Q-17 + requestKey
Answer API → asking person: A-17 or status

System boundary · Knowledge assistant

Ingestion workerChecks versions · splits content · builds search data
Answer APIChecks permissions · selects evidence · returns A-17
Ingestion worker → SQL: metadata, passages and index
Ingestion-Worker → Original filing: Reference or backup
Answer API → SQL: Rights, full text and vector search
SQL knowledge baseMetadata · Rights · Full text · Vector search
Original repositoriesOriginal reference and proof of integrity
Answer API → model service: question + selected evidence
Model service → answer API: unchecked draft
External model serviceReceives selected context; returns an unchecked draft
  • Knowledge Assistant container
  • SQL inventory and original storage
  • People, Source System and Model Service

Ingestion creates approved search data. The answer API checks permissions, queries the SQL collection and sends only selected evidence to the external model.

The architecture separates processing and response generation; rights and released versions combine both paths.

Divide the answer API into domain modules

Component view · answer API and model handoff

Container · Response API

Rights validationBefore search: Determine role and permitted DV-17
Permitted collection
Retrieval10 Candidates with Passage and Version
Supporting documents
Context assembly6 passages selected for the model
Selection
Rights validationReconfirm before model transfer
Question + Context
Model adaptersLimit request and log request ID
Output validationAfter the model response: perform the final authorisation check · set status and references
Model adapter → Model service: Question + Context
External model serviceReceives context · returns an unchecked draft
Model service → output validation: answer draft
  • Response API module
  • Supporting documents and metadata
  • External model service

Retrieval supplies evidence to context assembly and the model adapter. The model returns an unchecked draft; structural checks verify references, while source fidelity also requires domain acceptance.

The modules belong to the same response API. The access module checks current rights before search, model call and output; retrieval selects up to 10 candidates, the model adapter calls the external model service, and the source check decides on the output.

Mapping domain responsibilities

Domain taskRuntime component
Document preparationImport Worker with Extraction, Chunking and Embedding Adapter
Authorisation checkAccess module in search, context formation and output
Search and RetrievalFull text and vector search; merge hits
Model integrationBounded model adapter within the answer service
Source attributionReference check and protected document access

Document preparation

Runtime component
Import Worker with Extraction, Chunking and Embedding Adapter

Authorisation check

Runtime component
Access module in search, context formation and output

Search and Retrieval

Runtime component
Full text and vector search; merge hits

Model integration

Runtime component
Bounded model adapter within the answer service

Source attribution

Runtime component
Reference check and protected document access

Terms in this step

Embedding
Numerical representation of a text, with which content-related similar passages can be sought. It is not a substitute for rights checking or fact checking.

Try it yourself

Assign import, release, search, rights check, model call and reference check to the building blocks.

A hint for your attempt

A version becomes active only after complete processing. Retrieval and response formulation remain separately testable.

Compare with a possible solution
Ingestion
Check D-17, create DV-17 and passages with pipeline version and position anchors, then approve the complete version. Test: A deliberately faulty passage keeps DV-17 in `processing` or `failed`; expect 0 active partial versions. Set `ready` only when all expected passages resolve.
Response path
Checks permissions before search, model calls and output, retrieves passages, generates A-17 and verifies references before output. Test: Inject permission revocation and an unknown source ID; expect 0 protected text fragments and no release of an unverifiable answer.

Apply to your project

Which component in your system decides on release, access and response status?

The architecture is checked in step 7 on a rights revocation during Q-17.