capsule-memory README

The project's README from github.com/unicity-aos/capsule-memory. As one markdown file: README.md.

astrid-capsule-memory

License: MIT OR Apache-2.0 MSRV: 1.94

Cross-session memory for Astrid OS agents.

In the OS model, this capsule is the persistent swap file. It carries context across session boundaries so the agent remembers what happened last time.

How it works

Hooks into prompt_builder.v1.hook.before_build. On each prompt assembly cycle:

  1. Reads .astrid/memory.md from the workspace via the VFS
  2. Wraps the content in a # Memory section
  3. Publishes an appendSystemContext hook response on the per-request response topic

If the file is missing or empty, the capsule is a no-op.

Size cap

Agent-written content can grow without limit (unlike human-authored AGENTS.md), so a 32KB hard cap prevents unbounded context window consumption. Content beyond the limit is truncated at a UTF-8 character boundary with a [Memory truncated] marker.

Read-only

This capsule handles the read/inject side only. The agent writes to .astrid/memory.md using existing filesystem tools (write_file, replace_in_file) from astrid-capsule-fs. No new tools needed.

Development

cargo build --target wasm32-unknown-unknown --release

License

Dual-licensed under MIT and Apache 2.0.

Copyright (c) 2025-2026 Joshua J. Bouw and Unicity Labs.

capsule-memory (unicity-aos/capsule-memory)

system-prompt
Searching Database…

What is this?It is a 'capsule' (plugin) for Astrid OS / Unicity AOS agents that gives them cross-session memory: it reads a local memory file from the workspace and injects its content into the system prompt so the agent remembers what happened in previous sessions.
Is this a standalone app or a plugin for something bigger?It's a small Rust hook module ('capsule') that plugs into Astrid OS's prompt-building pipeline — it only works as part of the larger Unicity AOS agent framework, not on its own.
How do I get this running?There's no separate install step: on each prompt assembly cycle it automatically reads '.astrid/memory.md' from the workspace via the VFS, wraps it in a '# Memory' section, and publishes an appendSystemContext hook response.
Does it need other Astrid OS capsules to work?Yes — this capsule only reads memory; writing to '.astrid/memory.md' is done through the filesystem tools (writefile, replaceinfile) provided by the separate astrid-capsule-fs capsule.
Are there any limits on how much memory it can inject?Yes, content is hard-capped at 32KB to protect the context window; anything beyond that gets cut at a UTF-8 boundary and marked with a truncation notice.
Who is this capsule meant for?Developers building or extending agents on Astrid OS / Unicity AOS who want their agents to retain context between sessions.
What is Astrid OS / Unicity AOS?It's an agent operating-system framework where this project is one of several modular 'capsules' that provide OS-like primitives (filesystem, memory, etc.) to AI agents, with this one acting as the persistent swap file for context.
What happens if memory.md doesn't exist yet?The capsule simply becomes a no-op and injects nothing into the prompt until the file exists and has content.
Why not just use a human-written AGENTS.md style memory file?Because agent-written content can grow without limit, unlike human-authored AGENTS.md, so this capsule enforces a hard 32KB cap to keep the context window bounded.
Size
0.1 MB
Stars
8.4K
Age
7mo
Commits · 90 Days