Skip to main content

Module memory

Module memory 

Source
Expand description

§Module: Memory

§Responsibility

Provides episodic, semantic, and working memory stores for agents. Mirrors the public API of tokio-agent-memory and tokio-memory.

§Guarantees

  • Thread-safe: all stores wrap their state in Arc<Mutex<_>>
  • Bounded: WorkingMemory evicts the oldest entry when capacity is exceeded
  • Decaying: DecayPolicy reduces importance scores over time
  • Non-panicking: all operations return Result
  • Lock-poisoning resilient: a panicking thread does not permanently break a store
  • O(1) agent lookup: EpisodicStore indexes items per-agent for efficient recall

§NOT Responsible For

  • Cross-agent shared memory (see runtime.rs coordinator)
  • Persistence to disk or external store

Re-exports§

pub use crate::types::AgentId;
pub use crate::types::MemoryId;

Structs§

DecayPolicy
Governs how memory importance decays over time.
EpisodicStore
Stores episodic (event-based) memories for agents, ordered by insertion time.
EpisodicStoreBuilder
Fluent builder for EpisodicStore.
MemoryItem
A single memory record stored for an agent.
SemanticStore
Stores semantic (fact-based) knowledge as tagged key-value pairs.
WorkingMemory
A bounded, key-value working memory for transient agent state.

Enums§

EvictionPolicy
Policy controlling which item is evicted when the per-agent capacity is exceeded.
RecallPolicy
Controls how memories are scored and ranked during recall.