Skip to main content

Crate heptagent_memory_tool_backend

Crate heptagent_memory_tool_backend 

Source
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); RedbMemoryBackend is the v0.1 impl.
  • MemoryDispatcher — routes MemoryCommand to backend + enforces rate limit.
  • QuestRateLimiter — D-C-03: 20 calls/quest hard cap (AtomicU32).

§Security

  • T-14-00-01: MemoryCommand uses serde(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: QuestRateLimiter enforces 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 active memory_20250818 tool-call rate limit.

Structs§

MemoryDispatcher
Routes MemoryCommand to backend + enforces rate limit.
MemoryResult
Result returned to Worker after dispatching a MemoryCommand.
RedbMemoryBackend
redb-backed implementation of MemoryBackend.

Enums§

MemoryCommand
Anthropic memory_20250818 protocol commands — 6-variant enum.

Traits§

MemoryBackend
NP42 FROZEN async trait — backend abstraction for memory_20250818 storage.