Persistent Structured Storage for Minds
Component: Mind builder / runtime tools
Type: New tool
Summary
Minds have no durable, structured place to put state. Everything must live in the transcript or in prose memory. Add a persistent store the Mind and its sub-agents can read and write, with builder-declared structure, so record-shaped things stay records instead of degrading into paragraphs.
Problem
Structure degrades into prose. A character sheet is a set of fields; in a transcript it becomes paragraphs that get re-summarized and drift. There's no ground truth to correct against.
It costs tokens every turn. Re-establishing a sheet or task list each turn is pure overhead, growing with the state.
History is not compaction-safe. Summarization or context trimming can silently destroy state the Mind depends on.
Sub-agents have nowhere to put anything. Their output lands in the parent's context as clutter or is lost. Passing structured data down and back up through natural language is lossy and burns both contexts.
Memory is the wrong shape. Narrative recall is good for "what happened," poor for "the current value of
inventory.gold," and not built for multiple writers.No validation means silent corruption. One bad write (
"hp": "lots") poisons every later read.
Use cases: character sheets, project tracking, todo lists, calendars, accumulating research from parallel sub-agents, stable preferences.
Points to consider
Scope
Session scope (dies with the conversation, no cross-conversation drift) vs Mind scope (persists). Which is the default, and does a Mind plausibly need both at once — a persistent sheet plus a per-scene scratch area?
User scope: per-Mind-per-user, or one store shared across all Minds? Sharing globally looks bad — the same person is a different character in every Mind, and one Mind's fields won't match another's schema.
Should a sub-agent be able to claim a collection exclusively for the duration of its run, so a continuity agent can't have its sheet rewritten mid-task by a sibling? If so: lease lifetime, what happens on timeout or crash, and whether a stale lock can be broken.
Size and limits
Per-Mind quota, per-collection record cap, per-record size cap. What happens at the limit — reject, evict oldest, force compaction? Who's told, and can the Mind recover on its own or does it need the user?
Schema authority
Builder defines the initial schema. Should the Mind or a sub-agent be able to extend or alter it at runtime when the need appears?
If yes, does that require a grant, and how do we stop a sub-agent from reshaping data another agent depends on?
Per-collection strict vs freeform might be the useful distinction rather than a global switch.
Schema changes should be visible to the builder, not silent.
Addressing and handoff
Does the parent have to pass collection keys into the delegation payload? That's context cost and a failure point — hallucinated or mistyped keys.
Alternatives: namespace bound implicitly from the sub-agent's config, opaque handles resolved by the tool, or a describe call at sub-agent start.
Tradeoff: implicit is cheaper and more robust but less explicit and harder to debug.
Schema evolution and backward compatibility
Old conversations hold records in the old shape. Options: version the schema and keep old readers working, lazy migration on read, builder-authored migration instructions the Mind executes, or freeze old sessions against the current schema.
Does the builder get a migration preview? What happens to records that fail migration — dropped, quarantined, or left readable but stale?
Concurrency
Parallel sub-agents writing the same collection. Last-write-wins, versioned conditional writes, or per-record merge. Lost updates are the risk to design against.
Failure behavior
A rejected write should return a typed error naming the field and constraint, so the Mind self-corrects instead of retrying blindly. Worth deciding whether a validation failure is visible to the user or absorbed silently.
Privacy and lifecycle
Does the store appear in conversation export? Is it wiped on conversation delete? What's the retention story for anything user-scoped?
User visibility (post-MVP)
Read/edit for debugging and fixing is clearly not MVP. If deferred, what's the interim escape hatch — a read tool the user can prompt the Mind to call, or builder-side visibility into write failures?
Log in to comment and vote
Linked to Persistent State / Key-Value Store for Agents
No comments yet
Be the first to share your thoughts.