ADK-Rust 2.0

The Rust framework forhigh-performance, production-readyAI agents.

ADK-Rust brings typed agents, tools, durable state, realtime media, and open protocols into one async runtime—so you can move from a focused agent to a system you can operate with confidence.

Begin with the unit of work

What is an AI Agent in terms of ADK-Rust?

An agent is an async Rust component. It receives an invocation context, performs work with models or tools, and emits typed events as it progresses. LLM agents, workflows, realtime agents, coding agents, and custom Rust agents all use this shared contract.

What makes ADK-Rust compelling is that the agent remains part of a software system you can understand and control. Model calls, tool inputs, state changes, approvals, and streamed events have explicit Rust contracts. The same runtime can support a focused assistant, a durable multi-agent workflow, a realtime voice experience, or an agent that works across services—while preserving the performance, concurrency, portability, and operational discipline Rust teams expect.

If you know LangGraph, Google ADK, the OpenAI Agents SDK, or CrewAI, you will recognize tools, handoffs, workflows, memory, guardrails, and tracing. ADK-Rust brings those ideas into a Rust-native runtime and connects them with realtime media, code execution, RAG, artifacts, and open protocols such as MCP, A2A, ACP, and AWP. Version 2 expands that foundation with graph, realtime, coding, and CodeAct agents; provider-aware tool schemas; composable project templates and cargo adk build; stronger state and operating controls; and a consistent typed event trail from the first model call to production.

ADK-Rust v2 runtime architectureProduct surfaces send requests into the ADK Runner. The runner coordinates agent shapes, model providers, tools, state services, open protocols, and production controls through typed events.ADK-Rust v2 — one request, the whole systemSolid orange: execution · dashed grey: events, results, resume · purple boundary: open protocolsPRODUCT SURFACESWeb & mobileUI / API clientsVoice & videoRealtime clientsOther agentsA2A / ACP / AWPCLI & jobscargo-adk / cronADK EXECUTION RUNTIMERunnersession · invocation context · cancellation · callbacks · event streamCHOOSE THE AGENT SHAPE THE JOB NEEDSLLM agentreason + toolsWorkflowseq / parallel / loopGraphcheckpoint + HITLCodeActwrite + run codeRealtimevoice + videoCustomimplement AgentTyped Event streammodel text · tool calls · progress · state deltas · artifacts · transfers · errorsCAPABILITIES AROUND THE AGENTModel providersGemini · OpenAI · AnthropicOllama · Bedrock · Azure AITools & specialists#[tool] · skills · browserMCP · ACP · code sandboxState & knowledgesessions · memory · RAGartifacts · graph checkpointsMedia & interfacesaudio · video · A2UIREST · SSE · WebSocketAgent protocolsA2A · AWPdiscovery · task contractsCommerce · evolvingACP commerce · AP2 alphadurable transaction journalsruncallresultemit EventPROTOCOL & DEPLOYMENT BOUNDARYREST / SSEA2AACPAWPMCPWebSocketProtocols adapt the runtime at system boundaries; they do not replace it.Auth · tool authorization · guardrails · sandbox · plugins · telemetry · evaluation · retry / cancellationCOMPANION PRODUCTSStudio · UI · Playground · Enterprise platform

How to read the architecture

Follow the diagram from left to right. A product surface sends a request to the Runner. The Runner attaches session state and invocation context, then calls the selected agent. Models, tools, and state support the work while typed events carry progress and results back.

Inside the runtime

Runner, agents, typed events, model/tool loops, sessions, callbacks, transfers, and cancellation.

At the boundary

MCP, A2A, ACP, AWP, HTTP, SSE, and realtime transports connect separate systems and trust zones.

Outside the framework

Studio, UI, Playground, and the control plane consume ADK-Rust; they do not run inside the Runner.

Framework surface

The capabilities behind the architecture.

ADK-Rust brings the full agent lifecycle into one framework: compose agent behavior, give it tools, preserve context, connect it to other systems, and operate it safely in production. The groups below show how those capabilities fit together.

Build LLM, workflow, graph, realtime, and coding agents; equip them with typed tools, MCP, RAG, memory, sessions, and artifacts; connect them through REST, A2A, ACP, and AWP; then add authorization, guardrails, telemetry, and evaluation for production.

Compose

Compose capability

LlmAgent

The main model-driven agent. Give it instructions, an LLM, tools, callbacks, and optional sub-agents; the Runner streams its work as typed events.

Act

Act capability

#[tool]

Turns a typed async Rust function into a model-callable tool and derives the argument schema from Rust types.

Remember

Remember capability

sessions

Keep conversation events and application state together so a user can continue the same interaction over multiple turns.

Connect

Connect capability

REST

Exposes familiar HTTP endpoints for clients that send a request and receive a structured response.

Operate

Operate capability

auth

Establishes who is calling the system through API keys, OAuth, OIDC, SSO, and application identity.

Build

Build capability

12 templates

Generate working starting shapes for focused agents, tools, retrieval, APIs, workflows, realtime sessions, and custom logic.

See how it works

Show the work while it is happening.

The Runner resolves the session, builds the invocation context, runs the agent, streams model and tool work, applies state changes, persists durable events, and returns progress to the caller as it happens.

That same trail can feed a terminal, a web UI, an API client, evaluation, or a realtime conversation.

Follow a real request

A customer asks, “Why did my payment fail?” The Runner opens the correct session, streams model output and tool activity, records state changes, and returns each useful event to the interface. The user sees progress while the operator gains a complete execution record.

One invocation through ADK-RustA request loads a session, enters the runner, loops through model and tool work, emits typed events, and persists state and artifacts before the response returns.Follow one request through the runtimeNothing disappears into a black box: each stage produces typed state or events.RequestContent + identityLoad sessionhistory + stateRunnercontext + lifecycleAgentdecide next stepModelstream responseToolact on systemEventsUI / serverPersist the trailsession events · state deltas · memory · artifacts · graph checkpoints · evaluation traces

Compose the behavior

When the job grows, split the work without losing the thread.

Study multi-agent patterns

A router identifies the work that must be done. Specialists handle the parts they understand best. Sequential and parallel workflows control execution order, while graph checkpoints keep evidence, approvals, and progress attached to the same job.

Advanced ADK-Rust multi-agent customer operations workflowA customer access incident is routed to parallel account, payment, and platform agents. They use MCP and A2A systems, write evidence to shared checkpointed state, and converge in a supervisor graph with retry, approval, action, and audit paths.Resolve a real customer incident without losing controlUse case: “Payment succeeded, but our team workspace is still locked.”The workflow must establish the facts, choose a safe remedy, request approval for consequential action, and leave an evidence trail.CustomerWeb · voice · APITriage routerLlmConditionalAgentClassify · set urgency · choose specialistsrequestPARALLEL INVESTIGATION · ParallelAgentAccount agentIdentity + entitlementReads customer, team, and access statePayment agentBilling + transactionReconciles charge, invoice, and planPlatform agentRuntime + provisioningChecks locks, jobs, and service healthfan outSYSTEM BOUNDARIESCRM + identityMCP resources / toolsERP + paymentsMCP + commerce journalProvisioning serviceA2A remote agentShared incident state + graph checkpointcustomer_id · payment evidence · entitlement state · platform health · confidence · proposed actionEvery specialist writes typed evidence; retries and human interrupts resume from the same checkpoint.SUPERVISOR GRAPHSynthesize evidenceGraphAgentCompare facts · score confidenceEnough evidence?Conditional edgeready / investigateInvestigate againLoopAgent + reflectionRetry only the missing branchApproval gateGraph interruptUnlock / refund needs a personAct in orderSequentialAgentmissingresume selected specialistreadyOutcome streamworkspace restored · customer response · evidence artifact · session event · audit record · telemetry trace · evaluation sampleAuth · RBAC · tool confirmation · guardrails · cancellation · sandbox · telemetry · evaluation surround the entire invocation
The graph does not ask one agent to improvise everything. Routing narrows the problem, specialists investigate concurrently, shared state keeps their evidence coherent, and consequential action remains behind an explicit approval boundary.

LlmAgent

Focused reasoning

A model, instructions, tools, callbacks, and streamed output—the small, useful center of most systems.

Sequential · Parallel · Loop

Deterministic work

Express order, concurrency, repetition, and exit conditions directly in the Rust program.

GraphAgent

Durable orchestration

Branch, checkpoint, interrupt for a person, and resume after the process or conversation has moved on.

CodingAgent · CodeActAgent

Software as action

Let an agent inspect, edit, and run code inside a workspace and sandbox boundary you control.

RealtimeAgent

Live conversation

Carry audio, transcripts, video frames, interruptions, and server-side tools through one live session.

CustomAgent

Your own runtime logic

Implement the Agent contract for product-specific behavior written directly in Rust.

The system around the agent

The model is one part of the product.

Useful agents need tools, state, interfaces, boundaries, and evidence. ADK-Rust exposes each piece through composable Rust interfaces that you own.

One product, several responsibilities

In a customer-support product, the model drafts the response, tools inspect the order, the session carries customer context, authorization controls refunds, an artifact stores the receipt, and telemetry records the outcome. Each responsibility stays visible in the runtime.

A complete ADK-Rust agent product architectureInterfaces enter an ADK-Rust runtime that coordinates agent logic, a replaceable model adapter, tools, state and knowledge services. Typed events produce visible progress, artifacts, actions, audit records and evaluation evidence under shared controls.A useful agent product is a complete systemThe model can change. The contracts, state, tools, controls, and evidence remain yours.PEOPLE & INTERFACESWeb applicationchat · forms · artifactsVoice & videolive media sessionAPI & eventsREST · SSE · WebSocketOther agentsA2A · ACP · AWPADK-RUST RUNTIMERunner + typed Event streamsession · context · lifecycle · cancellationAgent logicreason · routeWorkflowgraph · HITLModel / tool loopcall · observe · approve · retry · continueMODEL · ONE REPLACEABLE ADAPTERProviderhosted / localSchemaprovider-awareTOOLS & EXTERNAL SYSTEMSRust tools#[tool]MCPtools · resourcesBrowserweb actionsSpecialistsACP · A2ASTATE, KNOWLEDGE & DURABLE WORKSessionMemoryRAGArtifactsCheckpointsWHAT THE PRODUCT CAN SHOWLive progresstokens · tool status · audioUseful artifactsfiles · reports · media · UIApproved actionswrites · payments · handoffsDurable continuitysessions · memory · resumeEvidenceevents · audit · telemetryQuality signalsevaluation · cost · latencytyped events return to every interfaceAuth · identity · tool authorization · approval · guardrails · sandbox · cancellation · telemetry · evaluation
The model supplies intelligence inside a complete product: interfaces people can use, tools that can act, state that survives, controls that constrain risk, and evidence that explains what happened.
Models

Change the model without redesigning the agent.

Hosted frontier models, fast routing models, local Ollama, and native mistral.rs inference sit behind a common Llm contract.

Gemini · OpenAI · Anthropic · OpenRouter · DeepSeek · Groq · Ollama · Bedrock · Azure AI · compatible endpoints

Tools

Tools use explicit, inspectable contracts.

Turn a typed Rust function, MCP server, skill, browser session, coding agent, or sandboxed process into a capability the runtime can inspect and call.

#[tool] · FunctionTool · MCP · ACP · skills · browser · code

State

Keep the conversation—and the work it produced.

Sessions hold the event history. Memory retrieves useful knowledge. Artifacts preserve files. Graph checkpoints make long work resumable.

SQLite · PostgreSQL · Redis · MongoDB · Firestore · Neo4j · encrypted sessions

Realtime

A live agent is more than a speech endpoint.

ADK-Rust keeps audio, transcripts, video frames, tool calls, interruption, and changing context inside a Rust-owned session.

OpenAI Realtime · Gemini Live · Vertex Live · LiveKit · optional WebRTC

Knowledge

Bring retrieval into the same execution trail.

Chunk documents, embed them, search vector stores, rerank results, and isolate memory by project before the model answers.

RAG pipelines · semantic memory · knowledge graph · five vector-store implementations

Control

Put approval where the action happens.

Authorization, callbacks, guardrails, sandbox profiles, cancellation, telemetry, and evaluation form the production execution boundary.

RBAC · OAuth/OIDC · tool confirmation · PII guardrails · OpenTelemetry · eval

Choose the boundary

Use the protocol that matches the distance.

Begin with where the capability runs.

Keep sub-agents inside one ADK-Rust runtime when they share deployment, state, and trust. Introduce a protocol when the capability, agent, coding workspace, or website has a deployment, process, ownership, or trust boundary of its own.

Same Rust process

Agent, sub-agent, or tool

External tools or resources

MCP

Independently deployed agent

A2A

Coding process or IDE

ACP

Agent-readable website

AWP

MCP

Model Context Protocol

Give an agent capabilities that live somewhere else.

What is MCP?

A standard way for an external server to publish tools an agent can call and resources it can read.

Why use this protocol?
You avoid writing a bespoke adapter for every database, SaaS product, filesystem, or knowledge source—and the same server can serve more than one agent.
How does ADK-Rust use MCP?
McpToolset connects the server to ADK-Rust's tool contract. The runtime discovers its schemas, normalizes them for the selected model provider, and can read MCP resources or manage local MCP server processes.
When should I choose MCP?
Use MCP when the capability belongs in a separate process, already has an MCP server, or should be shared across several agents and applications.
What connects through MCP?
The other side is an MCP server: for example a database gateway, business API, document store, developer tool, or internal service.
Explore MCP in ADK-Rust
A2A

Agent-to-Agent Protocol

Let independently deployed agents work together.

What is A2A?

A network protocol for discovering a remote agent, sending it work, following progress, and receiving results across an HTTP boundary.

Why use this protocol?
A specialist can keep its own model, tools, state, release cycle, deployment, and security boundary.
How does ADK-Rust use A2A?
ADK-Rust can expose an agent through its A2A v1 server and task operations. A coordinator can then treat that remote service as a specialist while streamed events preserve the progress of the job.
When should I choose A2A?
Use A2A when the agent is deployed, scaled, owned, or secured separately. Keep ordinary sub-agents in-process when none of those boundaries exists.
What connects through A2A?
The other side is another agent service—perhaps a research specialist, finance agent, partner agent, or a system owned by another team.
Explore A2A in ADK-Rust
ACP

Agent Client Protocol

Delegate software work to a real coding agent.

What is ACP?

A protocol that standardizes sessions between coding agents and the clients that host them, including editors, CLIs, and orchestration systems.

Why use this protocol?
Coding work needs workspace context, streaming progress, cancellation, and permission decisions throughout the session.
How does ADK-Rust use ACP?
AcpAgentTool and AcpToolset let an ADK-Rust agent start or connect to an ACP process, establish a session, stream its work, and return the result as a tool call. The optional server side can expose an ADK-Rust agent to ACP clients.
When should I choose ACP?
Use ACP for repository exploration, implementation, refactoring, testing, or any delegated task that should happen inside a controlled development workspace.
What connects through ACP?
The other side is an ACP-compatible coding agent or client, such as Codex, Claude Code, an IDE, or your own ACP implementation.
Explore ACP in ADK-Rust
AWP

Agentic Web Protocol

Make a website understandable before an agent scrapes it.

What is AWP?

A web protocol through which a site publishes who it is, what agents can do, which policies apply, and whether its agent-facing services are healthy.

Why use this protocol?
HTML explains a page to a browser, but it rarely explains business capabilities, consent, trust, limits, or events to an autonomous agent.
How does ADK-Rust use AWP?
adk-awp loads business context, generates discovery and capability manifests, and adds versioned Axum routes for trust-aware rate limits, consent, event subscriptions, and health monitoring.
When should I choose AWP?
Use AWP when a website or service should be intentionally discoverable and usable by agents without relying on fragile page interpretation alone.
What connects through AWP?
The other side is a visiting personal agent, enterprise agent, partner system, or agent-aware client that discovers and respects the site's published contract.
Explore AWP in ADK-Rust

Developer quickstart

From a terminal to a working agent, one decision at a time.

Begin with a small, working Rust project. The guided steps below explain what the generator adds, how to compile the project locally, and where to extend it as your product grows.

What you will have at the end

A compiled Rust agent with a typed tool, an interactive Launcher session, telemetry setup, session and guardrail integration points, and a real model response in the terminal. The generated project is ordinary Rust source that you can read, change, and extend.

Before you begin

Two things are required on your machine

01

Rust 1.95 or newer.
Install with rustup or update the stable toolchain.

02

A model API key.
This path uses GOOGLE_API_KEY; another provider can be selected later.

01

Install the ADK project generator

cargo-adk adds the cargo adk commands used to create, inspect, build, and deploy agent projects.

cargo install cargo-adk
02

Create a useful starter agent

Start with an agent that can call typed Rust tools. Add observability, session state, and guardrail hooks while the project is generated.

cargo adk new support-agent --template tools \
  --addon telemetry --addon sessions --addon guardrails
03

Add your model credential

The generated example uses Gemini by default. Copy the safe example file, then place your key in the untracked .env file.

cd support-agent
cp .env.example .env
# set GOOGLE_API_KEY in .env
04

Compile before you run

cargo adk build checks the generated dependencies, feature combination, Rust types, and release binary without deploying anything.

cargo adk build
05

Run and talk to the agent

Launch the generated console, enter a message, and watch the same typed runtime that can later power an API, workflow, or realtime product.

cargo run
support-agent — zsh

Install once

$ cargo install cargo-adk

Generate the project

$ cargo adk new support-agent \
+  --template tools \
+  --addon telemetry \
+  --addon sessions \
+  --addon guardrails
created support-agent/
├── Cargo.toml dependencies + feature flags
├── src/main.rs agent + typed tool
├── .env.example required configuration
└── README.md project-specific instructions

Configure the model

$ cd support-agent
cp .env.example .env
# Add GOOGLE_API_KEY to .env

Verify, then run

$ cargo adk build
cargo run
Actual v2 run · typed tool call
  ADK-Rust — support-agent
  Type a message to chat. Type 'exit' to quit.

You > Greet Ada casually.

[tool] greet({"name":"Ada","style":"casual"})
Hey Ada! What's up?

You > exit

Goodbye.
✓ project compiled · runtime ready · local verification complete

Understand the scaffold

See how the command is assembled.

The template supplies the working agent shape. Each add-on contributes the required crate features, imports, configuration, and an explicit place to finish the integration.

Template

--template tools

Generates an LLM agent with a typed #[tool] function and the schema wiring needed for model tool calls.

Add-on

--addon telemetry

Enables OpenTelemetry integration so model, tool, and runtime work can be traced.

Add-on

--addon sessions

Adds session-service wiring so conversation state can survive beyond one model call.

Add-on

--addon guardrails

Adds the feature and clear hooks for input validation, output checks, and content filtering.

Choose a different starting shape

Twelve practical starting points for common agent architectures.

Pick the shape that matches the first piece of useful work. Templates generate editable Rust source, dependencies, provider configuration, and a runnable entry point.

Open the complete quickstart
llmAgent template

Start with one reasoning agent.

Generates an LlmAgentBuilder, Gemini model setup, instructions, session-backed Launcher, and an interactive terminal.

Choose this when

Choose it for assistants, extraction, classification, or a focused model-and-tool loop.

Generated starting point

One LLM agent · streamed console · provider configuration

cargo adk new my-agent --template llm
toolsAgent template

Give an agent typed Rust actions.

Adds src/tools.rs with a working #[tool] function, typed arguments, JSON Schema generation, and registration on the LLM agent.

Choose this when

Choose it when the agent needs to calculate, retrieve data, call business logic, or perform an action.

Generated starting point

LlmAgent · Greet tool · serde · schemars · adk-tool

cargo adk new my-agent --template tools
ragAgent template

Answer from documents and indexed knowledge.

Creates a RAG pipeline with document chunking, Gemini embeddings, an in-memory vector store, a sample document, and RagTool.

Choose this when

Choose it for product documentation, policies, research collections, or answers grounded in private material.

Generated starting point

RagPipeline · chunker · embeddings · vector search · RagTool

cargo adk new my-agent --template rag
apiAgent template

Expose an agent through an HTTP service.

Generates an Axum server with health, session creation, and streamed run endpoints around an LLM agent.

Choose this when

Choose it when a web application, mobile client, backend service, or automation platform will call the agent.

Generated starting point

Axum · REST routes · SSE responses · in-memory sessions

cargo adk new my-agent --template api
a2aPattern alias

Deploy an agent as a remote specialist.

Resolves to the a2a-server pattern and combines an LLM agent with server and session capabilities for Agent-to-Agent access.

Choose this when

Choose it when another agent must discover and call this agent across a deployment or ownership boundary.

Generated starting point

A2A server · agent identity · task handling · sessions

cargo adk new my-agent --template a2a
graphAgent template

Prepare a durable, branching workflow.

Enables the graph capability and creates the imports and agent starting point for nodes, edges, checkpoints, interruption, and resume.

Choose this when

Choose it for long-running work with branches, approval steps, recovery, or durable execution state.

Generated starting point

Graph feature · workflow agent · topology starting point

cargo adk new my-agent --template graph
realtimeAgent template

Prepare a live voice or video agent.

Enables realtime support and creates a concise voice-agent starting point with realtime imports and provider configuration.

Choose this when

Choose it for natural conversation, interruption, live translation, audio tools, or incoming video frames.

Generated starting point

Realtime feature · voice instructions · transport starting point

cargo adk new my-agent --template realtime
sequentialWorkflow template

Pass work through agents in a fixed order.

Generates researcher and writer agents inside a SequentialAgent so each stage receives the work produced by the previous stage.

Choose this when

Choose it when the process has clear phases such as collect, analyze, draft, review, and publish.

Generated starting point

Two LLM agents · ordered execution · shared invocation trail

cargo adk new my-agent --template sequential
parallelWorkflow template

Run independent specialists concurrently.

Generates two specialist agents inside a ParallelAgent and gathers their work through one parent workflow.

Choose this when

Choose it when several investigations can begin from the same input and complete independently.

Generated starting point

Two LLM agents · concurrent execution · aggregated results

cargo adk new my-agent --template parallel
loopWorkflow template

Repeat a bounded refinement cycle.

Creates a worker inside LoopAgent with an explicit completion signal and a five-iteration safety limit.

Choose this when

Choose it for drafting, critique, repair, validation, or search processes that improve through repeated passes.

Generated starting point

LoopAgent builder · worker agent · completion instruction · max iterations

cargo adk new my-agent --template loop
conditionalWorkflow template

Route each request to the right specialist.

Generates technical and general agents inside a ConditionalAgent that selects a path from the incoming request.

Choose this when

Choose it when categories of work need different instructions, tools, models, or domain specialists.

Generated starting point

ConditionalAgent · two routes · LLM-based selection

cargo adk new my-agent --template conditional
customAgent template

Implement the Agent contract directly.

Creates a MyAgent type with the Agent trait methods and a run function ready for your own Rust execution logic and event stream.

Choose this when

Choose it for deterministic orchestration, existing state machines, domain runtimes, or behavior that needs full Rust control.

Generated starting point

Agent trait skeleton · InvocationContext · EventStream entry point

cargo adk new my-agent --template custom

The CLI registry also includes the provider-specific openai template, five enterprise patterns, the basic and a2a aliases, and composable capability add-ons.

cargo adk templatescargo adk addons

Compile what you need

Start small. Add the system when the product asks for it.

First choose a template for the project’s execution shape. Then select a feature tier for the capabilities compiled into the binary.

Feature tiers control dependencies, compile time, binary surface, and the available framework APIs. Persistent databases, MCP, cloud secret managers, and specific realtime transports remain explicit choices.

01 · Start here

minimal

Agents · Gemini · Runner · sessions

A focused agent with the smallest default surface.

02 · Build a product

standard

Tools · memory · graph · server · auth · eval · telemetry

Most APIs, workflow systems, and internal agent products.

03 · Widen the system

enterprise

Realtime base · browser · RAG · payments · AWP

Products that need richer interaction and interoperability.

04 · Specialist surface

full

Audio · code execution · sandbox

Opt into the heaviest local and execution capabilities.

adk-rust = { version = "2.0.0", features = ["standard"] }

Build with ADK-Rust

Create a working agent, understand its runtime, and grow it with confidence.

Your first useful milestone is one request, one visible tool call, and one session you understand. The guided quickstart builds that path. From there, add the workflows, state, protocols, and operating controls your product requires.