Capsule Memory is a persistent context management tool for Astrid OS agents that maintains cross-session memory by injecting stored context into system prompts.
The tool solves the problem of agents losing context between sessions by reading a local memory file and automatically including its contents in each prompt assembly cycle. It hooks into the prompt-building process, retrieves memory state from a workspace file via the virtual filesystem, wraps the content in a Memory section, and publishes it as system context for the current request. This approach keeps agent context persistent without requiring manual prompt engineering.
Developers building Astrid OS agents should adopt this tool if they need agents to retain information across multiple interactions. It suits any agent workflow where continuity matters—remembering previous decisions, learned facts, or ongoing tasks. The tool includes a 32KB hard cap on memory content to prevent unbounded context window growth, with truncation at UTF-8 boundaries when the limit is exceeded. Agents write to memory using existing filesystem tools from the astrid-capsule-fs module rather than through new dedicated tools, keeping the interface minimal.
The project maintains a focused scope with clear separation of concerns: this capsule handles only the read-and-inject side of memory management, leaving write operations to general-purpose filesystem utilities. Development activity shows attention to practical constraints, evidenced by the deliberate size-limiting mechanism and the decision to reuse existing tools rather than introduce new ones. The codebase is written in Rust and dual-licensed under MIT and Apache 2.0.