adk-memory 0.1.8

Semantic memory and search for Rust Agent Development Kit (ADK-Rust) agents
Documentation

adk-memory

Semantic memory and search for Rust Agent Development Kit (ADK-Rust) agents.

Crates.io Documentation License

Overview

adk-memory provides long-term memory capabilities for the Rust Agent Development Kit (ADK-Rust):

  • InMemoryMemoryService - Simple in-memory memory storage
  • Semantic Search - Query memories by content similarity
  • Memory Entries - Structured memory with metadata
  • Automatic Injection - Memory context added to agent prompts

Installation

[dependencies]
adk-memory = "0.1.8"

Or use the meta-crate:

[dependencies]
adk-rust = { version = "0.1.8", features = ["memory"] }

Quick Start

use adk_memory::InMemoryMemoryService;
use adk_core::MemoryEntry;

// Create memory service
let service = InMemoryMemoryService::new();

// Add a memory
service.add_memory(
    "app_name",
    "user_123",
    MemoryEntry {
        content: "User prefers dark mode".to_string(),
        metadata: Default::default(),
        timestamp: Utc::now(),
    },
).await?;

// Search memories
let results = service.search_memory(
    "app_name",
    "user_123",
    "what theme does the user like?",
    5, // top_k
).await?;

Memory in Agents

Memory is automatically searched when configured:

let agent = LlmAgentBuilder::new("assistant")
    .model(Arc::new(model))
    .include_memory(5) // Include top 5 relevant memories
    .build()?;

The runner automatically injects relevant memories into the agent's context.

Memory Entry Structure

pub struct MemoryEntry {
    pub content: String,
    pub metadata: HashMap<String, String>,
    pub timestamp: DateTime<Utc>,
}

Features

  • Per-user memory isolation
  • Metadata filtering
  • Timestamp-based ordering
  • Pluggable storage backends

Related Crates

License

Apache-2.0

Part of ADK-Rust

This crate is part of the ADK-Rust framework for building AI agents in Rust.