adk-runner 0.1.8

Agent execution runtime for Rust Agent Development Kit (ADK-Rust) agents
Documentation

adk-runner

Agent execution runtime for Rust Agent Development Kit (ADK-Rust) agents.

Crates.io Documentation License

Overview

adk-runner provides the execution runtime for the Rust Agent Development Kit (ADK-Rust):

  • Runner - Manages agent execution with full context
  • Session Integration - Automatic session creation and state management
  • Memory Injection - Retrieves and injects relevant memories
  • Artifact Handling - Manages binary artifacts during execution
  • Event Streaming - Streams agent events with backpressure

Installation

[dependencies]
adk-runner = "0.1.8"

Or use the meta-crate:

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

Quick Start

use adk_runner::{Runner, RunnerConfig};
use adk_session::InMemorySessionService;
use adk_artifact::InMemoryArtifactService;
use std::sync::Arc;

// Create services
let sessions = Arc::new(InMemorySessionService::new());
let artifacts = Arc::new(InMemoryArtifactService::new());

// Configure runner
let config = RunnerConfig {
    app_name: "my_app".to_string(),
    session_service: sessions,
    artifact_service: Some(artifacts),
    memory_service: None,
};

// Create runner
let runner = Runner::new(config);

// Run agent
let mut stream = runner.run(
    agent,
    "user_123",
    Some("session_456"),
    Content::text("Hello!"),
).await?;

// Process events
while let Some(event) = stream.next().await {
    // Handle event...
}

Runner vs Direct Agent Execution

Feature Direct agent.run() Runner
Session management Manual Automatic
Memory injection Manual Automatic
Artifact storage Manual Automatic
State persistence Manual Automatic

Use Runner for production; direct execution for testing.

Features

  • Automatic context creation
  • Session restore and persistence
  • Configurable memory retrieval
  • Event history management
  • Concurrent-safe execution

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.