Agent Memory: What Outlives the Run
Agent memory is the knowledge that survives a run, not the working state inside one. This explainer separates the two, then maps the write path, the read path, and the database limits that cap recall.
Loading…
Topic
3 posts about Agent Memory. Every summary links to the original.
See the idea
Agent memory is the knowledge that survives a run, not the working state inside one. This explainer separates the two, then maps the write path, the read path, and the database limits that cap recall.
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Long agent traces of chains of thought and tool calls accumulate stale content that anchors later generations and outgrow context window. SELFCOMPACT lets the model itself decide when and how to compact rather than using fixed-interval compaction triggered at a token threshold. It pairs a compaction tool that summarizes accumulated context with a lightweight rubric for when to fire, such as resolved sub-task or converging trajectory, and when to suppress, such as mid-derivation or stuck. Both are needed: the tool alone is unevenly used across open-weight models, while a rubric closes a meta-cognitive gap without training. On six math and agentic-search benchmarks across seven models, SELFCOMPACT matches or exceeds fixed-interval summarization at a fraction of the token cost, improving over no summarization by up to 18.1 points on math and 5–9 points on agentic search at 30–70% lower per-question cost.
Agent memory built on chDB, an embedded SQL OLAP engine, accumulated state such as project rules, user preferences, and recall traces on a single laptop. Moving that memory to CI, sandboxes, or another laptop broke the local-disk assumption because the MergeTree directory existed on only one disk. Adding a ClickHouse server backend fixed portability but turned every recall into a network round trip. The chDB Durable Layer fills the gap by keeping the local analytical hot path while publishing authoritative state to object storage (S3, GCS, or Azure Blob). Applications write to a local working copy and use flush() to publish writes and checkpoint() to compact the log, avoiding a sidecar or database server. The contract supports Python, Node, Go, and Rust bindings with cross-binding recoverability.
The post distinguishes agent state, the run-bound working data of a single execution, from agent memory, knowledge that outlives the run and is read across sessions. Context compaction, which decides what to keep when the window fills, is lossy by construction and sets both token cost and reliability; Chroma’s study found models become unreliable well before their advertised 200k-token window, and teams compact at 95% or proactively at 60%. System prompts and skills must be versioned, governed infrastructure, not text files, with prompt registries and the SKILL.md standard for procedural memory, and skills are executable so they require sandboxing. Enterprise data enters memory through pipelines like change data capture, not migrations, with chunking, embedding, and provenance stamps. The database choice caps filtered recall under selective scoping, the consistency window, and temporal modeling, setting the ceiling for later decisions.
The best engineering reads, once a week.