Memory Orchestration End-to-End Specification
Last updated: 2026-08-23
1. Objective
This specification defines the end-to-end execution contract of MemoryOrchestrator in Sparse Evo-MemoryLM.
It covers request normalization, retrieval, context fusion, model execution, learning update, writeback, and resilience behavior.
2. Execution flow
- Accept input and normalize it with
InputNormalizer. - Emit
transaction_startedandretrieval_started. - Extract semantic context and run memory retrieval.
- Prune/fuse retrieval outputs and build
MemoryContextPayload. - Extract explicit causal evidence into
causal_context. - Evaluate policy with
ExecutionPolicy. - Execute model inference, applying fallback if needed.
- Run learning update and writeback unless in consolidation mode.
- Commit on success, or rollback/degrade on failure.
3. Identity isolation contract (tenant/user/client)
- Propagate
tenant_id,user_id, andclient_idintoMemoryOrchestrator.process_request(...). - Compatibility mode (default): if
tenant_idis omitted, it is normalized topublic;user_idandclient_idremain optional. - Strict mode: when
EVOSPIKENET_IDENTITY_STRICT=true, the API rejects missingtenant_id/user_id/client_idwith400. - Retrieval and writeback enforce tenant boundaries as required keys to prevent cross-tenant blending.
- Persistent fallback snapshots are written under tenant subdirectories (
<persistent_fallback_dir>/<tenant_id>/).
4. Failure contract
- In fail-fast mode (
fail_fast=true), raiseOrchestrationRuntimeError. - In degraded mode (
fail_fast=false), return structuredFailureHandlingResult. - Error codes:
MLI-REQ-001request normalizationMLI-RET-001memory retrievalMLI-EXE-001model executionMLI-LRN-001learning updateMLI-WRB-001memory writeback
5. Persistent fallback
When persistent_fallback_dir is configured, degraded failures are persisted as JSON snapshots.
Stored fields include:
- request/session/source/status
- failure_type/failed_stage/error_code/message
- nested structured failure object
- memory event trail
6. Schemas
MemoryContextPayloadsemantic_context,retrieved_memories,causal_context,generated_outputFailureHandlingResultfailure_type,failed_stage,error_code,retryable,safe_modeOrchestrationResponsestatus,failure,metadata,causal_context
7. Related docs
EvoSpikeNet-Core/specs/system_orchestration_spec.mdEvoSpikeNet-Core/specs/system_orchestration_spec.ja.mdSPARSE_EVO_MEMORYLM_SYSTEM_REVIEW.en.md