| Crates.io | adk-memory |
| lib.rs | adk-memory |
| version | 0.2.1 |
| created_at | 2025-11-30 14:08:00.121049+00 |
| updated_at | 2026-01-22 03:38:26.98209+00 |
| description | Semantic memory and search for Rust Agent Development Kit (ADK-Rust) agents |
| homepage | |
| repository | https://github.com/zavora-ai/adk-rust |
| max_upload_size | |
| id | 1958256 |
| size | 36,151 |
Semantic memory and search for Rust Agent Development Kit (ADK-Rust) agents.
adk-memory provides long-term memory capabilities for the Rust Agent Development Kit (ADK-Rust):
[dependencies]
adk-memory = "0.2.0"
Or use the meta-crate:
[dependencies]
adk-rust = { version = "0.2.1", features = ["memory"] }
use adk_memory::{InMemoryMemoryService, MemoryService, MemoryEntry, SearchRequest};
use adk_core::Content;
use chrono::Utc;
// Create memory service
let service = InMemoryMemoryService::new();
// Add memories from a session
let entries = vec![
MemoryEntry {
content: Content::new("user").with_text("User prefers dark mode"),
author: "system".to_string(),
timestamp: Utc::now(),
},
];
service.add_session(
"my_app",
"user_123",
"session_456",
entries,
).await?;
// Search memories
let response = service.search(SearchRequest {
query: "what theme does the user like?".to_string(),
user_id: "user_123".to_string(),
app_name: "my_app".to_string(),
}).await?;
for memory in response.memories {
println!("Found: {:?}", memory.content);
}
pub struct MemoryEntry {
pub content: Content, // Message content with parts
pub author: String, // Who created this memory
pub timestamp: DateTime<Utc>, // When it was created
}
#[async_trait]
pub trait MemoryService: Send + Sync {
async fn add_session(
&self,
app_name: &str,
user_id: &str,
session_id: &str,
entries: Vec<MemoryEntry>,
) -> Result<()>;
async fn search(&self, req: SearchRequest) -> Result<SearchResponse>;
}
Memory traitApache-2.0
This crate is part of the ADK-Rust framework for building AI agents in Rust.