Bounded Contexts¶
Target Architecture — Final-State Design
This page describes the final-state bounded-context decomposition of the Knowledge Platform. The contexts are designed for independent evolution, clear ownership of aggregates, and explicit, governed interactions.
The Knowledge Platform follows Clean Architecture + Domain-Driven Design. Its capabilities are decomposed into eleven bounded contexts, each owning a coherent set of aggregate roots and exposing its behaviour through well-defined APIs and the canonical event envelope. Contexts never share a database; they integrate through events and explicit service contracts, which keeps memory ownership clear and the platform horizontally scalable across the multi-tenant estate.
Context Map¶
flowchart TB
Ingestion["Ingestion"] --> Graph["Knowledge Graph"]
Ingestion --> Vector["Vector & Semantic Memory"]
Ingestion --> Artifact["Artifact Memory"]
Ingestion --> Governance["Knowledge Governance"]
Code["Code Knowledge"] --> Graph
Code --> Vector
Docs["Documentation Knowledge"] --> Vector
PromptDecision["Prompt & Decision Memory"] --> Graph
Runtime["Runtime Memory & Feedback"] --> Graph
Pattern["Pattern Catalog"] --> Graph
ContextBuilding["Context Building"] --> Graph
ContextBuilding --> Vector
ContextBuilding --> Artifact
ContextBuilding --> Governance
ContextBuilding --> Pattern
ContextBuilding --> PromptDecision
ContextBuilding --> Runtime
Governance -. classifies + authorizes .-> Vector
Governance -. classifies + authorizes .-> Artifact
Governance -. classifies + authorizes .-> Graph
The map reads top-to-bottom as the flow of knowledge: Ingestion is the upstream supplier that normalises everything entering the platform; the storage-aligned contexts (Knowledge Graph, Vector & Semantic Memory, Artifact Memory) are the canonical stores; the source contexts (Code, Documentation, Prompt & Decision, Runtime, Pattern) feed specialised knowledge; Knowledge Governance is a cross-cutting authority over all of them; and Context Building is the downstream consumer that fuses everything into governed Context Packages.
Contexts, Aggregates, and Responsibilities¶
| Bounded Context | Owning Services (ConnectSoft.Factory.Knowledge.*) |
Aggregate Roots | Primary Responsibility |
|---|---|---|---|
| Knowledge Graph | KnowledgeGraphService |
KnowledgeNode, KnowledgeEdge, GraphProjection |
Typed graph of all factory entities and their relationships; neighbourhood projections for context. |
| Vector & Semantic Memory | VectorMemoryService, EmbeddingService, KnowledgeSearchService |
VectorDocument, VectorChunk, EmbeddingJob |
Embedding, chunking, vector indexing, and semantic/hybrid search. |
| Artifact Memory | ArtifactMemoryService |
ArtifactMemory, ArtifactVersion, ArtifactSnapshot |
Durable storage of full artifact bodies, versions, and point-in-time snapshots with lineage. |
| Code Knowledge | CodebaseKnowledgeService, LibraryKnowledgeService |
CodeRepository, CodeSymbol, CodeIndexJob |
Repository and library indexing, symbol extraction, code dependency graph. |
| Documentation Knowledge | DocumentationKnowledgeService |
(operates on shared VectorDocument / MemoryRecord) |
Ingest and chunk documentation sites and design docs for grounding. |
| Prompt & Decision Memory | PromptMemoryService, DecisionMemoryService |
PromptTemplate, PromptVersion, PromptRun, DecisionRecord, DecisionAlternative |
Prompt template lineage, prompt run history, architectural decisions and their alternatives. |
| Runtime Memory & Feedback | RuntimeMemoryService, KnowledgeReplayService |
RuntimeSignal, IncidentMemory, FeedbackItem |
Ingest runtime signals, incidents, and feedback; replay knowledge timelines. |
| Pattern Catalog | PatternCatalogService, TemplateKnowledgeService |
KnowledgePattern, PatternVersion |
Promote recurring solutions and template knowledge into versioned reusable patterns. |
| Knowledge Governance | MemoryPolicyService, MemoryClassificationService, MemoryRedactionService, KnowledgeQualityService |
MemoryAccessPolicy, MemoryAccessDecision, MemoryAccessAudit, MemoryClassification, KnowledgeQualityAssessment, QualityRule |
Access policy, classification, redaction, and quality enforcement over all memory. |
| Context Building | ContextBuilderService, KnowledgeStudioBff |
ContextBuildRequest, ContextPackage, ContextSource |
Assemble governed, budgeted Context Packages; back the Knowledge Studio experience. |
| Ingestion | KnowledgeIngestionService, MetadataIndexService |
MemoryRecord |
Normalise, chunk, embed, classify, metadata-index, and graph-project incoming knowledge. |
All aggregates also carry the cross-cutting metadata fields (tenantId, projectId, moduleId, traceId, correlationId, causationId, agentId, skillId, artifactId, environment, version, createdAt, updatedAt, status), which is what allows any memory record to be correlated back to the lifecycle that produced it. The full per-aggregate breakdown is in Aggregate Roots.
Context Interaction Principles¶
- Single ownership. Each aggregate is owned by exactly one context and persisted in exactly one store. No cross-context database joins.
- Events over coupling. Contexts publish domain events (
NounVerbPastTense) and react to integration events; they do not call into each other's persistence. - Governance is mandatory. Every read path that assembles context passes through Knowledge Governance for classification-aware access evaluation and redaction.
- Ingestion is the front door. All external artifacts and signals enter through the Ingestion context, which guarantees normalisation, classification, and idempotency before fan-out.
Artifact Ingestion Pipeline¶
Every artifact produced by the Agent Mesh (and every signal from the Observability & Feedback Platform) enters through the Ingestion context, which orchestrates a multi-stage pipeline before the knowledge becomes retrievable.
flowchart LR
Src["Artifact / Event / Signal"] --> Ingest["KnowledgeIngestionService"]
Ingest --> Norm["Normalize + dedup<br/>(contentHash)"]
Norm --> Record["Create MemoryRecord"]
Record --> Classify["MemoryClassificationService<br/>classify + sensitivity"]
Classify --> Chunk["ArtifactChunkingWorker<br/>chunk into VectorChunks"]
Chunk --> Embed["EmbeddingService<br/>EmbeddingJob"]
Embed --> VStore[("Qdrant<br/>VectorDocument")]
Record --> Meta["MetadataIndexService<br/>structured index"]
Record --> GraphProj["GraphProjectionWorker<br/>KnowledgeNode/Edge"]
GraphProj --> SQL[("PostgreSQL / Azure SQL")]
Record --> ArtStore["ArtifactMemoryService"]
ArtStore --> Blob[("Azure Blob")]
Classify --> Quality["KnowledgeQualityService<br/>QualityAssessment"]
Stages:
- Normalize & dedup — the incoming body is hashed (
contentHash); unchanged content short-circuits re-embedding and re-projection. - Record — a
MemoryRecordis created as the canonical unit of memory, carrying full metadata and lineage. - Classify —
MemoryClassificationServiceassigns aMemoryClassification(Public/Internal/Confidential/Secret). - Chunk & embed — large artifacts are split into
VectorChunks and embedded via anEmbeddingJobinto Qdrant as aVectorDocument. - Metadata index — structured fields are indexed for filtered retrieval.
- Graph project — nodes and edges are projected into the knowledge graph.
- Persist body — the full artifact body is stored in Azure Blob via
ArtifactMemoryService. - Assess quality —
KnowledgeQualityServicescores the record against quality rules.
Each stage emits an event in the canonical envelope (ArtifactIngested, MemoryRecordCreated, MemoryClassified, EmbeddingCompleted, GraphProjectionUpdated, KnowledgeQualityAssessed), so the entire ingestion is traceable and replayable. See Events and Workers.