Expand description
§Multi-Memory System
Hierarchical memory system with short-term, long-term, and entity memory.
Inspired by CrewAI’s memory architecture.
§Memory Types
- Short-term Memory: Recent conversation context, auto-expires
- Long-term Memory: Persistent facts and learnings, vector-searchable
- Entity Memory: Knowledge about specific entities (people, places, concepts)
§Example
ⓘ
use cortex::multi_memory::{MultiMemory, MemoryConfig};
let memory = MultiMemory::new(MemoryConfig::default());
// Store in short-term (recent context)
memory.short_term.add("User asked about Rust").await?;
// Store in long-term (persistent knowledge)
memory.long_term.store("Rust is a systems programming language", embedding).await?;
// Store entity information
memory.entity.update("Rust", "category", "programming_language").await?;
memory.entity.update("Rust", "creator", "Mozilla").await?;
// Query across all memory types
let context = memory.recall("Tell me about Rust", query_embedding).await?;Structs§
- Entity
- An entity with attributes
- Entity
Memory - Entity memory for tracking knowledge about specific entities
- Long
Term Entry - Entry in long-term memory with embedding
- Long
Term Memory - Long-term memory with semantic search
- Memory
Config - Configuration for the multi-memory system
- Memory
Item - A memory item with metadata
- Memory
Stats - Memory statistics
- Multi
Memory - Unified multi-memory system combining all memory types
- Recall
Result - Result of a memory recall
- Short
Term Memory - Short-term memory for recent conversation context
Enums§
- Memory
Source - Source of a memory