Agent Development Kit (adk-rs)
An open-source, code-first Rust framework for building, evaluating, and deploying AI agents. adk-rs is a Rust port of Google's ADK: model-agnostic, deployment-agnostic, and wire-compatible with the Python ADK ecosystem (eval sets, adk api_server endpoints, the adk-web UI, and the A2A protocol) — with the low overhead, predictable latency, and safety guarantees of the Rust toolchain.
📖 Full documentation: adk-rs.vercel.app
Highlights
- Three providers, one trait — Gemini, Anthropic Claude, and any OpenAI-compatible endpoint (Azure, Ollama, Groq) behind
Arc<dyn Model>, with native SSE streaming, image input, automatic retry/backoff, and prompt caching on every provider. - Composable agents —
LlmAgent,SequentialAgent,ParallelAgent, andLoopAgentnest through oneBaseAgenttrait, driven by a unified event stream, with automatic agent transfer between declared sub-agents and lifecycle callbacks around every agent, model, and tool call. - Ergonomic tools —
#[tool]on any async function derives the schema and wiring; or mount tools from any MCP server or OpenAPI 3.x spec. - Production runtime — token-level streaming, structured output, extended thinking (Anthropic) with signature-safe round-trips, human-in-the-loop tool confirmation, pause/cancel/resume, context caching, event compaction, and semantic memory.
- Serve and interoperate — an axum dev server compatible with the adk-web UI, an embeddable CLI, spec-compliant A2A agent-to-agent JSON-RPC, and Gemini Live bidirectional audio streaming.
- Secure by default — HTTPS-or-loopback for credentials, redirect-stripped credential clients, loopback-only unauthenticated servers, Docker-sandboxed code execution, zero
unsafe.
Installation
Default features are empty — opt in to what you need:
[]
= { = "0.6", = ["gemini", "macros"] }
= { = "1", = ["macros", "rt-multi-thread"] }
= "0.3"
Requires Rust 1.85+ (edition 2024). Each provider reads its key from the environment: GOOGLE_API_KEY, ANTHROPIC_API_KEY, or OPENAI_API_KEY (plus optional OPENAI_BASE_URL). See Installation for the full feature-flag reference.
Quick start
use LlmAgent;
use Gemini;
use Runner;
use InMemorySessionService;
use StreamExt;
use Arc;
async
Defining a tool
Annotate any async function — the macro derives the JSON schema and the Tool impl:
use tool;
use JsonSchema;
use ;
/// Look up the current weather in `args.city`.
async
Attach it with .tool(get_weather()) on the agent builder.
Going further
Everything below is covered in depth at adk-rs.vercel.app:
| Topic | Docs |
|---|---|
| Multi-agent composition & workflow pipelines | Workflow agents · Multi-agent |
| Sessions, state, artifacts & semantic memory | Sessions & state · Memory |
| MCP toolsets & OpenAPI tool generation | MCP · OpenAPI tools |
| Structured output (schema-enforced on all providers) | Structured output |
| Human-in-the-loop confirmation, pause & resume | Tool confirmation · Cancellation & resume |
| Cost levers: context caching & event compaction | Context caching · Event compaction |
| Authenticated tools (OAuth2, service accounts) | Auth |
| Code execution (local for trusted code, Docker-sandboxed) | Code execution |
| HTTP server (adk api_server-compatible) & CLI | Server · CLI |
| A2A protocol & Gemini Live streaming | A2A · Gemini Live |
| Evaluation, testing & telemetry | Eval · Testing · Telemetry |
| Security model | Security |
Examples
Runnable demos live under examples/:
# live API wire-compatibility smoke test (needs real keys):
The documentation site itself lives under docs/ (cd docs && npm install && npm run dev); it is excluded from the published crate.
Contributing
Bug reports, feature requests, and pull requests are welcome. Before submitting:
Please open an issue before starting on substantial changes.
License
Licensed under the Apache License, Version 2.0 — see LICENSE.