This page documents the Layer 4 ↔ Layer 7 binding: how agents read and write memory at runtime, and where the control plane enforces governance. It is the runtime counterpart of the Memory Fabric specification.

The binding is non-compliant unless it preserves the control plane: scope resolution before retrieval, recall as an authorized tool call, commit authority restricted to os-agt-010, lineage on every record, tombstone-preserving erasure, and Langfuse tracing of every recall. A binding that lets an agent read or write memory outside these paths is a shadow memory fabric.

Runtime roles

OS conceptRuntime construct
Memory tierA namespace segment in SynedrixMemoryStore, plus a Qdrant collection and/or a Postgres partition
Memory recordA row in memory_records (write-authoritative), projected to a Qdrant point and/or Neo4j node
memory_profile.recall_scopeThe scope intersection applied by os-agt-012 before the store query is built
tool:memory-recallA LangChain tool bound only if present in the resolved active_tool_set
tool:memory-proposeA LangChain tool that emits a proposal; it never writes
Working tierLangGraph graph state + a Postgres checkpointer
Formation / consolidation / reflectionNodes in the background consolidation graph, not in the agent graph
PromotionA tool call to os-agt-010, gated by os-agt-012
Graph tierNAMS MemoryClient in bolt mode against the OS Neo4j
Recall spanA Langfuse observation nested under the agent’s trace
memory.* eventsEmitted by os-agt-010 / os-agt-012, carrying the inherited correlation_id

Context assembly

The working tier is hot state for an in-flight run: task graph position, iteration counters, dedup windows, idempotency keys, and the in-session conversation buffer. It is stored in Redis and backed by the LangGraph checkpointer.

The working tier is never a source of truth. A run that cannot be reconstructed from the durable tiers (episodic, semantic, procedural, profile) after working memory is lost is non-compliant. Two operational rules follow:

  • Checkpoint retention must exceed the longest approval timeout. A graph that interrupts for approval and loses its checkpoint before the human answers leaves an approved action with no run to resume.
  • Do not share checkpointer state across unrelated agents. Each Layer 4 service gets its own checkpointer namespace.

Graph state, the checkpointer, SynedrixMemoryStore, and memory_records (Supabase) are four distinct layers:

ScopeLifetimeSource of truth?
Graph stateOne super-stepIn-processNo
CheckpointerOne thread / runUntil retention closesNo — run state only
SynedrixMemoryStoreCross-thread, tenant-scopedPer retention classNo — a governed view of records
memory_records (Supabase)TenantPer retention classYes

Recall as a tool call

Ambient memory injection is non-compliant. A memory read is a tool call bound in the agent’s active_tool_set, resolved through the three-layer tool authorization model, traced to Langfuse, and rejectable with agent.tool.unauthorized like any other tool.

The canonical tool identifiers are tool:memory-recall (read) and tool:memory-propose (write proposal). An agent with neither in its resolved active set has no memory access.

Hot path

Recall runs in the hot path — as a tool node in the agent graph. The agent needs the answer now:

{
  "correlation_id": "corr-9d4a83f1-...",
  "causation_id": "evt-7b1f0a92-...",
  "requesting_agent": "com-agt-003",
  "tiers": ["semantic", "profile"],
  "scope": { "tenant_id": "acme", "subject_id": "user-8842" },
  "query": "billing entity and invoicing preferences",
  "filters": {
    "min_confidence": 0.7,
    "valid_at": "2026-08-16T10:00:00Z",
    "compliance_labels_excluded": ["pci"]
  },
  "limit": 8
}
Illustrative example, not a production implementation. Review and test before use.

Response

{
  "correlation_id": "corr-9d4a83f1-...",
  "status": "served",
  "records": [ { "memory_id": "mem-4c8e...", "tier": "semantic", "content": { }, "confidence": 0.94,
                 "validity_interval": { }, "provenance": { } } ],
  "truncated": false,
  "scope_applied": { "tenant_id": "acme", "subject_id": "user-8842", "visibility": "tenant" },
  "tiers_denied": []
}
Illustrative example, not a production implementation. Review and test before use.

Records are always returned with their provenance and validity interval attached — an agent that receives memory without knowing where it came from or when it was true cannot ground its output, and groundedness is measured. A recall that returns records without these fields cannot be scored for groundedness.

Write patterns

Write authority for all durable tiers is restricted to os-agt-010 (Memory Curator Agent). Every other agent proposes; only os-agt-010 commits.

Formation proposal (hot path)

Any agent may fire a formation proposal through tool:memory-propose. This is a fire-and-forget call that returns a proposal id — the agent must not wait for extraction. The proposal is persisted as a raw record pending commit.

Commit (background)

Commit runs in the background as part of the scheduled WF-OS-MEMORY-CONSOLIDATE workflow:

sequenceDiagram
    participant W as n8n workflow<br/>WF-OS-MEMORY-CONSOLIDATE
    participant P as os-agt-012<br/>(scope validator)
    participant Policy as os-agt-002<br/>(policy gate)
    participant C as os-agt-010<br/>(Memory Curator)
    participant R as os-agt-011<br/>(Consolidation & Reflection)

    W->>W: fetch uncommitted proposals<br/>+ consolidation candidates

    W->>R: invoke os-agt-011<br/>LangGraph reflect-and-revise
    R-->>W: proposes merges,<br/>promotions, distilled skills

    W->>P: scope validation per proposal
    P-->>W: scope resolved

    alt promotion requiring approval
        W->>Policy: policy gate for promotion
        Policy-->>W: approved / denied
    end

    W->>C: commit approved proposals
    C-->>W: records committed

    W->>W: emit memory.record.consolidated/<br/>.promoted/.completed/.distilled
    W->>W: persist Outcome Envelope

The separation of authority is load-bearing: os-agt-011 recommends, os-agt-010 executes, os-agt-012 approves access. No agent both proposes and commits durable memory.

Graph-tier writes

Every graph-tier write is a NAMS MemoryClient call, never hand-written Cypher issued from an agent node. A NAMS call made from an arbitrary agent node is a governance bypass even though the data lands in the right store. The write goes through os-agt-010 after os-agt-012 has validated scope, carrying the record’s correlation_id.

# os-agt-010 (Memory Curator) — commit a consolidated entity assertion.
# Runs only inside WF-OS-MEMORY-CONSOLIDATE's commit step, after os-agt-012
# has validated scope. Never called from an arbitrary agent node.
result = await memory_client.upsert_entity(
    user_identifier=f"{tenant_id}:{subject_id}",   # tenant_id first, always
    entity_type="Organization",                    # a POLE+O label
    properties={"name": "Acme Logistics BV", "entity_ref": "org-2231"},
    source_step_id=agent_step_id,                  # creates the :TOUCHED edge
)
Illustrative example, not a production implementation. Review and test before use.

The :TOUCHED edge this call creates — from the AgentStep node to the entity node — is the reasoning-to-entity lineage. A later question (“which reasoning step asserted this fact about this entity, and what did it touch besides”) is a one-hop traversal from the entity node.

SynedrixMemoryStore — the compliance seam

LangGraph’s BaseStore is the only memory surface the Layer 4 runtime natively understands, so everything the OS builds must present through it. Stock implementations (InMemoryStore, PostgresStore) are not canonical: used directly they become a second source of truth with no authorization, no lineage, and no retention.

The OS implements BaseStore itself. That implementation is where the control plane is enforced — specifically through its five methods:

MethodEnforcement
aput(namespace, key, value, index=None)Rejects direct writes. Routes to tool:memory-propose; only os-agt-010 may commit. Raises rather than silently downgrading to a proposal.
adelete(namespace, key)Rejects. Deletion is erasure and requires approval; it is never a store operation.
asearch(namespace_prefix, *, query, filter, limit, offset)Scope intersection and filters pushed into the Qdrant/Postgres query, never applied after retrieval. Returns records with provenance and validity_interval attached.
alist_namespaces(...)Returns only namespaces within the caller’s resolved tenant.

The two rejecting methods (aput and adelete) are the load-bearing ones. They prevent a well-meaning agent from writing durable memory directly, bypassing commit authority and erasure approval.

Namespace convention

(tenant_id, tier, scope_id)
Illustrative example, not a production implementation. Review and test before use.

tenant_id is always first. This is fail-safe ordering: a namespace assembled in the wrong order under-matches and returns nothing, rather than over-matching and returning another tenant’s memory.

("acme", "semantic", "user-8842")     # subject-scoped semantic memory
("acme", "procedural", "com-agt-003") # an agent's distilled skills
("acme", "episodic", "sess-1f9c")     # session-scoped episodes
Illustrative example, not a production implementation. Review and test before use.

Prefix search — asearch(("acme", "semantic")) — returns everything below that prefix, which is why a tenant can never be reached by a partially-specified namespace.

Backing stores

ConcernStore
Record of truthSupabase PG17 — memory_records and the lineage tables
Semantic indexQdrant — one collection per fabric tier; KB consumer collections are a separate class
Entity / relationship / reasoning graphNeo4j via NAMS
Working tierRedis + the LangGraph checkpointer

Wiping the Qdrant mem_* collections or the Neo4j fabric graph and rebuilding from Supabase must produce identical behaviour. A domain pack’s operational stores are rebuilt from the sources the pack declares, and a full-store drill must run both. That is the operational test for “projection, not source of truth.”

Qdrant collection contract

Fabric tier collections (one collection per tier; scope lives in the payload, not the collection name):

CollectionTier
mem_episodicepisodic
mem_semanticsemantic
mem_proceduralprocedural
mem_profileprofile

KB / consumer collections are a separate class (example: synedrix_os_kb). Each consumer owns a dedicated collection and MUST NOT share a fabric tier collection.

Point identity: for fabric projections, the Qdrant point id MUST be the memory_id UUID string from memory_records.

Required payload fields (indexed for filterable search): memory_id, tenant_id, tier, visibility, scope_type, scope_id, subject_id, agent_id, session_id, content_hash, confidence, valid_from, valid_until, consolidation_state, retention_class, compliance_labels, version.

Recall queries MUST push tenant_id and the applicable scope filter into Qdrant. Post-filtering a full tenant result set for scope is forbidden.

Operational collections

A domain pack may maintain a Qdrant collection that is not memory — a domain-owned operational store, an index derived from data the pack already holds. These sit outside the eight tiers and the mem_* and KB rules above do not apply to them; these rules do:

  • Name: ops_<domain-pack-id>_<store> (e.g. ops_trd_regime_fingerprints). Never mem_*, and never a fabric tier or KB collection. Each belongs to one domain pack.
  • Point identity: a deterministic UUIDv5 keyed on tenant_id, business_instance_id, and domain-key components. Never a memory_id. The composite key is (tenant_id, business_instance_id, <domain key>), where the pack declares the domain key per collection (for example regime_version). It is never a memory_id, and tenant_id is part of the ID so two tenants, or two business instances of one tenant, with the same domain key cannot address each other’s point. Writes are idempotent upserts on that ID, and the scope payload filter below is still mandatory.
  • Tenant isolation: tenant_id is a required indexed payload field and a mandatory filter on every query and write. Where the source data is business-instance-owned, business_instance_id is also a required indexed payload field and a mandatory filter, because a tenant can own several business instances with their own configuration and history. A request without it fails closed (invariant 12). Where the tenant has its own Qdrant (data-plane per tenant), the filter is still required.
  • Neo4j operational graphs: Neo4j Community has no database RBAC, so credentials cannot scope a graph. Agents reach an operational graph only through an allowlisted, parameterised query wrapper that injects the authenticated tenant_id (and business_instance_id for business-instance-owned graphs) and the graph’s label predicates. The generic read-only Cypher tool is not granted for them.
  • Authorization (Qdrant): a collection-scoped credential (JWT r/rw per collection) is issued to the declared writer workflow, and a read-only credential to readers. No agent holds a credential that spans an operational and a mem_* collection.
  • Rebuild: from the source the domain pack declares for that collection, never from memory_records. The embedding model, model version and dimension are part of the collection contract, as above. The pack declares them per collection alongside the source.
  • Readiness flags: where a pack gates reads on a readiness flag (for example Trading’s scenario_vectors_ready:{version}), a rebuild clears the affected flags before wiping the collection and restores each only after all of that version’s points are committed.
  • Not recalled as memory: read by a bound domain tool, never through the recall contract.

The memory record envelope and Postgres-first write

Every governed memory record carries a structured envelope that mirrors the common event envelope so memory lineage and event lineage compose without translation.

FieldTypeRequiredDescription
memory_idstring (UUID)YesGlobally unique record identifier. Stable across supersession.
tierstringYesOne of the eight tiers.
scopeobjectYesOwnership and visibility. tenant_id is mandatory and always first.
contentobjectYesThe memory payload. Shape is tier-specific and, for domain tiers, pack-defined.
content_hashstringYesHash of content, used for dedup and tombstone verification after erasure.
provenanceobjectYesWhat produced this record. source_event_id is mandatory.
derived_fromarray[string]Yesmemory_ids this record was consolidated or reflected from.
confidencenumber (0–1)YesExtraction or inference confidence.
validity_intervalobjectYes{ valid_from, valid_until } (ISO 8601 UTC).
supersedesstring | nullYesThe memory_id this record replaces, or null.
retention_classstringYesOne of: ephemeral, session, operational, durable, audit, regulated.
compliance_labelsarray[string]NoRegulatory tags (e.g. pii, pci, gdpr-subject).
versionstring (SemVer)YesRecord schema version.

Provenance

formation_method is one of extraction, declaration, consolidation, reflection, or import. A memory record with no provenance.source_event_id is non-compliant — there is no path by which memory enters the fabric without an event having caused it.

Postgres-first write rule

The graph tier adds a concrete write path for lineage. Lineage links are written to Postgres (agent_lineage_links) first, then synced to Neo4j as a fire-and-forget projection. Postgres is write-authoritative; the graph is never written directly from an agent node.

// Project one agent_lineage_links row from Postgres into Neo4j.
// Parameters: source_id, target_id, relation, tenant_id,
// correlation_id — NOT from causation_id alone.
MERGE (src:Outcome {outcome_id: $source_id})
  ON CREATE SET src.tenant_id = $tenant_id
MERGE (tgt:Outcome {outcome_id: $target_id})
  ON CREATE SET tgt.tenant_id = $tenant_id
SET tgt.correlation_id = coalesce($correlation_id, tgt.correlation_id)

// relation_type selection between four fixed patterns:
MERGE (src)-[r:`contributed-to`]->(tgt)
  ON CREATE SET r.tenant_id = $tenant_id
Illustrative example, not a production implementation. Review and test before use.

Because both use MERGE, running the same projection twice (normal for a fire-and-forget async step) leaves the graph unchanged rather than duplicating nodes.

Lifecycle and state machine

Authority separation

StageWhat happensWho may triggerWho commitsEvent emitted
captureSource event carries eligible contentAny workflow or agent—(the source event)
formationContent becomes a raw record with full envelopeAny agent (proposal)os-agt-010memory.record.formed
consolidationSeveral records merge into one derived recordos-agt-011 (recommends)os-agt-010memory.record.consolidated
reflectionHigher-order inference derivedos-agt-011 (recommends)os-agt-010memory.reflection.completed
promotionRecord moves to a longer-lived tieros-agt-011 or workflowos-agt-010, gated by os-agt-012memory.record.promoted
recallRecord is read into agent contextAny agent, as a tool call— (read)memory.recall.*
decayvalidity_interval expiresScheduleros-agt-010memory.record.expired
demotionTier or visibility is reducedos-agt-011os-agt-010memory.record.demoted
erasureContent destroyed; tombstone remainsHuman or complianceos-agt-010, approved by os-agt-002memory.record.forgotten

Hot path stages: capture, formation proposal, recall. Background stages: formation commit, consolidation, reflection, decay, demotion. Erasure: out of band, approval-gated.

Promotion contract

No memory record crosses a tier boundary without a memory.record.promoted event carrying correlation_id and causation_id unchanged. Legal promotions include:

FromToTypical triggerGate
workingepisodicSession handoff, run completionos-agt-012 scope check
episodicsemanticConsolidation over ≥ N episodesConfidence threshold + os-agt-012
episodicproceduralSkill distillationConfidence threshold + os-agt-012
episodicprofileReflection over subject episodesos-agt-012 + consent labels
semanticrelationalAssertion becomes canonical business stateos-agt-002 policy approval
anyany, with widened visibilitySession → agent → subject → tenantos-agt-012 per step

Promotions requiring policy approval: any promotion into relational, any widening beyond tenant visibility, any promotion of a record carrying regulated compliance labels, and any erasure. Threshold values (minimum episodes, minimum confidence) are business-instance configuration; the mechanism is OS-owned.

Erasure and the tombstone rule

Forgetting is an approved action that leaves a tombstone. When erasure is approved:

  1. Content is destroyed in the write-authoritative store and every projection.
  2. A tombstone is written retaining: memory_id, tier, scope.tenant_id, content_hash, provenance, derived_from, validity_interval, the erasure approval reference, and the timestamp. consolidation_state becomes tombstoned.
  3. Lineage edges in graph memory survive — the shape of what happened remains.
  4. memory.record.forgotten is emitted.

A deletion must never silently punch a hole in the audit trail. Records with derived_from pointing at a tombstoned record are flagged for review by os-agt-011.

Retention classes

ClassDecay behaviourErasableTypical tiers
ephemeralTTL, hard expiryn/a — expiresworking
sessionExpires at session close unless promotedYesworking
operationalWindowed retention, then aggregationYestemporal, episodic
durableNo automatic expiry; decays by supersessionYessemantic, procedural, profile
auditNever decays. Append-only.Only via tombstoneepisodic, graph
regulatedRetention floor and ceiling by complianceMandatory at ceilingany

Layer 7 owns the retention mechanism; Layer 12 (business instance) owns the retention values.

NAMS binding for the graph tier

NAMS is adopted as a library over the existing self-hosted Neo4j, not as a platform. The hosted service is not permitted in any deployment mode.

Configuration

# Self-hosted bolt mode ONLY. Never set MEMORY_API_KEY — its presence
# switches the client to the hosted service.
settings = MemorySettings(
    uri="bolt://neo4j:7687",
    database="neo4j",
    llm="openai/local-model",
    embedding="openai/local-embed",
)
Illustrative example, not a production implementation. Review and test before use.
SettingRule
TransportBolt against the OS Neo4j. MEMORY_API_KEY must be unset.
MEMORY_LLM / MEMORY_EMBEDDINGVia LiteLLM. In Mode 3 these must resolve to local URIs (Ollama / vLLM).
Multi-tenancyuser_identifier carries tenant_id. Never omit it.
ConcurrencyAsync-only; all calls are coroutines.
VersionPin explicitly. NAMS is experimental with no SLA.

What NAMS owns and does not

NAMS capabilityPosition
Long-term knowledge graph (POLE+O entities)Adopted
Reasoning memory (AgentStep, ToolCall, :TOUCHED)Adopted
Entity deduplication / consolidationAdopted — invoked from os-agt-011, committed by os-agt-010
Its own vector indexScoped to entity resolution only. Qdrant is the single semantic substrate.
Short-term memory (conversations)Not used.
MCP serverGoverned by mcp_tool_policy. Not exposed by default.

Neo4j Community Edition constraints

Three Community limits shape the binding:

LimitConsequenceHow it is handled
Exactly one standard databaseNo per-tenant database isolationTenant separation by scope tuple + os-agt-012
Only uniqueness constraintsPOLE+O schema cannot enforce types at DB levelEnvelope validation in os-agt-010 before commit
No online backupGraph cannot be hot-backed-upNeo4j projection is rebuilt, not restored

Governance bridge

ConcernImplementation
Scopeos-agt-012 intersects request scope with memory_profile.recall_scope, pushes into store query. Post-filtering is non-compliant.
Tool authorizationtool:memory-recall / tool:memory-propose bound only from resolved active_tool_set; otherwise agent.tool.unauthorized.
Commit authoritySynedrixMemoryStore.aput rejects direct writes. Only os-agt-010 commits durable memory.
PromotionEvery tier transition emits memory.record.promoted; policy-gated transitions additionally pass os-agt-002.
Erasureadelete rejects. Erasure runs its own approval-gated workflow and leaves a tombstone; graph lineage survives.
ObservabilityEvery recall opens a Langfuse span nested under the agent trace, recording tiers requested, tiers denied, record count, and scope applied.
Audit read-onlyos-agt-008 is never bound as a memory tool. It queries the fabric; it is not invoked by it.

Observability

SignalSource
Retrieval quality, groundednessExisting metric families applied to tool:memory-recall results
Recall latency, records returned, tiers deniedLangfuse span attributes on the recall observation
Consolidation lag (capture → committed)memory.record.formed → memory.record.consolidated timestamps
Memory growth rate, stalenessAggregated in QuestDB from memory.* events
Promotion rejection rateos-agt-012 denials over promotion attempts

Deployment modes

Every tier must be satisfiable in Mode 3 (air-gapped). Nothing requires an external service.

ConcernMode 1Mode 2Mode 3
StoresAll self-hostedAll self-hostedAll self-hosted
Extraction / inferenceCloud permittedPer-agent splitLocal only (Ollama / vLLM)
Embeddings for QdrantCloud permittedPer-agent splitLocal only
NAMSSelf-hosted boltSameSame. MEMORY_API_KEY unset.
NAMS hosted serviceNot permitted in any mode——

Air-gapped invariant. An instance declared deployment_mode: air-gapped must not contain any memory control-plane configuration with a cloud model or embedding URI. This is a configuration validation error, not a warning.

Consolidation compute budget. In Mode 3, background consolidation and reflection compete with agent inference for local GPUs. The control plane must degrade by deferring background stages, never by skipping the governance path.

Compliance checklist

Before declaring a memory binding compliant:

  • SynedrixMemoryStore implements all five BaseStore methods; aput and adelete reject.
  • Namespaces are (tenant_id, tier, scope_id) with tenant_id first.
  • Scope is resolved by os-agt-012 and pushed into the store query before retrieval.
  • tool:memory-recall / tool:memory-propose are bound only from the resolved active_tool_set.
  • No agent other than os-agt-010 commits to episodic, semantic, procedural or profile.
  • Every committed record has provenance.source_event_id, derived_from and validity_interval.
  • Every tier transition emits memory.record.promoted with the inherited correlation_id.
  • Erasure leaves a tombstone; graph lineage survives; content_hash is retained.
  • Recall results carry provenance and validity_interval.
  • Recall spans export to Langfuse; no LangSmith dependency.
  • Checkpointer retention exceeds the longest approval timeout, and checkpoint stores are backed up.
  • Qdrant mem_* collections and the Neo4j fabric graph can be wiped and rebuilt from Supabase without behaviour change, and each operational store (ops_* collections and domain graphs) can be rebuilt from its declared source in the same drill.
  • NAMS runs in bolt mode; MEMORY_API_KEY is unset; in Mode 3 MEMORY_LLM / MEMORY_EMBEDDING are local URIs.
  • The NAMS MCP server is governed by mcp_tool_policy; the read-only Cypher tool is not exposed by default.
  • os-agt-008 is not bound as a memory tool.