Expand description
§mem7
LLM-powered long-term memory engine with a Rust core and Python bindings.
§Quick start
use mem7::{MemoryEngine, MemoryEngineConfig, ChatMessage, MemoryFilter};
#[tokio::main]
async fn main() -> mem7::Result<()> {
let config = MemoryEngineConfig::default();
let engine = MemoryEngine::new(config).await?;
let messages = vec![
ChatMessage { role: "user".into(), content: "I love Rust".into() },
];
let result = engine.add(&messages, None, None, None).await?;
println!("{result:?}");
Ok(())
}Modules§
- dedup
- Memory deduplication utilities.
- embedding
- Embedding client trait and the built-in OpenAI-compatible implementation.
- history
- SQLite-backed audit history.
- llm
- LLM client trait and the built-in OpenAI-compatible implementation.
- vector
- Vector index trait and built-in implementations (in-process flat index, Upstash).
Structs§
- AddResult
- Aggregated result of a full add() call.
- Chat
Message - A chat message in the conversation.
- Embedding
Config - Fact
- A fact extracted by the LLM from a conversation.
- History
Config - LlmConfig
- Memory
Action Result - Result of an add() operation for a single memory.
- Memory
Engine - The core memory engine. Orchestrates the full add/search/get/update/delete/history pipeline.
- Memory
Engine Config - Memory
Event - A single entry in the memory audit trail.
- Memory
Filter - Filter criteria for querying memories.
- Memory
Item - A single memory item stored in the system.
- Search
Result - Result of a search() call.
- Vector
Config
Enums§
- Mem7
Error - Memory
Action - The type of memory event recorded in the audit trail.
Functions§
- new_
memory_ id - Generate a new UUIDv7 memory ID (time-sortable, RFC 9562).