Rust coding agent zerostack gets a file-based memory subsystem
Author xavierforge designed and shipped a 797-line Rust memory subsystem for the minimal coding agent zerostack, using plain files and no vector store to persist context across sessions within tight resource constraints.
Score breakdown
The design demonstrates that a persistent, scoped, and bounded memory layer for a coding agent can be built without a vector store, keeping the entire system within zerostack's minimal-footprint philosophy.
- 01zerostack is a minimal Rust coding agent built on the Rig framework, running in around 16 MB of RAM with file-based context and no daemon.
- 02xavierforge contributed a 797-line Rust memory subsystem, merged in a seven-commit series at commit `3005eb6` on 2026-05-26.
- 03The design uses plain files for persistent memory — no vector store.
xavierforge describes how they came to contribute a memory subsystem to zerostack, a minimal Rust coding agent built on the Rig framework. The agent's design philosophy — roughly 16 MB RAM footprint, file-based context, sandboxed permissions, no daemon — matched what the author had been trying to build independently. After sending a PR to add custom HTTP header support for an internal LLM gateway, the author joined the project's Matrix chatroom and was invited by the maintainer to work on memory support.
The post frames the core problem as the "amnesia tax": without persistent memory, a coding agent re-asks where auth lives, re-discovers port conflicts, and re-derives naming conventions at the start of every session.
The post frames the core problem as the "amnesia tax": without persistent memory, a coding agent re-asks where auth lives, re-discovers port conflicts, and re-derives naming conventions at the start of every session. The fix, as the author describes it, is not to make the model remember but to give the harness a place to write things down between sessions and inject the relevant parts back at the start of the next one. Five constraints are identified for that storage layer — durability, project scoping, bounded context injection, mid-session recallability, and honesty about staleness — and the post frames the design as a series of deliberate trade-offs where those constraints pull against each other.
The shipped implementation is 797 lines of Rust, merged in a seven-commit series at commit `3005eb6` on 2026-05-26. The author chose conservative initial values: `MAX_INJECT_BYTES` at 16 KB and search context at ±1 line. The maintainer subsequently raised these to 64 KB and ±3, and hardened the write path with atomic writes, size-capped writes, and an FNV-1a slug hash for cross-Rust-version stability. The post notes that these are tuning knobs and that the underlying algorithms and architecture are unchanged. The source text is truncated before the full architectural detail is presented.
Key facts
- 01zerostack is a minimal Rust coding agent built on the Rig framework, running in around 16 MB of RAM with file-based context and no daemon.
- 02xavierforge contributed a 797-line Rust memory subsystem, merged in a seven-commit series at commit `3005eb6` on 2026-05-26.
- 03The design uses plain files for persistent memory — no vector store.
- 04Initial conservative constants were `MAX_INJECT_BYTES` at 16 KB and search context at ±1 line.
- 05The maintainer later raised those values to 64 KB and ±3, and added atomic writes, size-capped writes, and an FNV-1a slug hash for cross-Rust-version stability.
- 06The post identifies five constraints for the memory layer: durability, project scoping, bounded injection, mid-session recallability, and honesty about staleness.
- 07The author first contributed a PR adding custom HTTP header support for an internal LLM gateway before taking on the memory work.
Topics
Summary and scoring are generated automatically from the original article. We always link back to the publisher and never republish images or paywalled content. Last processed Jun 11, 2026 · 08:34 UTC. How this works →