adk-rust 0.1.2

Agent Development Kit - Build AI agents in Rust (Google ADK)
Documentation

ADK-Rust

Agent Development Kit for Rust - Build AI agents with simplicity and power.

Crates.io Documentation License

A flexible framework for developing AI agents. Model-agnostic, deployment-agnostic, optimized for Gemini.

Quick Start

1. Create a new project:

cargo new my_agent && cd my_agent

2. Add dependencies:

[dependencies]
adk-rust = "0.1"
tokio = { version = "1.40", features = ["full"] }
dotenv = "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() -> std::result::Result<(), Box<dyn std::error::Error>> {
    dotenv::dotenv().ok();
    let api_key = std::env::var("GOOGLE_API_KEY")?;
    let model = GeminiModel::new(&api_key, "gemini-2.0-flash-exp")?;

    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

Adding Tools

let agent = LlmAgentBuilder::new("researcher")
    .instruction("Search the web and summarize findings.")
    .model(Arc::new(model))
    .tool(Arc::new(GoogleSearchTool::new()))
    .build()?;

Workflow Agents

// Sequential execution
let pipeline = SequentialAgent::new("pipeline", vec![agent1, agent2, agent3]);

// Parallel execution
let parallel = ParallelAgent::new("analysis", vec![analyst1, analyst2]);

// Loop until condition
let loop_agent = LoopAgent::new("refiner", agent, 5);

Multi-Agent Systems

let coordinator = LlmAgentBuilder::new("coordinator")
    .instruction("Delegate tasks to specialists.")
    .model(model)
    .sub_agent(code_agent)
    .sub_agent(test_agent)
    .build()?;

Deployment

# Console mode (default)
cargo run

# Server mode
cargo run -- serve --port 8080

Installation Options

# Full (default)
adk-rust = "0.1"

# Minimal
adk-rust = { version = "0.1", default-features = false, features = ["minimal"] }

# Custom
adk-rust = { version = "0.1", default-features = false, features = ["agents", "gemini", "tools"] }

Documentation

License

Apache 2.0