Google ADK
An open-source, code-first Python framework from Google for building, evaluating, and deploying sophisticated AI agents with a graph-based workflow runtime, agent-to-agent task delegation, and built-in Gemini model support.
Introduction
Google ADK (Agent Development Kit) 2.0 is an open-source, code-first Python framework developed by Google for building, evaluating, and deploying sophisticated AI agents. Hosted at github.com/google/adk-python, it gives developers fine-grained control over agent behavior through Python code rather than configuration files or visual builders.
With over 20,500 GitHub stars and 3,700 forks, ADK is Google's primary open-source agent framework. It is designed around two core abstractions: the Agent class (defining an AI's instructions, tools, and behavior) and the Workflow class (orchestrating agents and tasks in a graph-based execution flow). The framework is licensed under Apache 2.0 and is actively maintained with bi-weekly releases.
ADK is deeply integrated with Google's Gemini models but supports a provider-agnostic design. It includes an interactive CLI (adk run), a Web UI for visual debugging (adk web), and an extensive samples repository with ready-to-use agent recipes. The framework is suitable for everything from simple single-agent chatbots to complex multi-agent systems with nested workflows, human-in-the-loop interventions, and dynamic routing.
Key Features
- Code-First Python Framework - Define agents and workflows entirely in Python. No YAML configs, no drag-and-drop builders. Full control over agent logic, tool integration, and execution flow through code.
- Workflow Runtime - Graph-based execution engine for composing deterministic flows with support for routing, fan-out/fan-in, loops, retry logic, state management, dynamic nodes, human-in-the-loop, and nested workflows.
- Task API - Structured agent-to-agent delegation system supporting multi-turn task mode, single-turn controlled output, mixed delegation patterns, human-in-the-loop checkpoints, and task agents as workflow nodes.
- Built-in Gemini Model Support - First-class integration with Google Gemini models (gemini-2.5-flash, gemini-2.5-pro, etc.) while maintaining provider flexibility.
- ADK Web UI - Built-in web-based development UI for visually debugging, monitoring, and interacting with agents. Supports multi-agent directories and single agent folders.
- Interactive CLI - Command-line interface for running agents locally with
adk run. Supports interactive sessions and integration with development workflows. - Extensive Samples Repository - Separate adk-samples repo with production-ready agent recipes across multiple languages (Python, Java, Kotlin, Go).
- Multi-Agent Orchestration - Build complex systems with multiple specialized agents that delegate tasks, share context, and execute in parallel or sequence.
- Human-in-the-Loop - Pause execution for human approval or input at any point in a workflow. Built-in support for both workflow and task-level interventions.
- Open Source (Apache 2.0) - Fully open-source with 3,157+ commits, 9 branches, 69 tags, and bi-weekly release cadence. Active community with 430+ issues and 280+ pull requests.
What's New in 2.0
ADK 2.0 is a major release that introduces significant architectural changes and new capabilities. The two headline features are the Workflow Runtime and the Task API, both of which fundamentally change how agents are composed and how they communicate.
Workflow Runtime
A new graph-based execution engine that replaces the simpler sequential agent chaining from 1.x. The Workflow Runtime supports routing (conditional branching based on agent output), fan-out/fan-in (parallel agent execution with result aggregation), loops (iterative processing with termination conditions), retry with configurable policies, explicit state management between nodes, dynamic node creation at runtime, human-in-the-loop checkpoints, and nested workflows (workflows within workflows).
Task API
A structured agent-to-agent delegation system that enables one agent to assign tasks to another agent and receive results. It supports multi-turn task mode (the delegating agent and task agent can have extended back-and-forth interactions), single-turn controlled output (the delegating agent specifies the exact output format), mixed delegation patterns (combining multi-turn and single-turn within the same workflow), and human-in-the-loop (the task can pause for human input before completing).
Breaking Changes from 1.x
ADK 2.0 introduces breaking changes to the agent API, event model, and session schema. Sessions generated by ADK 2.0 are readable by ADK 1.28+ (extra fields are ignored), but are incompatible with older 1.x versions. Users upgrading from 1.x should review the changelog and migration guides carefully before updating.
Installation and Quick Start
Install ADK via pip:
pip install google-adk
Requirements: Python 3.10 or later. Bi-weekly release cadence.
Install with optional extensions:
pip install "google-adk[extensions]"
Defining an Agent
The Agent class is the fundamental building block. It defines an AI's name, model, instructions, and tools. Below is a minimal greeting agent:
from google.adk import Agent
root_agent = Agent(
name="greeting_agent",
model="gemini-2.5-flash",
instruction="You are a helpful assistant. Greet the user warmly.",
)
Defining a Workflow
The Workflow class orchestrates multiple agents in a graph-based execution flow. Edges define how agents are connected:
from google.adk import Agent, Workflow
generate_fruit_agent = Agent(
name="generate_fruit_agent",
instruction="Return the name of a random fruit. Return only the name.",
)
generate_benefit_agent = Agent(
name="generate_benefit_agent",
instruction="Tell me a health benefit about the specified fruit.",
)
root_agent = Workflow(
name="root_agent",
edges=[("START", generate_fruit_agent, generate_benefit_agent)],
)
Running Locally
Once your agent or workflow is defined in a Python file, you can run it using the ADK CLI:
# Interactive CLI
adk run path/to/my_agent
# Web UI (supports multi-agent directories or single agent folders)
adk web path/to/agents_dir
Workflow Runtime
The Workflow Runtime is a graph-based execution engine introduced in ADK 2.0 for composing deterministic execution flows. Unlike linear agent chaining, the workflow runtime models execution as a directed graph where nodes are agents or tasks and edges define the flow of control and data between them.
Core Concepts
- Nodes - Each node in the graph is an agent, a task, or a special node (START, END, CONDITION). Nodes encapsulate a unit of work that can be executed independently.
- Edges - Directed connections between nodes that define the execution order. Edges can pass data from one node's output to another node's input.
- State Management - The runtime maintains a shared state object that flows through the graph. Each node can read from and write to this state, enabling agents to share context and results.
- Dynamic Nodes - Nodes can be created at runtime based on previous node outputs, enabling adaptive workflows that change their structure based on results.
Execution Patterns
- Routing - Conditional branching based on agent output. Different paths through the graph are selected based on the content or classification of previous results.
- Fan-Out / Fan-In - Execute multiple agents in parallel (fan-out) and aggregate their results at a downstream node (fan-in). Useful for parallel research, multi-perspective analysis, or ensemble decision-making.
- Loops - Iterative processing with configurable termination conditions. Nodes can loop back to previous nodes until a condition is met (e.g., output quality threshold, maximum iterations).
- Retry - Configurable retry policies on any node. Supports exponential backoff, max retry count, and conditional retry based on error types.
- Human-in-the-Loop - Execution can pause at any node for human approval, input, or correction before continuing. The runtime supports both synchronous (blocking) and asynchronous (notification-based) human intervention modes.
- Nested Workflows - Workflows can contain sub-workflows, enabling hierarchical decomposition of complex tasks. A workflow node can itself be a full workflow graph.
Workflow Example
from google.adk import Agent, Workflow
research_agent = Agent(
name="research_agent",
model="gemini-2.5-flash",
instruction="Research the given topic and provide key findings.",
)
summarize_agent = Agent(
name="summarize_agent",
model="gemini-2.5-flash",
instruction="Summarize the research findings into 3 bullet points.",
)
# Sequential workflow: START -> research -> summarize -> END
root_agent = Workflow(
name="research_workflow",
edges=[("START", research_agent, summarize_agent)],
)
Task API
The Task API is a structured system for agent-to-agent delegation introduced in ADK 2.0. It enables one agent (the delegator) to assign a task to another agent (the worker) and receive a structured result. This is distinct from simple function calling: task agents are full AI agents with their own instructions, model, and tools, capable of multi-turn reasoning to complete the assigned task.
Task Modes
- Multi-Turn Task Mode - The delegating agent and the task agent can have extended back-and-forth interactions. The task agent can ask clarifying questions, request additional context, or provide intermediate results before delivering the final output. This is the default mode for complex tasks that require iteration.
- Single-Turn Controlled Output - The delegating agent specifies the exact output format and constraints. The task agent produces a single response matching the specified schema, with no follow-up interactions. This mode is suitable for well-defined tasks with clear requirements.
- Mixed Delegation Patterns - Combine multi-turn and single-turn tasks within the same workflow. For example, a research workflow could use single-turn controlled output for structured data extraction and multi-turn for open-ended analysis.
Key Features
- Human-in-the-Loop - Tasks can pause for human input at any point. The delegator can specify checkpoints where human approval is required before the task proceeds.
- Task Agents as Workflow Nodes - Task agents can be embedded directly into workflow graphs, combining the power of structured delegation with graph-based orchestration.
- Result Validation - The delegator can validate task results against expected schemas and request retries if the output does not meet requirements.
- Context Propagation - Task agents receive context from the delegator, including conversation history, shared state, and tool access configurations.
Task API Example
from google.adk import Agent, Task
fact_checker = Agent(
name="fact_checker",
model="gemini-2.5-flash",
instruction="Verify the factual accuracy of statements. Return a verdict.",
)
# The delegator assigns a task to the fact_checker
task = Task(
agent=fact_checker,
input="Verify: 'The Eiffel Tower was built in 1889.'",
mode="single_turn", # Controlled single-turn output
)
Running Agents
ADK provides two primary ways to run agents locally: the interactive CLI and the Web UI. Both tools are installed automatically with the google-adk package and provide different workflows for development and debugging.
CLI (adk run)
The adk run command starts an interactive session with your agent in the terminal. It supports single-agent and multi-agent directories, real-time streaming responses, and integration with development tools. The CLI is ideal for quick testing, debugging agent behavior, and iterating on agent definitions during development.
# Run a single agent
adk run path/to/my_agent
# Run with verbose output for debugging
adk run path/to/my_agent --verbose
ADK Web UI (adk web)
The adk web command launches a browser-based development UI for visually interacting with agents. It supports multi-agent directories (showing all agents in a folder) and pointing directly to a single agent folder. The Web UI provides visual debugging tools, real-time agent state inspection, and a chat interface for testing conversations.
# Launch Web UI for a directory of agents
adk web path/to/agents_dir
# Launch Web UI for a single agent folder
adk web path/to/my_agent
The ADK Web UI is a separate project hosted at github.com/google/adk-web. It provides a rich visual interface including agent topology visualization, conversation history browsing, and real-time execution tracing.
Samples Repository
Google maintains an extensive adk-samples repository (9,800+ stars, 2,700+ forks) with production-ready agent recipes. The repository includes samples for workflow patterns, task API usage, multi-agent systems, tool integration, and platform-specific examples across Python, Java, Kotlin, and Go.
Comparison with Alternatives
| Aspect | Google ADK | LangChain | CrewAI | PydanticAI |
|---|---|---|---|---|
| Approach | Code-first, graph-based workflows | Chain-of-thought, LCEL expressions | Role-based agent teams | Type-safe, Pydantic-based agents |
| Workflow Engine | Graph-based (routing, loops, fan-out/fan-in, nested) | LCEL (linear chains), LangGraph (graphs) | Sequential / hierarchical process-based | Simple sequential (no built-in graph engine) |
| Agent-to-Agent Delegation | Task API (multi-turn, single-turn, mixed) | Tool-based agent calls | Task/process-based delegation | Agent-as-tool pattern |
| Model Support | Gemini (first-class), extensible | 100+ models via integrations | OpenAI, Anthropic, Gemini, local | OpenAI, Anthropic, Gemini, Ollama |
| Human-in-the-Loop | Built-in workflow and task level | Via LangGraph (interrupt/breakpoints) | Basic (human input tool) | Via custom agents |
| Development Tools | CLI (adk run) + Web UI (adk web) | LangSmith, LangServe | CrewAI Enterprise (paid) | CLI only (no Web UI) |
| License | Apache 2.0 | MIT | MIT | MIT |
| Type Safety | Python-native types | Pydantic support | Pydantic support | Pydantic-native (first-class) |
| Ecosystem | Google Cloud, Gemini, growing community | Largest ecosystem, 900+ integrations | Moderate (focused on multi-agent) | Growing (Pydantic ecosystem) |
| Stability | Active development (2.0), bi-weekly releases | Mature, frequent breaking changes | Stable for role-based use cases | Active development |