Plans

Plan 0026

A shared brain, memories that strengthen and decay

Agent memory today is flat markdown recalled by grep: no ranking, no decay, no sharing, so every lesson is learned once per host and forgotten when recall misses. Steal three mechanisms from brains: retrieval strengthens a memory, bad outcomes weaken it (dopamine-style prediction error), and a background consolidation agent (the inner voice) merges, links, and promotes off-session. One fleet-wide embedding-indexed graph, real-time weight updates, habits alongside facts. A dreaming pass replays failure traces and per-session mood to re-link what agents missed in the moment, and dreams up tagged speculative memories that only real outcomes can promote.

Status
Input wanted RFC
Ambition
9 replaces flat per-host memory files with a learning substrate
Impact
8 every agent inherits every other agent's verified experience
Effort
8 graph store, embedding recall, reinforcement loop, consolidation agent
Risk
7 wrong reinforcement can entrench a bad memory fleet-wide
Maturity
1 hypothesis stage; MEMORY.md and grep are the only prior art here
Leverage
9 recall quality compounds across every future session
Taste
8 what strengthens and what decays is the entire design
Authors
andrewgazelka
Created
Updated
Tracking issue
-
Supersedes
-
Superseded by
-

Summary

Agent memory today is flat files: per-host markdown, grep for recall, no ranking, no decay, no sharing. Every lesson is learned once per host and lost the moment recall misses. Brains do better with three mechanisms this plan steals. Retrieval strengthens: what you recall often gets easier to recall. Bad outcomes weaken: prediction error demotes what hurt you. Consolidation runs in the background: sleep replays, merges, and links. Build a shared memory graph with those dynamics and every agent inherits every other agent’s experience, weighted by how well it has actually worked.

Design sketch

  • Store: one fleet-wide graph. Nodes are declarative facts and procedural habits (when X, do Y); habits are closer to what agents need than facts. Edges are typed: derived-from, contradicts, co-fired. Every node is embedding-indexed.
  • Recall: query by embedding, then spread along edges from the hits, like association. Rank by similarity times a learned weight, so often-used memories surface first.
  • Reinforcement: a recall that leads to a good outcome bumps the weight. An in-session judgment that a memory was wrong, stale, or hurt performance decays it, the dopamine analogue. Unused weights decay slowly by default, so the store forgets instead of accumulating forever. Negative habits degrade the same way positive ones grow.
  • Consolidation: a background agent, the inner voice, walks the graph off-session: merges near-duplicates, links memories that fired together, promotes hot recent memories to long-term, and flags contradictions for verification. One-shot notes become structure here.

Dreaming

Consolidation cleans the graph; dreaming rewrites it. A dream pass replays whole session traces, not just memory nodes, and hunts for the links the agent never made in the moment: two failures with the same root cause on different days, a fix in one repo that silently answered a struggle in another. Failure traces are the richest input, since the missed connection is usually the thing that failed.

Track mood alongside memory. Each session gets a cheap valence score from the friction in its trace (corrections, denied tool calls, retries, user frustration), stored on the memories that fired. Dreaming backtracks from bad episodes the way rumination does: walk from the frustration to the core memory that set it up, then re-arrange around it. Demote it, split it, or re-link the neighbors that should have fired instead. Mood is the routing signal for where to dream, the same way emotional salience picks what a brain replays at night.

Dreams also generate. From moments where the agent was corrected or plainly did not understand, synthesize new speculative memories: extrapolations of where the user is heading, written in the style of the user’s own past predictions. Imagine the next version of the site, or the API the user will ask for next. These are hallucinations on purpose, a small world model sketched ahead of the evidence. They enter the graph tagged as dreams with low weight; only reinforcement from a real outcome can promote them, and a dream that never comes true decays like any other unused memory.

Relation to what exists

Write-at-moment-of-learning and the MEMORY.md index remain the capture surface; this plan replaces storage and recall underneath. The existing verify-before-use rule becomes the negative stimulus: a memory that fails verification is precisely the one that should decay.

Drawbacks

Reinforcement entrenches: a wrong memory that keeps being recalled and shallowly confirmed grows stronger. A miscalibrated judge decays true memories. A shared store means one poisoned memory misleads the whole fleet. All three demand a conservative judge, reversible decay, and provenance on every write. Dreamed memories are fabrications by design; if the dream tag is ever lost they poison recall as confidently as facts.

Eval gate

Per plan 0023: recall precision against the grep baseline on replayed sessions, and an A/B on repeat-task suites. The number that must move is time and success rate on the second encounter of a known problem class.

Drafted by an AI agent via Claude Code; comments wanted, hence the RFC flag.

© 2026 Indexable, Inc.