Effloow / Articles / Google ADK: Build Multi-Agent Systems with Python
Google ADK: Build Multi-Agent Systems with Python

Google ADK: Build Multi-Agent Systems with Python

Learn to build multi-agent AI systems with Google's Agent Development Kit (ADK). Code-first Python guide covering setup, orchestration, A2A, and deployment.

· Effloow Content Factory
#google-adk #multi-agent #python #ai-frameworks #gemini #vertex-ai #agent-development
Share

Why Google ADK Changes Multi-Agent Development

For most of 2024 and early 2025, building a multi-agent AI system meant making a hard choice: LangGraph for complex graph-based workflows, CrewAI for role-based team coordination, or AutoGen for conversational agent patterns. Each had trade-offs, and none of them was designed from the ground up with cloud deployment and cross-framework interoperability in mind.

Google's Agent Development Kit (ADK) changes that calculus. Introduced at Google Cloud NEXT in April 2025, ADK is an open-source, code-first Python toolkit that ships with three things none of its competitors have combined before: deep Gemini and Vertex AI integration, native support for MCP (Model Context Protocol) for tool connectivity, and first-class support for the Agent-to-Agent (A2A) protocol that lets your ADK agents talk to agents built in any other framework.

By April 2026, the main adk-python repository on GitHub has accumulated over 8,200 stars, and Google has expanded ADK to TypeScript, Go, and Java. The framework is now the foundation of Google's entire agent ecosystem — from the Vertex AI Agent Engine managed runtime to Codelabs production courses.

This guide walks you through everything: the core concepts, practical Python code, how to build a multi-agent pipeline, and how to deploy to production — without fabricating a single feature or benchmark.

What ADK Actually Is (and What It's Not)

ADK is not a wrapper around the Gemini API. It is a full orchestration framework where you define agents as Python code, compose them into hierarchies, attach tools, and ship them to managed infrastructure.

Here is the mental model: every ADK application is a tree of agents. At the root sits one agent that receives user input. That root agent can delegate tasks to sub-agents, which can themselves delegate further. At the leaves, agents execute tools — Python functions, OpenAPI endpoints, or MCP tool calls.

ADK provides four built-in agent types:

  • LlmAgent — a single LLM-backed agent that reasons, plans, and calls tools
  • SequentialAgent — executes sub-agents one after another, passing state between them
  • ParallelAgent — fans out sub-agents simultaneously and collects results
  • LoopAgent — retries a sub-agent until a condition is met or a max iteration count is hit

The orchestration agents (SequentialAgent, ParallelAgent, LoopAgent) do not themselves call an LLM — they are pure routing logic. This separation of concerns means you pay only for the LLM calls you actually need, and you can swap in any model at any node in the tree.

ADK is model-agnostic by design. While it is optimized for Gemini models and ships with first-class google-genai integration, it supports Anthropic Claude, OpenAI GPT, Llama, and any provider compatible with the LiteLLM interface.

Installation and Your First Agent in 10 Lines

Prerequisites

  • Python 3.9+
  • A Google AI Studio API key (for Gemini) or Vertex AI credentials (for production)

Install ADK

pip install google-adk

Set your API key:

export GOOGLE_API_KEY="your-api-key-here"

Minimal Agent

from google.adk.agents import LlmAgent
from google.adk.runners import InMemoryRunner
from google.genai import types

# Define a simple agent
agent = LlmAgent(
    name="assistant",
    model="gemini-2.5-flash",
    instruction="You are a helpful assistant. Answer concisely.",
)

# Run it
runner = InMemoryRunner(agent=agent, app_name="demo")
session = runner.session_service.create_session(app_name="demo", user_id="user1")

response = runner.run(
    user_id="user1",
    session_id=session.id,
    new_message=types.Content(
        role="user",
        parts=[types.Part(text="What is the capital of France?")]
    ),
)

for event in response:
    if event.is_final_response():
        print(event.content.parts[0].text)

The InMemoryRunner is for local development and testing. For production, you swap it for the VertexAiSessionService-backed runner without changing any agent code.

Building a Multi-Agent Pipeline

The real power of ADK emerges when you chain agents. Here is a practical example: a code review pipeline with three specialized agents running in sequence.

from google.adk.agents import LlmAgent, SequentialAgent
from google.adk.tools import FunctionTool

# Agent 1: Parses the code and identifies its language
parser_agent = LlmAgent(
    name="code_parser",
    model="gemini-2.5-flash",
    instruction="""Analyze the submitted code snippet.
    Output a JSON object with keys:
    - language (str): detected programming language
    - line_count (int): number of lines
    - summary (str): one-sentence description of what the code does
    Store the result in state['parse_result'].""",
    output_key="parse_result",
)

# Agent 2: Reviews for bugs and improvements
reviewer_agent = LlmAgent(
    name="code_reviewer",
    model="gemini-2.5-pro",
    instruction="""You are a senior engineer.
    Review the code described in {parse_result}.
    Identify up to 5 specific issues: bugs, security problems, or performance concerns.
    Be concrete — reference line numbers when possible.
    Store findings in state['review_findings'].""",
    output_key="review_findings",
)

# Agent 3: Produces the final report
report_agent = LlmAgent(
    name="report_writer",
    model="gemini-2.5-flash",
    instruction="""Based on {parse_result} and {review_findings},
    produce a structured Markdown code review report.
    Include: Executive Summary, Issues Found (with severity), and Recommendations.""",
)

# Wire them into a pipeline
pipeline = SequentialAgent(
    name="code_review_pipeline",
    sub_agents=[parser_agent, reviewer_agent, report_agent],
)

The output_key parameter tells ADK to save an agent's final response into the shared session state under that key. Downstream agents can reference it via {key_name} in their instruction strings. This shared state object is how agents pass data without explicit function arguments — it maps cleanly to how session state works in conversational AI.

Attaching Tools: Functions, OpenAPI, and MCP

Tools are what turn agents from chatbots into systems that do things. ADK supports three tool categories out of the box.

Python Function Tools

The simplest tool is a Python function. ADK uses the function signature and docstring to auto-generate the tool schema for the LLM:

from google.adk.tools import FunctionTool

def get_github_stars(repo: str) -> dict:
    """Fetch the current star count for a GitHub repository.

    Args:
        repo: Repository path in 'owner/repo' format (e.g., 'google/adk-python').

    Returns:
        A dict with 'stars' (int) and 'last_updated' (str).
    """
    import requests
    data = requests.get(f"https://api.github.com/repos/{repo}").json()
    return {"stars": data["stargazers_count"], "last_updated": data["updated_at"]}

tool = FunctionTool(func=get_github_stars)

agent = LlmAgent(
    name="repo_scout",
    model="gemini-2.5-flash",
    instruction="Help the user analyze GitHub repositories.",
    tools=[tool],
)

MCP Tool Integration

ADK has first-class support for the Model Context Protocol. Any MCP server — whether it exposes filesystem access, database queries, browser control, or custom APIs — can be wired directly into an ADK agent:

from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioServerParameters

mcp_toolset = MCPToolset(
    connection_params=StdioServerParameters(
        command="npx",
        args=["-y", "@modelcontextprotocol/server-filesystem", "/workspace"],
    )
)

agent = LlmAgent(
    name="filesystem_agent",
    model="gemini-2.5-flash",
    instruction="Help the user manage files in /workspace.",
    tools=[mcp_toolset],
)

This means you can reuse the same MCP servers you already configured for Claude Code or other MCP-compatible clients — no code changes to the servers required.

The A2A Protocol: Cross-Framework Agent Interoperability

The most architecturally significant feature of ADK in 2026 is not the agent types or the tool system — it is the native support for the Agent-to-Agent (A2A) protocol.

A2A is an open standard (announced by Google in April 2025, now maintained independently) that defines how agents from different frameworks communicate with each other. Each A2A-compatible agent publishes an Agent Card at a well-known URL (/.well-known/agent-card.json) describing its name, capabilities, and API endpoint.

Why does this matter? Because enterprise AI systems are not monolithic. A company might run a LangGraph workflow for customer support, a CrewAI research pipeline, and an ADK-based code review agent — all independently maintained by different teams. Without A2A, these systems are silos. With A2A, an ADK root agent can discover and invoke any of them as if they were local sub-agents.

Converting an ADK agent to an A2A-accessible server requires minimal code:

# Expose your ADK agent as an A2A server
from google.adk.a2a import A2AServer

server = A2AServer(
    agent=pipeline,                     # any ADK agent
    host="0.0.0.0",
    port=8080,
    agent_card={
        "name": "Code Review Pipeline",
        "description": "Reviews Python, TypeScript, and Go code.",
        "capabilities": ["code_review", "bug_detection"],
    }
)

server.serve()

Other frameworks consuming A2A endpoints treat this as a remote callable agent, fully discoverable via the Agent Card. This interoperability story is unique to ADK in 2026 — no other framework ships an open cross-vendor protocol in the box.

How ADK Compares to LangGraph and CrewAI

ADK occupies a specific niche in the multi-agent landscape. Understanding where it fits prevents spending three days building the wrong thing.

DimensionGoogle ADKLangGraphCrewAI
Orchestration modelAgent tree (hierarchical)Directed graph (cyclic OK)Role-based crews
Primary abstractionAgents + ToolsNodes + Edges + StateAgents + Tasks + Process
Model supportAny LLM (optimized for Gemini)Any LLM via LangChainAny LLM
MCP supportNative (first-class)Via integrationNative (first-class)
Cross-framework protocolA2A (native)None built-inA2A (native)
Cloud deploymentVertex AI Agent Engine, Cloud Run, GKELangSmith Cloud / self-hostCrewAI Enterprise / self-host
ObservabilityCloud Trace + Vertex AILangSmith (best-in-class)CrewAI+ dashboard
Maturity (April 2026)~1 year old~2.5 years old~2 years old
Best forGCP-native or cross-framework systemsComplex stateful workflowsRole-based team collaboration

The honest answer: if you are deeply in the Google Cloud ecosystem, ADK is the natural choice and the deployment story is unmatched. If you need the most mature observability tooling and your workflows are complex graphs with loops and conditional branches, LangGraph is still ahead. If your use case maps cleanly onto a team of roles collaborating on a project, CrewAI remains compelling.

For comparisons against the OpenAI Agents SDK, see our OpenAI Agents SDK guide and the broader AI agent frameworks comparison.

Deploying to Vertex AI Agent Engine

The InMemoryRunner is not for production. ADK's production deployment target is Vertex AI Agent Engine — a fully managed Google Cloud service that handles autoscaling, session management, authentication, and observability automatically.

# Install the Vertex AI SDK extra
pip install "google-adk[vertexai]"
import vertexai
from vertexai.preview import agent_engines
from google.adk.agents import LlmAgent

vertexai.init(project="my-project", location="us-central1")

# Build your agent
agent = LlmAgent(
    name="production_agent",
    model="gemini-2.5-flash",
    instruction="You are a production assistant.",
)

# Deploy — this packages, uploads, and deploys automatically
remote_agent = agent_engines.create(
    agent,
    requirements=["google-adk", "google-cloud-aiplatform"],
    display_name="production_agent",
)

print(f"Deployed: {remote_agent.resource_name}")

Once deployed, the agent is accessible via the Vertex AI API with enterprise-grade security, Cloud Trace integration, and automatic scaling to zero when idle. Costs are purely consumption-based — you pay for LLM tokens and compute time, nothing for idle capacity.

For containerized deployments on Cloud Run, ADK generates a Dockerfile from your agent code with a single CLI command:

adk deploy cloud-run --project my-project --region us-central1 my_agent/

Common Mistakes to Avoid

Circular agent references. ADK's tree structure does not support cycles at the agent level (that is LangGraph's domain). If you need a loop, use LoopAgent instead of manually referencing parent agents from children.

Putting all logic in a single LlmAgent. It is tempting to write one giant instruction and call it a day. The framework is designed for decomposition — smaller, focused agents with clear output_key contracts produce more reliable, testable, debuggable systems.

Not setting output_key on intermediate agents. If an intermediate agent in a SequentialAgent pipeline does not set output_key, its output lands in the conversation history but not in named state slots. Downstream agents cannot reliably reference it. Always name your outputs.

Assuming Gemini-only. ADK works with any LLM, but the LiteLLM adapter requires a separate install: pip install "google-adk[litellm]". If you are mixing Gemini and Claude at different nodes, this is the path.

Skipping the web UI for local development. ADK ships a browser-based agent testing UI you launch with adk web. It shows agent traces, tool calls, and state transitions in real time — far more useful than print statements.

adk web my_agent/
# Opens http://localhost:8000

FAQ

Q: Does Google ADK require Google Cloud to run?

No. ADK is open source (Apache 2.0) and runs entirely locally with any API key — including OpenAI, Anthropic, or Ollama for local models. Vertex AI and Cloud Run are production deployment options, not requirements. You can self-host using any container runtime.

Q: How is ADK different from Vertex AI Agent Builder?

Vertex AI Agent Builder is a managed, often no-code/low-code platform for creating agents with pre-built connectors. ADK is the code-first SDK underneath it. In Google's current stack, Agent Builder can use ADK agents as its backend, but ADK itself has no GUI dependency.

Q: Can ADK agents talk to agents built with LangGraph or CrewAI?

Yes, via the A2A protocol. Any framework that implements the A2A spec can expose agents as A2A servers and consume them as remote sub-agents. Google, CrewAI, and a growing list of vendors have committed to the protocol. LangGraph does not yet have native A2A support (as of April 2026), but agents can be wrapped manually.

Q: What models work best with ADK?

Google's own benchmarks and the developer community both point to Gemini 2.5 Pro for complex reasoning tasks requiring multi-step planning and Gemini 2.5 Flash for speed-sensitive or cost-sensitive tasks. For privacy-sensitive workflows, Ollama-hosted Llama 4 Scout or Gemma models run locally with no data leaving your infrastructure.

Q: Is ADK production-ready in 2026?

ADK is roughly one year old as of April 2026. Its Vertex AI Agent Engine deployment path is production-grade and backed by Google SLAs. The framework's local orchestration engine has been stable since 0.3.x. For greenfield GCP-native projects, yes. For existing complex LangGraph workflows, migration costs likely outweigh benefits today.

Key Takeaways

  • ADK = tree of agents. A root agent delegates to sub-agents. SequentialAgent, ParallelAgent, and LoopAgent handle orchestration without burning LLM tokens.
  • The 3-protocol stack is the differentiator. ADK + MCP (for tools) + A2A (for cross-framework agent calls) gives you an open, interoperable architecture no other single framework provides today.
  • Model-agnostic, Gemini-optimized. Works with any LLM, but the tightest integration and best deployment story is on Google Cloud with Gemini 2.5.
  • output_key is the state contract. Always set it on intermediate agents in pipelines so downstream agents can reliably reference results.
  • The deployment ramp is real. adk web for local dev → InMemoryRunner for testing → Vertex AI Agent Engine or Cloud Run for production is a coherent, low-friction path.
Bottom Line

Google ADK is the right choice if you are building on GCP, want a clean code-first Python experience, or need genuine cross-framework agent interoperability via A2A. It is one year old — the APIs are stable, the Vertex AI deployment story is production-grade, but the observability tooling has not yet caught LangSmith. For most developers starting a multi-agent project today, ADK deserves a serious look, especially if Gemini is already in your stack.

Get weekly AI tool reviews & automation tips

Join our newsletter. No spam, unsubscribe anytime.