🎯 Action Router
The single entry point is a POST to /api/v1 which accepts an action field
(memory.store, memory.query, memory.get, memory.delete, context.build).
The router dispatches to the correct handler based on this action — no REST
resource nesting, no multiple endpoints. This keeps the API surface minimal
and makes every operation traceable through a single gateway.
🔍 Policy Engine
Before any data is stored, the Policy Engine evaluates each incoming memory
candidate. It scores confidence, checks importance thresholds, and discards
low-value memories before they reach any provider. This runs BEFORE storage
so that providers only ever see high-confidence, policy-compliant data.
🧩 Context Builder
When the platform needs to answer a query, the Context Builder queries
every registered provider in parallel, merges results, ranks them by
relevance score, and applies a token budget. The merged context is then
returned with explainability metadata (trace_id + reasoning) so callers
know where each piece of information came from.
🔌 Provider Model
Every provider implements one of two ABCs — MemoryProvider or
KnowledgeProvider. The InMemory provider is the gold standard reference;
every other provider must pass the same conformance tests. Providers
are pluggable: add a new one by implementing the contract and registering
it. The Policy Engine and Context Builder treat all providers uniformly.
📡 Event Bus & Explainability
All operations emit structured events with a trace_id that follows the
request end-to-end. Every response includes an explainability block listing
which providers were queried, what they returned, how the context was
assembled, and any policy decisions that were made along the way.