Expand description
heptagent-memory-tool-backend — Rust backend for the Anthropic memory_20250818 tool-call protocol.
First published Rust implementation of the Anthropic memory tool protocol.
§Architecture
MemoryCommand— 6-command enum deserialized from Worker tool-call JSON.MemoryBackend— FROZEN async trait (NP42);RedbMemoryBackendis the v0.1 impl.MemoryDispatcher— routesMemoryCommandto backend + enforces rate limit.QuestRateLimiter— D-C-03: 20 calls/quest hard cap (AtomicU32).
§Security
- T-14-00-01:
MemoryCommandusesserde(tag = "command", rename_all = "snake_case")strict deserialization — unknown command variants are rejected. - T-14-00-02: All
#[instrument]on dispatcher methods skip plaintext content fields per NP25 zero-knowledge invariant. - T-14-00-03:
QuestRateLimiterenforces 20 calls/quest cap. - T-14-00-05: Path validation rejects
..traversal + absolute paths.
Re-exports§
pub use error::MemoryError;pub use rate_limiter::QuestRateLimiter;
Modules§
- error
MemoryError— NP30 thiserror 2.0 derive pattern per Phase 12 sediment.- rate_
limiter QuestRateLimiter— D-C-03 Worker activememory_20250818tool-call rate limit.
Structs§
- Memory
Dispatcher - Routes
MemoryCommandto backend + enforces rate limit. - Memory
Result - Result returned to Worker after dispatching a
MemoryCommand. - Redb
Memory Backend - redb-backed implementation of
MemoryBackend.
Enums§
- Memory
Command - Anthropic
memory_20250818protocol commands — 6-variant enum.
Traits§
- Memory
Backend - NP42 FROZEN async trait — backend abstraction for memory_20250818 storage.