ADR-0004: Flat Memory as Mediumπ
Statusπ
Accepted.
Decisionπ
Memory is the shared context in which agents and services operate. It is not limited to an explicit save or search tool. Durable knowledge, transient graph scratch data, graph execution, and execution evidence have separate owners and contracts.
Invariant: Durable Brain memory, transient Blackboard data, Router graph execution, and execution evidence keep distinct owners and lifecycles.
Memory ownersπ
| Surface | Owner and role | Boundary |
|---|---|---|
BrainCell | Brain stores durable facts, documents, and chunks with provenance. | A trace, conversation record, or arbitrary node value does not become a Cell automatically; see ADR-0018. |
CellEdges | Brain stores typed semantic relations between Cells. | Edges are not Router execution edges. Retrieval follows ADR-0011. |
BrainEngram | Brain compiles governed evidence into a wiki-first context product. | The Engram is derived from governed sources; see ADR-0010. |
BrainSynapse | Brain stores attributable action and outcome learning. | A Synapse is a learning signal, not graph topology. |
ConversationRecord | Brain stores bounded conversation evidence with its own access and retention contract. | Conversation evidence is not already a BrainCell. |
| Execution Trace and protected artifacts | Brain stores bounded run evidence and purpose-bound protected model-I/O artifacts. | Trace and artifact capture do not promote content into memory; see ADR-0014 and ADR-0018. |
| Blackboard | Brain stores tenant-scoped, TTL-managed scratch values for pass-by-reference graph work. | Blackboard is not durable knowledge, an event bus, or a graph scheduler. |
| Graph execution | Router admits and runs graph nodes, applies fan-in accounting, and records run evidence. | Graph control does not belong to Brain; durable workflow authority follows ADR-0016. |
Blackboard contractπ
Brain exposes WriteBlackboard, ReadBlackboard, and PruneExpiredBlackboard. Writes return a UUID reference. Payload reads accept batches of UUIDs, resolve tenant scope from the verified token, and exclude expired records. When menu-visible BlackboardSticker/v1 headers are enabled (planned in R-201), ListBlackboardMetadata may return bounded, non-expired sticker metadata (id, sticker_kind, content_hash, timestamps) within an explicit non-empty scope_path without returning payload bytes; full payload retrieval still requires ReadBlackboard by record IDs. Pruning is tenant-scoped.
Invariant: Blackboard payload reads stay bounded to caller-supplied record IDs and verified tenant scope, and optional sticker discovery stays bounded to metadata-only headers within an explicit non-empty scope_path; Blackboard never provides tenant-wide listing, payload dumps, watch streams, or self-scheduling.
Graph admission uses Router-declared conditions. A Blackboard write does not admit or schedule a node. Durable handoff and recovery evidence stay with their owning Brain record; TTL expiry removes the scratch value and does not imply that durable state was lost.
CellEdges useπ
The Router graph-first retrieval path uses a seed and bounded TraverseCellGraph to expand semantic relations, then resolves governed Engram context as configured. An agent may call the bounded traversal contract when it needs to inspect relations directly. CellEdges do not replace search, and search does not replace graph traversal.
Consequencesπ
- Execution, conversation, and protected model-I/O evidence require explicit provenance and policy before a separate memory producer may derive a Cell.
- Brain owns durable memory records; Router owns graph admission and execution. Worker's
S3TraceArtifactArchivehandles the separate protected trace-artifact lifecycle. General-purpose external object offload remains design-only under ADR-0015. - Product surfaces expose these owners through their typed contracts instead of treating every record as one shared event stream.
Non-goalsπ
- Turning Blackboard into a durable ledger, event bus, or scheduler.
- Treating trace or conversation capture as automatic memory formation.
- Replacing CellEdges traversal with search-only access or default raw Cell dumps.
- Applying blanket application-level encryption to all Brain fields.