| Crates.io | adk-runner |
| lib.rs | adk-runner |
| version | 0.2.1 |
| created_at | 2025-11-30 14:25:58.285561+00 |
| updated_at | 2026-01-22 03:39:59.445431+00 |
| description | Agent execution runtime for Rust Agent Development Kit (ADK-Rust) agents |
| homepage | |
| repository | https://github.com/zavora-ai/adk-rust |
| max_upload_size | |
| id | 1958278 |
| size | 79,855 |
Agent execution runtime for ADK-Rust.
adk-runner provides the execution runtime for ADK-Rust:
[dependencies]
adk-runner = "0.1"
Or use the meta-crate:
[dependencies]
adk-rust = { version = "0.1", features = ["runner"] }
use adk_runner::{Runner, RunnerConfig};
use adk_session::InMemorySessionService;
use adk_artifact::InMemoryArtifactService;
use adk_core::Content;
use std::sync::Arc;
// Create services
let sessions = Arc::new(InMemorySessionService::new());
let artifacts = Arc::new(InMemoryArtifactService::new());
// Configure runner with agent
let config = RunnerConfig {
app_name: "my_app".to_string(),
agent: my_agent, // Arc<dyn Agent>
session_service: sessions,
artifact_service: Some(artifacts),
memory_service: None,
run_config: None, // Uses default SSE streaming
};
// Create runner
let runner = Runner::new(config)?;
// Run agent for a user/session
let mut stream = runner.run(
"user_123".to_string(),
"session_456".to_string(),
Content::new("user").with_text("Hello!"),
).await?;
// Process events
use futures::StreamExt;
while let Some(event) = stream.next().await {
match event {
Ok(e) => println!("Event: {:?}", e.content()),
Err(e) => eprintln!("Error: {}", e),
}
}
| Field | Type | Description |
|---|---|---|
app_name |
String |
Application identifier |
agent |
Arc<dyn Agent> |
Root agent to execute |
session_service |
Arc<dyn SessionService> |
Session storage backend |
artifact_service |
Option<Arc<dyn ArtifactService>> |
Optional artifact storage |
memory_service |
Option<Arc<dyn Memory>> |
Optional memory/RAG service |
run_config |
Option<RunConfig> |
Streaming mode config |
| Feature | Direct agent.run() |
Runner |
|---|---|---|
| Session management | Manual | Automatic |
| Memory injection | Manual | Automatic |
| Artifact storage | Manual | Automatic |
| State persistence | Manual | Automatic |
| Agent transfers | Manual | Automatic |
| Event history | Manual | Automatic |
Use Runner for production; direct execution for testing.
Runner automatically handles agent-to-agent transfers:
// When an agent sets transfer_to_agent in EventActions,
// Runner automatically:
// 1. Finds the target agent in the agent tree
// 2. Creates a new invocation context
// 3. Preserves session state across the transfer
// 4. Continues streaming events from the new agent
Runner applies state changes immediately:
// When an agent emits an event with state_delta,
// Runner applies it to the mutable session so
// downstream agents can read the updated state.
Apache-2.0
This crate is part of the ADK-Rust framework for building AI agents in Rust.