ADK-Rust
July 17, 2026 ยท View on GitHub
๐ v1.0.0 Released! First stable release โ 39 crates, 130K+ downloads in 6 months, semver stability commitment, all former Beta crates promoted to Stable. Plus:
adk-benchbenchmarking framework (4.6ร faster cold start vs Python), authoritativeROADMAP.md, and security hardening. See CHANGELOG for full details.Contributors: Many thanks to @mikefaille โ AdkIdentity design, realtime audio, LiveKit bridge, skill system. @rohan-panickar โ OpenAI-compatible providers, xAI, multimodal content. @dhruv-pant โ Gemini service account auth. @tomtom215 โ A2A Protocol v1.0.0 types crate (a2a-protocol-types), Foundation-verified wire types powering our A2A v1 layer. @danielsan โ Google deps issue & PR (#181, #203), RAG crash report (#205). @CodingFlow โ Gemini 3 thinking level, global endpoint, citationSources (#177, #178, #179). @ctylx โ skill discovery fix (#204). @poborin โ project config proposal (#176). @chillin-capybara โ ACP integration, adk-acp crate. @baotao2006 โ UTF-8 boundary audit, CJK search/skill/eval fixes (#349, #357). Get started โ
Announcements: ADK-Rust Roadmap launched for 2026, we welcome suggestions, comments and ideas. ADK Playground launched! You can now run 70+ ADK-Rust AI Agents online for free. Compile and click. No login, no install. https://playground.adk-rust.com And many more discussions, feel free to discuss:
๐ฌ Rust & Beyond Podcast โ Episode 2: v1.0.0 Launch
ADK-Rust v1.0.0 โ The Stable Foundation. A deep-dive into what shipped, who built it, and where it's going. 39 crates. 130K downloads. Semver stable. The vision for composable autonomous agents in Rust.
โถ๏ธ Watch on YouTube โ 10 min 12 sec ยท Hosts: James (Fenrir) & Ada (Kore) ยท Video with slides
"We believe the next generation of software will be built by composing autonomous agents, not by writing every line of logic by hand. And we believe Rust is the right language for the runtime those agents live in." โ James, in the episode
Episode highlights
- The Numbers โ 130K+ organic downloads, 39 crates, 60+ examples, 4.6ร faster than Python ADK
- What Stable Means โ Semver contract, every public API locked, migration guides for major bumps
- What's New โ Gemini Interactions API, Managed Agent Runtime, lock poison recovery, security hardening
- Contributor Tribute โ Naming every contributor and what they built
- The Vision โ Playground โ Marketplace, Managed Runtime โ Hosting Platform, Protocol โ Cross-org Standard
- Roadmap โ Spatial agents, deeper MCP, AP2 payments, always faster
Previous episodes
๐ง Episode 1: What is ADK-Rust?
2 min 21 sec ยท Generated entirely by ADK-Rust using Gemini 3.1 Flash TTS
How are these made?
Episodes are generated using ADK-Rust's own audio capabilities โ Chirp3-HD multi-speaker TTS synthesis via adk-audio. The script, slide deck (Marp), and synthesized audio segments are concatenated with ffmpeg into a video presentation. Zero manual voice recording.
# Episode 2 assets
docs/podcast/episode-2-v1-launch-script.md # Full script
docs/podcast/episode-2-slides.md # Marp slide deck
docs/podcast/adk-rust-episode-2.mp4 # Final video
docs/podcast/adk-rust-episode-2.wav # Audio-only
ADK-Rust is a production-ready Rust framework for building AI agents enabling you to create powerful and high-performance AI agent systems with a flexible, modular architecture. Model-agnostic. Type-safe. Async.
cargo install cargo-adk
cargo adk new my-agent
cd my-agent && cargo run
Or pick a template: --template tools | rag | api | openai | a2a | graph | realtime | sequential | parallel | loop. Combine with addons: --addon telemetry | auth | sessions | memory | mcp | guardrails | eval | browser | server. Run cargo adk templates and cargo adk addons for the full list, and see Quick Start for details.
Overview
ADK-Rust provides a comprehensive framework for building AI agents in Rust, featuring:
- Composable Template System: 12 templates, 9 add-ons, and 5 enterprise patterns via
cargo adk new --addonfor rapid project scaffolding cargo adk build: Compile and verify your agent project without deploying โ fast feedback loop for CI and local development- Type-safe agent abstractions with async execution and event streaming
- Multiple agent types: LLM agents, workflow agents (sequential, parallel, loop), and custom agents
- Realtime voice agents: Bidirectional audio streaming with OpenAI Realtime API and Gemini Live API
- Tool ecosystem: Typed Rust tools, hosted-provider tools, toolset composition, and MCP clients and servers with tools, resources, prompts, completion, subscriptions, elicitation, tasks, and dynamic local-server management
- Provider-aware schema normalization: MCP tools work across all providers โ schemas normalized per-provider at request time
- RAG pipeline: Document chunking, vector embeddings, semantic search with 6 vector store backends
- Security: Role-based access control, declarative scope-based tool security, SSO/OAuth, audit logging
- Agentic commerce: ACP and AP2 payment orchestration with durable transaction journals and evidence-backed recall
- Agentic Web Protocol (AWP): Make websites agent-native with discovery, capability manifests, trust levels, rate limiting, consent, and health monitoring
- Production features: Session management, artifact storage, memory systems with project-scoped isolation, REST/A2A APIs
- Developer experience: Interactive CLI, 75+ in-repo examples (120+ in the playground), comprehensive documentation
Status: Production-ready, actively maintained
Architecture

ADK-Rust follows a clean layered architecture from application interface down to foundational services.
Key Features
Agent Types
LLM Agents: Powered by large language models with tool use, function calling, and streaming responses.
Workflow Agents: Deterministic orchestration patterns.
SequentialAgent: Execute agents in sequenceParallelAgent: Execute agents concurrently, with optionalSharedStatefor cross-agent coordinationLoopAgent: Iterative execution with exit conditions
Custom Agents: Implement the Agent trait for specialized behavior.
Realtime Voice Agents: Build voice-enabled AI assistants with bidirectional audio streaming.
Graph Agents: LangGraph-style workflow orchestration with state management and checkpointing.
Multi-Provider Support
ADK supports multiple LLM providers with a unified API:
| Provider | Model Examples | Feature Flag |
|---|---|---|
| Gemini | gemini-2.5-flash, gemini-2.5-pro, gemini-3-flash-preview, gemini-3.1-flash-lite-preview, gemini-3.1-pro-preview | (default) |
| OpenAI | gpt-5, gpt-5-mini, gpt-5-nano | openai |
| OpenAI Responses API | gpt-4.1, o3, o4-mini | openai |
| Anthropic | claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5 | anthropic |
| DeepSeek | deepseek-chat, deepseek-reasoner | deepseek |
| Groq | meta-llama/llama-4-scout-17b-16e-instruct, llama-3.3-70b-versatile | groq |
| Ollama | qwen3.6:35b-a3b, qwen3.5, llama3.2:3b | ollama |
| Fireworks AI | accounts/fireworks/models/llama-v3p1-8b-instruct | openai (preset) |
| Together AI | meta-llama/Llama-3.3-70B-Instruct-Turbo | openai (preset) |
| Mistral AI | mistral-small-latest | openai (preset) |
| Perplexity | sonar | openai (preset) |
| Cerebras | llama-3.3-70b | openai (preset) |
| SambaNova | Meta-Llama-3.3-70B-Instruct | openai (preset) |
| xAI (Grok) | grok-3-mini | openai (preset) |
| Amazon Bedrock | anthropic.claude-sonnet-4-20250514-v1:0 | bedrock |
| Azure AI Inference | (endpoint-specific) | azure-ai |
| mistral.rs | Gemma 4, Phi-3, Llama, Qwen 3.5, Voxtral, FLUX | adk-mistralrs |
All providers support streaming, function calling, and multimodal inputs (where available).
Tool System
Define tools with zero boilerplate using the #[tool] macro:
use adk_tool::{tool, AdkError};
use schemars::JsonSchema;
use serde::Deserialize;
use serde_json::{json, Value};
#[derive(Deserialize, JsonSchema)]
struct WeatherArgs {
/// The city to look up
city: String,
}
/// Get the current weather for a city.
#[tool]
async fn get_weather(args: WeatherArgs) -> std::result::Result<Value, AdkError> {
Ok(json!({ "temp": 72, "city": args.city }))
}
// Use it: agent_builder.tool(Arc::new(GetWeather))
The macro reads the doc comment as the description, derives the JSON schema from the args type, and generates a Tool impl. No manual schema writing, no boilerplate.
Built-in tools:
#[tool]macro (zero-boilerplate custom tools)- Function tools (custom Rust functions)
- Google Search
- Artifact loading
- Loop termination
MCP Integration: Connect agents to MCP tools, resources, prompts, completion,
subscriptions, elicitation, and negotiated long-running tasks through the
official rmcp 2.2 SDK. Use the dynamic local-server registry to add, update,
enable, disable, persist, monitor, and restart stdio servers while an application
is running. See the MCP guide.
Production Features
- Session Management: In-memory and SQLite-backed sessions with state persistence, encrypted sessions with AES-256-GCM and key rotation
- Memory System: Long-term memory with semantic search, vector embeddings, project-scoped isolation, and a bi-temporal knowledge-graph backend (
GraphMemoryService) with agent-callableremember/relatetools - Servers: REST API with SSE streaming, A2A v1.0.0 protocol for agent-to-agent communication
- A2A Quick Start:
A2aServer::quick_start(agent)โ expose any agent via A2A in one line. Or usecargo adk new --template a2a-serverto scaffold a complete project. - Guardrails: PII redaction, content filtering, JSON schema validation
- Tool Authorization: Human-in-the-loop confirmation, before-tool callbacks, RBAC, graph interrupts
- Payments: ACP and AP2 commerce support through
adk-payments - Coding-agent interoperability: Use external ACP coding agents as tools or expose an ADK-Rust agent to an editor through stable ACP v1
- Observability: OpenTelemetry tracing, structured logging
Core Crates
| Crate | Purpose | Key Features |
|---|---|---|
adk-core | Foundational traits and types | Agent trait, Content, Part, error types, streaming primitives |
adk-agent | Agent implementations | LlmAgent, SequentialAgent, ParallelAgent, LoopAgent, builder patterns |
adk-skill | AgentSkills parsing and selection | Skill markdown parser, .skills discovery/indexing, lexical matching, prompt injection helpers |
adk-model | LLM integrations | Gemini, OpenAI, Anthropic, DeepSeek, Groq, Ollama, Bedrock, Azure AI + OpenAI-compatible presets (Fireworks, Together, Mistral, Perplexity, Cerebras, SambaNova, xAI) |
adk-gemini | Gemini client | Google Gemini API client with streaming and multimodal support |
adk-anthropic | Anthropic client | Dedicated Anthropic API client with streaming, thinking, caching, citations, vision, PDF, pricing |
adk-mistralrs | Native local inference | mistral.rs v0.8 โ Gemma 4, Qwen 3.5, Voxtral, ISQ/MXFP4 quantization, LoRA adapters |
adk-tool | Tool system and extensibility | Typed Rust tools, provider-native tools, composable toolsets, MCP clients and server SDK, dynamic local-server management |
adk-devtools | Coding-agent dev tools | read_file/write_file/edit_file/glob/grep/bash as a DevToolset, scoped to a sandboxed Workspace |
adk-session | Session and state management | SQLite/in-memory backends, conversation history, state persistence |
adk-artifact | Artifact storage system | File-based storage, MIME type handling, image/PDF/video support |
adk-memory | Long-term memory | Vector embeddings, semantic search, project-scoped isolation, bi-temporal knowledge graph (GraphMemoryService), 6 backends |
adk-payments | Agentic commerce orchestration | ACP/AP2 adapters, canonical transaction kernel, durable journals, evidence-backed payment flows |
awp-types | AWP protocol types | Trust levels, requester types, discovery documents, capability manifests, payment intents, typed A2A messages โ zero adk-* deps |
adk-awp | Agentic Web Protocol implementation | Business context loading, discovery/manifest generation, rate limiting, consent, events, health state machine, AWP routes |
adk-acp | Agent Client Protocol integration | Official stable v1 client and server, one-shot and persistent sessions, streaming, cancellation, async permissions, client files and terminals, per-session MCP, and editor-facing ADK agents |
adk-rag | RAG pipeline | Document chunking, embeddings, vector search, reranking, 6 backends |
adk-runner | Agent execution runtime | Context management, event streaming, session lifecycle, callbacks |
adk-server | Production API servers | REST API, A2A v1.0.0 protocol (all 11 operations), middleware, health checks |
adk-cli | Command-line interface | Interactive REPL, session management, MCP server integration |
adk-realtime | Real-time voice & multimodal agents | OpenAI Realtime + Gemini Live, bidirectional audio, video frames, VAD, affective dialogue, server-side tools via IntegratedRealtimeRunner |
adk-graph | Graph-based workflows | LangGraph-style orchestration, state management, checkpointing, human-in-the-loop |
adk-browser | Browser automation | 46 WebDriver tools, navigation, forms, screenshots, PDF generation |
adk-computer-use | Governed desktop automation | Deterministic graph over computer-use-mcp: parallel observation, digest-bound approval interrupts, single-executor mutation, verification; wire contracts + tamper-evident evaluation receipts |
adk-eval | Agent evaluation | Test definitions, trajectory validation, LLM-judged scoring, rubrics |
adk-guardrail | Input/output validation | PII redaction, content filtering, JSON schema validation |
adk-auth | Access control | Role-based permissions, declarative scope-based security, SSO/OAuth, audit logging |
adk-sandbox | Sandboxed code execution | Process/WASM backends, OS-level sandbox profiles (Seatbelt, bubblewrap, AppContainer) |
adk-telemetry | Observability | Structured logging, OpenTelemetry tracing, span helpers |
adk-managed | Managed agent runtime (Experimental) | Provider-neutral durable agent execution, checkpointing, event replay |
adk-enterprise | Enterprise client SDK (Experimental) | HTTP/SSE client for managed agent service, zero runtime deps |
Extracted to standalone repos: adk-ui (dynamic UI generation), adk-studio (visual agent builder), adk-playground (120+ examples).
Quick Start
Scaffold a project (recommended)
cargo install cargo-adk
cargo adk new my-agent # basic Gemini agent
cargo adk new my-agent --template tools # agent with #[tool] custom tools
cargo adk new my-agent --template rag # RAG with vector search
cargo adk new my-agent --template api # REST server
cargo adk new my-agent --template openai # OpenAI-powered agent
cargo adk new my-agent --template a2a # A2A protocol agent
cargo adk new my-agent --template graph # graph workflow agent
cargo adk new my-agent --template realtime # realtime voice agent
cargo adk new my-agent --template sequential # sequential multi-agent pipeline
# Compose with addons
cargo adk new my-agent --template tools --addon telemetry --addon sessions
cargo adk new my-agent --addon mcp --addon guardrails
cd my-agent
cp .env.example .env # add your API key
cargo run
Use cargo adk build to verify compilation without deploying.
Manual installation
Requires Rust 1.94 or later (Rust 2024 edition). Add to your Cargo.toml:
[dependencies]
adk-rust = "2.0.0" # Minimal (default): Gemini + agent runtime + sessions
# Need server, auth, graph workflows, eval?
# adk-rust = { version = "2.0.0", features = ["standard"] }
# Need everything (realtime, browser, RAG, payments, AWP)?
# adk-rust = { version = "2.0.0", features = ["enterprise"] }
Feature tiers:
| Tier | Includes | Use case |
|---|---|---|
minimal (default) | Gemini provider, agents, runner, sessions | Fast starter agents |
standard | minimal + OpenAI, Anthropic, tools, memory, telemetry, server, auth, graph, eval, guardrail, plugins, artifacts, skills | Production deployment |
enterprise | standard + realtime, browser, RAG, payments, AWP | Full-featured production |
full | enterprise + audio, code execution, sandbox | Everything |
Upgrading from 0.7.x? The default changed to a true minimal Gemini starter tier. Add only the feature set you use, such as
features = ["openai"],features = ["standard"], orfeatures = ["standard", "cli-openai"].
Set your API key:
# For Gemini (default)
export GOOGLE_API_KEY="your-api-key"
# For OpenAI
export OPENAI_API_KEY="your-api-key"
# For Anthropic
export ANTHROPIC_API_KEY="your-api-key"
# For DeepSeek
export DEEPSEEK_API_KEY="your-api-key"
# For Groq
export GROQ_API_KEY="your-api-key"
# For Fireworks AI
export FIREWORKS_API_KEY="your-api-key"
# For Together AI
export TOGETHER_API_KEY="your-api-key"
# For Mistral AI
export MISTRAL_API_KEY="your-api-key"
# For Perplexity
export PERPLEXITY_API_KEY="your-api-key"
# For Cerebras
export CEREBRAS_API_KEY="your-api-key"
# For SambaNova
export SAMBANOVA_API_KEY="your-api-key"
# For Azure AI Inference
export AZURE_AI_API_KEY="your-api-key"
# For Amazon Bedrock (uses AWS IAM credentials)
# Configure via: aws configure
# For Ollama (no key, just run: ollama serve)
Fastest Start โ adk::run()
The simplest way to run an agent is one function call. The default minimal build uses Gemini; provider auto-detection widens when you compile additional provider features.
use adk_rust::run;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
dotenvy::dotenv().ok();
// Minimal default: set GOOGLE_API_KEY.
let response = run("You are a helpful assistant.", "What is 2 + 2?").await?;
println!("{response}");
Ok(())
}
provider_from_env() checks only compiled providers. With features = ["openai", "anthropic"], the order is ANTHROPIC_API_KEY โ OPENAI_API_KEY โ GOOGLE_API_KEY.
Basic Example (Gemini)
use adk_rust::prelude::*;
use adk_rust::Launcher;
#[tokio::main]
async fn main() -> AnyhowResult<()> {
dotenvy::dotenv().ok();
let api_key = std::env::var("GOOGLE_API_KEY")?;
let model = GeminiModel::new(&api_key, "gemini-2.5-flash")?;
let agent = LlmAgentBuilder::new("assistant")
.description("Helpful AI assistant")
.instruction("You are a helpful assistant. Be concise and accurate.")
.model(Arc::new(model))
.build()?;
Launcher::new(Arc::new(agent)).run().await?;
Ok(())
}
OpenAI Example
Enable OpenAI with adk-rust = { version = "2.0.0", features = ["openai"] }.
use adk_rust::prelude::*;
use adk_rust::Launcher;
#[tokio::main]
async fn main() -> AnyhowResult<()> {
dotenvy::dotenv().ok();
let api_key = std::env::var("OPENAI_API_KEY")?;
let model = OpenAIClient::new(OpenAIConfig::new(api_key, "gpt-5-mini"))?;
let agent = LlmAgentBuilder::new("assistant")
.instruction("You are a helpful assistant.")
.model(Arc::new(model))
.build()?;
Launcher::new(Arc::new(agent)).run().await?;
Ok(())
}
OpenAI Responses API Example
Uses the /v1/responses endpoint โ recommended for reasoning models (o3, o4-mini) and built-in tools:
use adk_rust::prelude::*;
use adk_rust::Launcher;
use adk_model::openai::{OpenAIResponsesClient, OpenAIResponsesConfig};
#[tokio::main]
async fn main() -> AnyhowResult<()> {
dotenvy::dotenv().ok();
let api_key = std::env::var("OPENAI_API_KEY")?;
let config = OpenAIResponsesConfig::new(api_key, "gpt-4.1-mini");
let model = OpenAIResponsesClient::new(config)?;
let agent = LlmAgentBuilder::new("assistant")
.instruction("You are a helpful assistant.")
.model(Arc::new(model))
.build()?;
Launcher::new(Arc::new(agent)).run().await?;
Ok(())
}
Anthropic Example
Enable Anthropic with adk-rust = { version = "2.0.0", features = ["anthropic"] }.
use adk_rust::prelude::*;
use adk_rust::Launcher;
#[tokio::main]
async fn main() -> AnyhowResult<()> {
dotenvy::dotenv().ok();
let api_key = std::env::var("ANTHROPIC_API_KEY")?;
let model = AnthropicClient::new(AnthropicConfig::new(api_key, "claude-sonnet-4-6"))?;
let agent = LlmAgentBuilder::new("assistant")
.instruction("You are a helpful assistant.")
.model(Arc::new(model))
.build()?;
Launcher::new(Arc::new(agent)).run().await?;
Ok(())
}
DeepSeek Example
Enable DeepSeek with adk-rust = { version = "2.0.0", features = ["deepseek"] }.
use adk_rust::prelude::*;
use adk_rust::Launcher;
#[tokio::main]
async fn main() -> AnyhowResult<()> {
dotenvy::dotenv().ok();
let api_key = std::env::var("DEEPSEEK_API_KEY")?;
// Standard chat model
let model = DeepSeekClient::chat(api_key)?;
// Or use reasoner for chain-of-thought reasoning
// let model = DeepSeekClient::reasoner(api_key)?;
let agent = LlmAgentBuilder::new("assistant")
.instruction("You are a helpful assistant.")
.model(Arc::new(model))
.build()?;
Launcher::new(Arc::new(agent)).run().await?;
Ok(())
}
Groq Example (Ultra-Fast)
Enable Groq with adk-rust = { version = "2.0.0", features = ["groq"] }.
use adk_rust::prelude::*;
use adk_rust::Launcher;
#[tokio::main]
async fn main() -> AnyhowResult<()> {
dotenvy::dotenv().ok();
let api_key = std::env::var("GROQ_API_KEY")?;
let model = GroqClient::new(GroqConfig::llama70b(api_key))?;
let agent = LlmAgentBuilder::new("assistant")
.instruction("You are a helpful assistant.")
.model(Arc::new(model))
.build()?;
Launcher::new(Arc::new(agent)).run().await?;
Ok(())
}
Ollama Example (Local)
Enable Ollama with adk-rust = { version = "2.0.0", features = ["ollama"] }.
use adk_rust::prelude::*;
use adk_rust::Launcher;
#[tokio::main]
async fn main() -> AnyhowResult<()> {
dotenvy::dotenv().ok();
// Requires: ollama serve && ollama pull llama3.2
let model = OllamaModel::new(OllamaConfig::new("llama3.2"))?;
let agent = LlmAgentBuilder::new("assistant")
.instruction("You are a helpful assistant.")
.model(Arc::new(model))
.build()?;
Launcher::new(Arc::new(agent)).run().await?;
Ok(())
}
Examples
Examples live in the dedicated adk-playground repo (120+ examples covering every feature and provider). The examples documented in this repository are validated by scripts/check-doc-examples.sh, scripts/check-cargo-adk-templates.sh, and workspace example builds.
Companion Projects
| Project | Description |
|---|---|
| adk-studio | Visual agent builder โ drag-and-drop canvas, code generation, live testing |
| adk-ui | Dynamic UI generation โ 28 components, React client, streaming updates |
| adk-playground | 120+ working examples for every feature and provider |
Advanced Features
Coding Agent
A native coding agent: read/edit/run code in a sandboxed workspace, plan with todos, iterate toward a goal autonomously, and orchestrate parallel reviewers โ on any provider. Build one in a single call:
use adk_agent::coding::CodingAgent;
use adk_devtools::Workspace;
let coding = CodingAgent::builder()
.model(model)
.workspace(Workspace::new("./my-repo"))
.build()?;
// coding.agent() -> Arc<dyn Agent> for a Runner; coding.todos() surfaces the plan
Or use the native CLI commands:
adk-rust code "make the failing test pass" # one-shot task
adk-rust goal "all tests green" --until "cargo test" --resume # autonomous, durable goal mode
adk-rust ultracode "add input validation" # parallel ultra-review
codeโ one-shot tasks in a sandboxed dir (adk-devtools: read/write/edit/glob/grep/bash).goalโ Codex/Hermes-style autonomous loop (plan โ act โ verify against a--untilcommand), durable & resumable via an on-disk checkpoint.ultracodeโ Claude Code-style fan-out to parallel correctness/edge-case/style reviewers onadk-graph, revising until they approve.
Examples: coding_agent, coding_graph,
coding_goal. Full guide:
docs/official_docs/coding-agent.
Realtime Voice Agents
Build voice-enabled AI assistants using the adk-realtime crate:
use adk_realtime::{RealtimeAgent, openai::OpenAIRealtimeModel, RealtimeModel};
use std::sync::Arc;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api_key = std::env::var("OPENAI_API_KEY")?;
let model: Arc<dyn RealtimeModel> = Arc::new(
OpenAIRealtimeModel::new(&api_key, "gpt-realtime")
);
let agent = RealtimeAgent::builder("voice_assistant")
.model(model)
.instruction("You are a helpful voice assistant.")
.voice("alloy")
.server_vad() // Enable voice activity detection
.build()?;
Ok(())
}
Supported Realtime Models:
| Provider | Model | Transport | Feature Flag |
|---|---|---|---|
| OpenAI | gpt-realtime | WebSocket | openai |
| OpenAI | gpt-realtime | WebRTC | openai-webrtc |
gemini-live-2.5-flash-native-audio | WebSocket | gemini | |
| Gemini via Vertex AI | WebSocket + OAuth2 | vertex-live | |
| LiveKit | Any (bridge to Gemini/OpenAI) | WebRTC | livekit |
Features:
- OpenAI Realtime API and Gemini Live API support
- Vertex AI Live with Application Default Credentials (ADC)
- LiveKit WebRTC bridge for production-grade audio routing
- OpenAI WebRTC transport with Opus codec and data channels
- Bidirectional audio streaming (PCM16, G711, Opus)
- Server-side Voice Activity Detection (VAD)
- Mid-session context mutation โ swap instructions and tools without dropping the call
- Real-time tool calling during voice conversations (server-side, via
IntegratedRealtimeRunner) - Multimodal video input โ stream camera frames to the model with
send_video_frame(Gemini continuous; OpenAI image items) - Affective dialogue โ tone-aware responses on Gemini native-audio models (
with_affective_dialog) - Multi-agent handoffs for complex workflows
- Zero-allocation LiveKit audio output path
Run validated realtime examples:
# OpenAI Realtime (WebSocket)
cargo run -p adk-realtime --example openai_session_update --features openai
# Vertex AI Live (requires gcloud auth application-default login)
cargo run -p adk-realtime --example vertex_live_voice --features vertex-live
cargo run -p adk-realtime --example vertex_live_tools --features vertex-live
# LiveKit Bridge (requires LiveKit server)
cargo run -p adk-realtime --example livekit_bridge --features livekit,openai
# OpenAI WebRTC (requires cmake)
cargo run -p adk-realtime --example openai_webrtc --features openai-webrtc
# Gemini Live context mutation
cargo run -p adk-realtime --example gemini_context_mutation --features gemini
Multimodal & web-UI example apps (standalone crates in examples/, OpenAI or Gemini, with system/light/dark themed UIs):
# Multimodal customer-service agent โ sees the camera, reads tone, runs refund/handoff tools
cargo run --manifest-path examples/customer_service/Cargo.toml # โ http://localhost:3066
# "Mindfulness with Mia" โ voice agent backed by a real knowledge graph
cargo run --manifest-path examples/realtime_voice/Cargo.toml # โ http://localhost:3033
# Live speech-to-speech translation (gpt-realtime-translate / Gemini Live Translate)
cargo run --manifest-path examples/live_translation/Cargo.toml # โ http://localhost:3055
# Headless function-calling smoke test over the GA realtime API
cargo run --manifest-path examples/realtime_tools/Cargo.toml -- probe openai
Agentic Web Protocol (AWP)
Make any website or service natively accessible to AI agents using the awp-types and adk-awp crates:
use adk_awp::{AwpState, BusinessContextLoader, awp_routes};
// Load business context from TOML
let loader = BusinessContextLoader::from_file("business.toml".as_ref())?;
// Build AWP state with sensible defaults (rate limiting, consent, health, events)
let state = AwpState::builder(loader.context_ref()).build();
// Merge AWP routes into your Axum app โ 7 endpoints, version negotiation included
let app = axum::Router::new()
.merge(awp_routes(state))
.merge(your_custom_routes);
AWP Endpoints:
GET /.well-known/awp.jsonโ Discovery document (entry point for agents)GET /awp/manifestโ JSON-LD capability manifestGET /awp/healthโ Health state (Healthy/Degrading/Degraded)POST /awp/events/subscribeโ Webhook subscriptions with HMAC-SHA256 signingPOST /awp/a2aโ Agent-to-agent message handling
Features: Trust levels (Anonymous/Known/Partner/Internal), per-trust-level rate limiting, consent management (in-memory or file-backed), health state machine with event emission, version negotiation, business context hot-reload.
Run the AWP example:
cd examples/awp_agent
cp .env.example .env # add your GOOGLE_API_KEY
cargo run
See AWP Documentation for the full guide.
Graph-Based Workflows
Build complex, stateful workflows using the adk-graph crate (LangGraph-style):
use adk_graph::{prelude::*, node::AgentNode};
use adk_agent::LlmAgentBuilder;
use adk_model::GeminiModel;
// Create LLM agents for different tasks
let translator = Arc::new(LlmAgentBuilder::new("translator")
.model(Arc::new(GeminiModel::new(&api_key, "gemini-2.5-flash")?))
.instruction("Translate the input text to French.")
.build()?);
let summarizer = Arc::new(LlmAgentBuilder::new("summarizer")
.model(model.clone())
.instruction("Summarize the input text in one sentence.")
.build()?);
// Create AgentNodes with custom input/output mappers
let translator_node = AgentNode::new(translator)
.with_input_mapper(|state| {
let text = state.get("input").and_then(|v| v.as_str()).unwrap_or("");
adk_core::Content::new("user").with_text(text)
})
.with_output_mapper(|events| {
let mut updates = HashMap::new();
for event in events {
if let Some(content) = event.content() {
let text: String = content.parts.iter()
.filter_map(|p| p.text())
.collect::<Vec<_>>()
.join("");
updates.insert("translation".to_string(), json!(text));
}
}
updates
});
// Build graph with parallel execution
let agent = GraphAgent::builder("text_processor")
.description("Translates and summarizes text in parallel")
.channels(&["input", "translation", "summary"])
.node(translator_node)
.node(summarizer_node) // Similar setup
.edge(START, "translator")
.edge(START, "summarizer") // Parallel execution
.edge("translator", "combine")
.edge("summarizer", "combine")
.edge("combine", END)
.build()?;
// Execute
let mut input = State::new();
input.insert("input".to_string(), json!("AI is transforming how we work."));
let result = agent.invoke(input, ExecutionConfig::new("thread-1")).await?;
Features:
- AgentNode: Wrap LLM agents as graph nodes with custom input/output mappers
- Parallel & Sequential: Execute agents concurrently or in sequence
- Cyclic Graphs: ReAct pattern with tool loops and iteration limiting
- Conditional Routing: Dynamic routing via
Router::by_fieldor custom functions - Checkpointing: Memory and SQLite backends for fault tolerance, durable resume from checkpoint after crash
- Human-in-the-Loop: Dynamic interrupts based on state, resume from checkpoint
- Streaming: Multiple modes (values, updates, messages, debug)
- Functional API: Write workflows as async functions with
#[entrypoint]/#[task]macros, automatic checkpointing, typed reducers - Background Runs & Cron: REST endpoints for async execution and time-based scheduling
Run validated graph examples:
cargo run --manifest-path examples/tier_examples/standard/Cargo.toml --bin 11-standard-graph
cargo run --manifest-path examples/tier_examples/standard/Cargo.toml --bin 12-standard-sequential
cargo run --manifest-path examples/competitive_graph_resume/Cargo.toml
Browser Automation
Give agents web browsing capabilities using the adk-browser crate:
use adk_browser::{BrowserSession, BrowserToolset, BrowserConfig};
// Create browser session
let config = BrowserConfig::new().webdriver_url("http://localhost:4444");
let session = Arc::new(BrowserSession::new(config));
// Get all 46 browser tools
let toolset = BrowserToolset::new(session);
let tools = toolset.all_tools();
// Add to agent
let mut builder = LlmAgentBuilder::new("web_agent")
.model(model)
.instruction("Browse the web and extract information.");
for tool in tools {
builder = builder.tool(tool);
}
let agent = builder.build()?;
46 Browser Tools:
- Navigation:
browser_navigate,browser_back,browser_forward,browser_refresh - Extraction:
browser_extract_text,browser_extract_links,browser_extract_html - Interaction:
browser_click,browser_type,browser_select,browser_submit - Forms:
browser_fill_form,browser_get_form_fields,browser_clear_field - Screenshots:
browser_screenshot,browser_screenshot_element - JavaScript:
browser_evaluate,browser_evaluate_async - Cookies, frames, windows, and more
Requirements: WebDriver (Selenium, ChromeDriver, etc.)
docker run -d -p 4444:4444 selenium/standalone-chrome
Agent Evaluation
Test and validate agent behavior using the adk-eval crate:
use adk_eval::{Evaluator, EvaluationConfig, EvaluationCriteria};
let config = EvaluationConfig::with_criteria(
EvaluationCriteria::exact_tools()
.with_response_similarity(0.8)
);
let evaluator = Evaluator::new(config);
let report = evaluator
.evaluate_file(agent, "tests/my_agent.test.json")
.await?;
assert!(report.all_passed());
Evaluation Capabilities:
- Trajectory validation (tool call sequences)
- Response similarity (Jaccard, Levenshtein, ROUGE)
- LLM-judged semantic matching
- Rubric-based scoring with custom criteria
- Safety and hallucination detection
- Detailed reporting with failure analysis
Local Inference with mistral.rs
For native local inference without external dependencies, use the adk-mistralrs crate (v0.8.0 โ Gemma 4, Qwen 3.5, Voxtral):
use adk_mistralrs::{MistralRsModel, MistralRsConfig, ModelSource, QuantizationLevel};
use adk_agent::LlmAgentBuilder;
use std::sync::Arc;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Run Gemma 4 locally with 4-bit quantization
let config = MistralRsConfig::builder()
.model_source(ModelSource::huggingface("google/gemma-4-4b-it"))
.isq(QuantizationLevel::Q4_0)
.paged_attention(true)
.build();
let model = MistralRsModel::new(config).await?;
let agent = LlmAgentBuilder::new("local-assistant")
.instruction("You are a helpful assistant running locally.")
.model(Arc::new(model))
.build()?;
Ok(())
}
adk-mistralrs is published to crates.io as a workspace member. GPU features are opt-in:
adk-mistralrs = { version = "2.0.0", features = ["metal"] } # macOS Apple Silicon
# Or: features = ["cuda"] for NVIDIA GPU
Features: Gemma 4 multimodal, ISQ/MXFP4 quantization, PagedAttention with prefix caching, multi-GPU splitting, LoRA/X-LoRA adapters, vision/speech/diffusion models, MCP integration.
Building from Source
Dev Environment Setup
# Option A: Nix/devenv (reproducible โ identical on Linux, macOS, CI)
devenv shell
# Option B: Setup script (installs sccache, cmake, etc.)
./scripts/setup-dev.sh
# Option C: Manual โ just install sccache for faster builds
brew install sccache && echo 'export RUSTC_WRAPPER=sccache' >> ~/.zshrc
Using Make (Recommended)
# See all available commands
make help
# Build all crates (CPU-only, works on all systems)
make build
# Build with all features
make build-all
# Build all examples
make examples
# Run tests
make test
# Run clippy lints
make clippy
Manual Build
# Build workspace (CPU-only)
cargo build --workspace
# Build with all features (works without CUDA)
cargo build --workspace --all-features
# Build all workspace examples
cargo check --workspace --examples
Local LLM with mistral.rs
adk-mistralrs is published to crates.io as a workspace member. GPU features (cuda, metal) are opt-in:
# Build with default features (CPU-only)
cargo build -p adk-mistralrs
# macOS with Apple Silicon (Metal GPU)
cargo build -p adk-mistralrs --features metal
# NVIDIA GPU (requires CUDA toolkit)
cargo build -p adk-mistralrs --features cuda
Use as Library
Add to your Cargo.toml:
[dependencies]
# Minimal (default) โ Gemini, agents, runner, sessions
adk-rust = "2.0.0"
# Add a provider explicitly when you need it
adk-rust = { version = "2.0.0", features = ["openai"] }
# Production tier without CLI provider fan-out
adk-rust = { version = "2.0.0", features = ["standard"] }
# Full โ enterprise plus audio, code execution, sandbox
adk-rust = { version = "2.0.0", features = ["full"] }
# Minimal โ just agents + Gemini + runner (fastest build)
adk-rust = { version = "2.0.0", default-features = false, features = ["minimal"] }
# Or individual crates for finer control
adk-core = "2.0.0"
adk-agent = "2.0.0"
adk-model = { version = "2.0.0", features = ["openai", "anthropic"] }
adk-tool = "2.0.0"
adk-runner = "2.0.0"
Examples
The workspace keeps core crate examples close to the crates that own them, and standalone adoption examples under examples/. The public gallery remains adk-playground.
Validated examples in this repo include:
cargo run -p adk-rust --example performance_0_8_llm_agents --features openrouterโ all 12 v0.8 optimization use cases with live LLM agents.cargo run --manifest-path examples/tier_examples/standard/Cargo.toml --bin 11-standard-graphโ standard-tier graph workflow.cargo run --manifest-path examples/openai_responses/Cargo.tomlโ OpenAI Responses API example.cargo run -p adk-realtime --example openai_session_update --features openaiโ OpenAI Realtime session mutation.cargo run -p adk-realtime --example vertex_live_voice --features vertex-liveโ Vertex AI Live voice session.cargo run --manifest-path examples/awp_agent/Cargo.tomlโ Agentic Web Protocol server example.
Development
Testing
# Run all tests
cargo test
# Test specific crate
cargo test --package adk-core
# With output
cargo test -- --nocapture
Code Quality
# Linting
cargo clippy
# Formatting
cargo fmt
# Security audit
cargo audit
Building
# Development build
cargo build
# Optimized release build
cargo build --release
Documentation
- Wiki: GitHub Wiki - Comprehensive guides and tutorials
- API Reference: docs.rs/adk-rust - Full API documentation
- Official ACP docs: Agent Client Protocol - Architecture, client/host APIs, ADK-Rust server, security boundaries, examples, and verified support
- Official MCP docs: Model Context Protocol - Architecture, client APIs, dynamic server management, server authoring, security, and deterministic verification
- Official payments docs: Payments and Commerce - ACP/AP2 support, agentic commerce journeys, and validation paths
- Examples: examples/README.md - 75+ working examples with detailed explanations
Performance
Framework Benchmark Results
Measured with cargo adk bench using real LLM API calls to gemini-2.5-flash. All frameworks execute the same workload (single tool call) with identical model and prompt.
| Framework | Cold Start | Agent Loop Overhead (mean) | Agent Loop Overhead (P95) | Peak RSS |
|---|---|---|---|---|
| ADK-Rust | 109 ms | 568 ฮผs | 615 ฮผs | ~15 MB |
| Gemini Python SDK | 501 ms | 253 ฮผs | 334 ฮผs | 69.7 MB |
| LangGraph | 502 ms | 1,228 ms | 1,228 ms | 92.7 MB |
Key takeaways:
- 4.6ร faster cold start than Python frameworks (Rust binary vs Python interpreter)
- Sub-millisecond framework overhead โ ADK-Rust adds ~568ฮผs per agent turn on top of LLM latency
- 4โ6ร lower memory than Python agent frameworks
Cold Start = process launch โ first LLM API call. Agent Loop Overhead = total turn time minus LLM round-trip (framework-only cost). Measured on Apple M-series, macOS, June 2026.
Running Benchmarks
# Quick dry-run to see cost estimate
cargo adk bench --dry-run
# Run all workloads (simple tool call, multi-step reasoning, parallel invocation)
cargo adk bench --max-cost-usd 5.00 --confirm-cost --runs 5
# Compare against Python frameworks
cargo adk bench --workload simple_tool_call --runs 3 --external-config adk-bench/harnesses/external-frameworks.json --format markdown --confirm-cost
# Save a baseline for CI regression detection
cargo adk bench --save-baseline --confirm-cost
# Check for regressions (exit code 2 if regressed)
cargo adk bench --check-regression --tolerance 0.10 --confirm-cost
Design Principles
- Real LLM API calls with deterministic config (temperature=0, fixed seed) for reproducibility
- Framework overhead isolated by subtracting observed LLM latency from total turn time
- Platform-specific RSS sampling (
/proc/self/statmon Linux,mach_task_basic_infoon macOS) - External Benchmark Protocol (EBP) for apples-to-apples competitor comparison via subprocess
- Configurable cost guards (
--dry-run,--max-cost-usd,--confirm-cost)
License
Apache 2.0 (same as Google's ADK)
Related Projects
- ADK - Google's Agent Development Kit
- MCP Protocol - Model Context Protocol for tool integration
- Gemini API - Google's multimodal AI model
Contributing
Contributions welcome! Please open an issue or pull request on GitHub.
Roadmap
v2.0.0 (current) โ production agent framework:
- Composable Template System โ 12 templates, 9 add-ons, 5 enterprise patterns via
cargo adk new --addon. - Cargo Adk Build โ compile-without-deploy subcommand for pre-deployment verification.
- A2A Simple Scaffolding โ
A2aServer::quick_start,A2aServer::builder, andcargo adk new --template a2a-server. - Security โ hickory-proto 0.26.1, openssl 0.10.80, rubato 3.0, similar 3.
v0.8.0 and earlier
v0.8.0 โ performance and adoption release:
- Dependency diet โ true minimal starter tier, rustls-only HTTP clients, opt-in CLI provider fan-out, OTLP telemetry split, MCP gated behind features, and Gemini backtraces behind debug-only feature gates.
- Runtime hot paths โ empty session state deltas avoid full state merges, runner history windows are configurable, trace payloads are truncated by default, parallel tools are bounded by
RunConfig::max_tool_concurrency, and context-cache network calls no longer hold the manager mutex. - Validated onboarding โ cargo-adk templates target 0.8.0 and CI now checks generated projects, example target names, and documented Cargo commands.
v0.7.0 and earlier
v0.7.0 โ OS sandbox profiles, ServerBuilder, project-scoped memory, Gemini 3.1 Flash-Lite:
- Project-Scoped Memory โ Optional
project_iddimension for memory isolation across all 6 backends (InMemory, SQLite, PostgreSQL, Redis, MongoDB, Neo4j). Global entries visible everywhere, project entries isolated.MemoryServiceAdapter::with_project_id(),Memory::search_in_project(),Memory::add_to_project(), GDPR-compliantdelete_useracross all projects. - OS Sandbox Profiles โ Platform-native sandbox enforcement (Seatbelt on macOS, bubblewrap on Linux, AppContainer on Windows).
- ServerBuilder API โ Custom Axum controllers alongside built-in routes with shared middleware. Graceful shutdown endpoint.
- MCP Server Lifecycle โ
McpServerManagerfor spawning, monitoring, and auto-restarting MCP server processes. - Agent Interruption โ
Runner::interrupt(session_id)for mid-execution cancellation. - Breaking โ
SearchRequestnow hasproject_idfield (addproject_id: Noneto struct literals).delete_entrieson InMemory now scopes to global entries only.
v0.6.0 and earlier
v0.6.0: A2A v1.0.0 compliance, ParallelAgent SharedState, tool authorization:
- A2A v1.0.0 Protocol Compliance โ 9 fixes: timestamps, capabilities, idempotency, push auth, multi-turn, validation, Content-Type, streaming first-event, context lookup. All 11 JSON-RPC operations. Wire types by @tomtom215.
- ParallelAgent SharedState โ
set_shared/get_shared/wait_for_keycoordination primitives for cross-agent state sharing. Enables parallel sub-agents to work on the same artifact. - Tool Authorization โ Documentation for
ToolConfirmationPolicy(HITL),BeforeToolCallback, RBAC, graph interrupts with CLI and web server examples. - Breaking โ
build_v1_agent_card()signature,TaskStore/PushNotificationSendertrait changes,message_streamreturn type,CallbackContext::shared_state()default method.
v0.5.0 and earlier
v0.5.0: Structured errors, OpenAI Responses API, OpenRouter, production hardening. AdkError redesign, typed Runner::run(), labs preset, provider_from_env(), encrypted sessions, graph durable resume, MCP resource API, Deepgram streaming STT.
v0.4.0: Framework focus & performance. Extracted UI/Studio/Playground to standalone repos. Tiered feature presets (minimal/standard/full). Consolidated 7 OpenAI-compatible providers. Vertex AI deps opt-in. cargo-adk scaffolding CLI. #[tool] proc macro. nextest CI. Multimodal vision for Bedrock/OpenAI/Anthropic.
v0.3.2: 8 new LLM providers, RAG pipeline, scope-based security, Models Discovery API, Gemini 3 support, generation config, Vertex AI Live, realtime audio transports, response parsing hardening.
v0.3.0: adk-gemini Vertex AI overhaul, context compaction, production hardening, ADK Studio debug mode, action nodes code generation, SSO/OAuth, plugin system.
v0.2.0: Core framework, multi-provider LLM, tool system with MCP, sessions, artifacts, memory, REST/A2A servers, CLI, realtime voice, graph workflows, browser automation, evaluation, guardrails.
Planned (see docs/roadmap/):
| Priority | Feature | Target | Status |
|---|---|---|---|
| ๐ด P0 | ADK-UI vNext (A2UI + Generative UI) | Q2-Q4 2026 | Planned |
| ๐ก P1 | Cloud Integrations | Q2-Q3 2026 | Planned |
| ๐ข P2 | Enterprise Features | Q4 2026 | Planned |