| Crates.io | adk-rust |
| lib.rs | adk-rust |
| version | 0.2.1 |
| created_at | 2025-11-30 14:55:28.153525+00 |
| updated_at | 2026-01-22 03:50:19.625155+00 |
| description | Rust Agent Development Kit - Build AI agents in Rust with modular components for models, tools, memory, and more. |
| homepage | https://github.com/zavora-ai/adk-rust |
| repository | https://github.com/zavora-ai/adk-rust |
| max_upload_size | |
| id | 1958329 |
| size | 146,447 |
Rust Agent Development Kit (ADK-Rust) - Build AI agents in Rust with modular components for models, tools, memory, realtime voice, and more.
A flexible framework for developing AI agents with simplicity and power. Model-agnostic, deployment-agnostic, optimized for frontier AI models. Includes support for realtime voice agents with OpenAI Realtime API and Gemini Live API.
1. Create a new project:
cargo new my_agent && cd my_agent
2. Add dependencies:
[dependencies]
adk-rust = "0.2.0"
tokio = { version = "1.40", features = ["full"] }
dotenvy = "0.15"
3. Set your API key:
echo 'GOOGLE_API_KEY=your-key' > .env
4. Write src/main.rs:
use adk_rust::prelude::*;
use adk_rust::Launcher;
use std::sync::Arc;
#[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")
.instruction("You are a helpful assistant.")
.model(Arc::new(model))
.build()?;
Launcher::new(Arc::new(agent)).run().await?;
Ok(())
}
5. Run:
cargo run
let agent = LlmAgentBuilder::new("researcher")
.instruction("Search the web and summarize findings.")
.model(Arc::new(model))
.tool(Arc::new(GoogleSearchTool::new()))
.build()?;
// Sequential execution
let pipeline = SequentialAgent::new("pipeline", vec![agent1, agent2, agent3]);
// Parallel execution
let parallel = ParallelAgent::new("analysis", vec![analyst1, analyst2]);
// Loop until condition (max 5 iterations)
let loop_agent = LoopAgent::new("refiner", vec![agent])
.with_max_iterations(5);
let coordinator = LlmAgentBuilder::new("coordinator")
.instruction("Delegate tasks to specialists.")
.model(model)
.sub_agent(code_agent)
.sub_agent(test_agent)
.build()?;
Build voice-enabled AI assistants with bidirectional audio streaming:
use adk_realtime::{RealtimeAgent, openai::OpenAIRealtimeModel, RealtimeModel};
let model: Arc<dyn RealtimeModel> = Arc::new(
OpenAIRealtimeModel::new(&api_key, "gpt-4o-realtime-preview-2024-12-17")
);
let agent = RealtimeAgent::builder("voice_assistant")
.model(model)
.instruction("You are a helpful voice assistant.")
.voice("alloy")
.server_vad() // Voice activity detection
.build()?;
Features:
Build complex workflows using LangGraph-style graph agents:
use adk_graph::prelude::*;
let agent = GraphAgent::builder("processor")
.node_fn("fetch", |ctx| async move { /* ... */ })
.node_fn("transform", |ctx| async move { /* ... */ })
.edge(START, "fetch")
.edge("fetch", "transform")
.edge("transform", END)
.checkpointer(SqliteCheckpointer::new("state.db").await?)
.build()?;
Features:
Give agents web browsing capabilities with 46 tools:
use adk_browser::{BrowserSession, BrowserToolset, BrowserConfig};
use std::sync::Arc;
let config = BrowserConfig::new().webdriver_url("http://localhost:4444");
let session = Arc::new(BrowserSession::new(config));
let toolset = BrowserToolset::new(session);
let tools = toolset.all_tools(); // 46 browser tools
let mut builder = LlmAgentBuilder::new("web_agent")
.model(model);
for tool in tools {
builder = builder.tool(tool);
}
let agent = builder.build()?;
Tools include navigation, extraction, forms, screenshots, JavaScript execution, and more.
Test and validate agent behavior:
use adk_eval::{Evaluator, EvaluationConfig, EvaluationCriteria};
let evaluator = Evaluator::new(EvaluationConfig::with_criteria(
EvaluationCriteria::exact_tools().with_response_similarity(0.8)
));
let report = evaluator.evaluate_file(agent, "tests/agent.test.json").await?;
assert!(report.all_passed());
# Console mode (default)
cargo run
# Server mode
cargo run -- serve --port 8080
# Full (default)
adk-rust = "0.2.0"
# Minimal
adk-rust = { version = "0.2.1", default-features = false, features = ["minimal"] }
# Custom
adk-rust = { version = "0.2.1", default-features = false, features = ["agents", "gemini", "tools"] }
Apache 2.0