Skip to main content

adk_memory/
lib.rs

1//! # adk-memory
2//!
3//! Semantic memory and search for ADK agents.
4//!
5//! ## Overview
6//!
7//! This crate provides long-term memory capabilities:
8//!
9//! - [`InMemoryMemoryService`] - Simple in-memory memory storage
10//! - [`MemoryService`] - Trait for custom backends
11//! - [`MemoryEntry`] - Structured memory with metadata
12//!
13//! ## Quick Start
14//!
15//! ```rust,no_run
16//! use adk_memory::InMemoryMemoryService;
17//!
18//! let service = InMemoryMemoryService::new();
19//!
20//! // Memory is automatically searched and injected
21//! // when configured via LlmAgentBuilder::include_memory()
22//! ```
23//!
24//! ## Features
25//!
26//! - Per-user memory isolation
27//! - Semantic search queries
28//! - Metadata filtering
29//! - Automatic context injection
30
31pub mod adapter;
32pub mod inmemory;
33pub mod migration;
34pub mod service;
35pub mod text;
36
37#[cfg(any(feature = "database-memory", feature = "mongodb-memory", feature = "neo4j-memory"))]
38pub mod embedding;
39#[cfg(feature = "mongodb-memory")]
40pub mod mongodb;
41#[cfg(feature = "neo4j-memory")]
42pub mod neo4j;
43#[cfg(feature = "database-memory")]
44pub mod postgres;
45#[cfg(feature = "redis-memory")]
46pub mod redis;
47#[cfg(feature = "sqlite-memory")]
48pub mod sqlite;
49
50pub use adapter::MemoryServiceAdapter;
51pub use inmemory::InMemoryMemoryService;
52pub use service::{MemoryEntry, MemoryService, SearchRequest, SearchResponse};
53
54#[cfg(any(feature = "database-memory", feature = "mongodb-memory", feature = "neo4j-memory"))]
55pub use embedding::EmbeddingProvider;
56#[cfg(feature = "mongodb-memory")]
57pub use mongodb::MongoMemoryService;
58#[cfg(feature = "neo4j-memory")]
59pub use neo4j::Neo4jMemoryService;
60#[cfg(feature = "database-memory")]
61pub use postgres::{PostgresMemoryService, PostgresMemoryServiceBuilder, VectorIndexType};
62#[cfg(feature = "redis-memory")]
63pub use redis::{RedisMemoryConfig, RedisMemoryService};
64#[cfg(feature = "sqlite-memory")]
65pub use sqlite::SqliteMemoryService;