Memory
“Memory” is overloaded and needs to be split. The system should not say “memory” without saying which of these four it means.
Four kinds
Working memory is runtime-local cache: offsets, dedup, recent context, temporary summaries, and auth tokens. This belongs in Durable Object SQLite or equivalent runtime-local storage.
Durable semantic memory is information worth keeping across runs: facts, preferences, commitments, summaries, learned handles, and prior decisions. This must not live only in runtime-local SQLite if it matters to future behavior across devices, deployments, or agent restarts.
Observability memory is the execution timeline: run events, session lifecycle, failures, retries, and approvals. This is not agent cognition. It is operator truth.
World history is the shared stream and mutation history of the substrate. This is neither cache nor observability projection. It is the durable record of participation and structure.
The gap today
Agents currently see a sliding window of recent messages (hardcoded at 50) and forget everything across activations. The 50-message window is a wall. An agent that participates across rooms over days needs persistence beyond the window.
Where durable semantic memory lives
Three places memory could live, each with real tradeoffs:
-
Records — a
memoryrecord type with structured content (facts, preferences, learned associations). Queryable through the normal record API, permission-gated, inspectable. But records are not designed for high-write, high-read semantic retrieval. -
A dedicated stream — append-only memory events that accumulate over time. Natural for “what did the agent learn” narratives. But streams are ordered by time, not by semantic relevance. Retrieval requires indexing.
-
Records plus stream-backed index — facts are records, the learning history is a stream, and a retrieval index (embeddings, keyword index, whatever) is an implementation detail that can be rebuilt from the durable data.
Option 3 is right. Here’s why:
A durable fact (“user prefers tabs over spaces”, “the deploy key for prod is in 1Password under X”, “last incident was caused by Y”) is a record. It has identity, it can be updated or deleted, it’s permission-gated, it survives runtime restarts.
The history of how that fact was learned (“agent observed in session Z that user corrected indentation three times”) is a stream event. It’s provenance, not the fact itself.
The retrieval mechanism (embedding search, keyword matching, recency weighting) is an index over both. It’s an implementation detail. Rebuild it from records + stream if you lose it.
Memory records are scoped — agent-level memories are private to that agent, house-level memories are shared knowledge within the house. The permission model already handles this through parent_id chain-walking.
Working memory (offsets, dedup state, auth tokens, context cache) stays in DO SQLite. It’s runtime-local by definition. The important thing is that nothing in DO SQLite is the only copy of something that matters across restarts.
Observability memory (run events, session lifecycle) stays in its existing stores — local SQLite for repo work, run event streams for shared work.
See record-types for the memory record schema.