This document provides a high-level overview of the Agent Development Kit (ADK) Python framework, describing its architecture, core components, and how different subsystems interact. ADK is a code-first Python framework for building, evaluating, and deploying AI agents with support for multi-agent orchestration, tool integration, and flexible deployment options.
For installation and setup instructions, see Installation. For creating your first agent, see Quick Start Guide. For detailed information about specific subsystems, refer to the respective sections: Agent System, Tools and Extensions, Evaluation and Testing, and Deployment.
Agent Development Kit (ADK) is a flexible, modular framework that applies software development principles to AI agent creation. It is designed to simplify building, deploying, and orchestrating agent workflows from simple tasks to complex multi-agent systems. While optimized for Google's Gemini models and the Google ecosystem, ADK is model-agnostic and deployment-agnostic.
Sources: README.md1-30 pyproject.toml5-6
The following diagram illustrates the overall system architecture, showing how different components interact:
Sources: src/google/adk/cli/cli_tools_click.py1-210 src/google/adk/cli/adk_web_server.py447-602 src/google/adk/cli/fast_api.py73-267
The agent system is built around a hierarchy of agent types, all inheriting from BaseAgent:
| Agent Type | Description | Key File |
|---|---|---|
BaseAgent | Abstract base class defining the agent interface | agents/base_agent.py |
LlmAgent | Agents that interact with LLMs and use tools | agents/llm_agent.py |
SequentialAgent | Orchestrates sub-agents in sequence | agents/sequential_agent.py |
ParallelAgent | Runs sub-agents concurrently | agents/parallel_agent.py |
LoopAgent | Repeats sub-agent execution | agents/loop_agent.py |
Agents can be defined in Python code or using YAML configuration files (agent.yaml).
Sources: README.md101-137
The orchestration layer manages agent execution and state:
The Runner class orchestrates agent execution within an InvocationContext, which provides access to services and manages execution state.
Sources: src/google/adk/cli/adk_web_server.py517-566
ADK uses a service-oriented architecture with pluggable backends:
| Service | Purpose | Implementations |
|---|---|---|
BaseSessionService | Manages conversation sessions and state | InMemorySessionService, DatabaseSessionService, VertexAiSessionService |
BaseArtifactService | Stores files and binary artifacts | InMemoryArtifactService, LocalArtifactService, GcsArtifactService |
BaseMemoryService | Long-term memory storage and retrieval | InMemoryMemoryService, VertexAiMemoryService |
BaseCredentialService | Authentication and credential management | InMemoryCredentialService |
Sources: src/google/adk/cli/fast_api.py49-51 src/google/adk/cli/fast_api.py164-192
The tool system enables agents to interact with external systems:
Tools are converted to function declarations that LLMs can invoke. The canonical_tools resolution process handles tool discovery and registration.
Sources: README.md44-46 contributing/samples/adk_triaging_agent/agent.py249-301
ADK provides three primary entry points for interacting with agents:
The adk command provides access to all major functionality:
Sources: src/google/adk/cli/cli_tools_click.py206-210 pyproject.toml82-83
The web UI provides a browser-based development interface:
The web UI is served at http://localhost:8000 when running adk web or adk run --web.
Sources: src/google/adk/cli/fast_api.py98-267 src/google/adk/cli/adk_web_server.py677-749
ADK can be used directly as a Python library:
Sources: README.md88-114
Agents can be created using the CLI command or by writing Python/YAML directly:
This generates:
my_agent/agent.py - Main agent definitionmy_agent/root_agent.yaml - Alternative YAML definition (optional)my_agent/requirements.txt - Dependenciesmy_agent/.env - Environment variablesSources: src/google/adk/cli/cli_tools_click.py410-471
Sources: src/google/adk/cli/cli_tools_click.py576-671 src/google/adk/cli/cli_tools_click.py702-967
The deployment process generates appropriate configuration files (Dockerfile, Kubernetes manifests, etc.) and executes deployment commands.
Sources: src/google/adk/cli/cli_deploy.py65-102 README.md59-60
State is hierarchical with three persistent scopes (app, user, session) plus ephemeral temp state. State changes are captured as deltas in events and atomically applied to storage.
Sources: src/google/adk/cli/adk_web_server.py650-676
The evaluation framework operates in two phases: inference generation (using a UserSimulator to create conversations) and metric evaluation (scoring against defined rubrics).
Sources: src/google/adk/cli/cli_tools_click.py702-967
ADK supports multiple deployment targets, each with different characteristics:
| Target | Use Case | Configuration | Scaling |
|---|---|---|---|
| Cloud Run | Fully managed containerized deployment | Dockerfile generated automatically | Auto-scaling, serverless |
| Vertex AI Agent Engine | Managed Vertex AI integration | ReasoningEngine with ADK wrapper | Managed by Google |
| GKE | Self-managed Kubernetes | Kubernetes manifests generated | Manual control |
| Local | Development and testing | Direct Python execution | Single instance |
All deployment targets run the same AdkWebServer FastAPI application, ensuring consistency across environments.
Sources: src/google/adk/cli/cli_deploy.py410-469 README.md59-60
LiteLlm and custom implementationsSources: README.md26-30 README.md42-61
ADK integrates with the A2A (Agent-to-Agent) protocol for remote agent communication:
A2A support is enabled via the --a2a flag when running the web server, which exposes A2A protocol endpoints for each agent with an agent.json file.
Sources: src/google/adk/cli/fast_api.py525-593 README.md85-90
The repository includes several sample agents demonstrating ADK capabilities:
contributing/samples/adk_triaging_agent/) - Automated issue triaging using GitHub API toolscontributing/samples/adk_pr_triaging_agent/) - Pull request analysis and labelingcontributing/samples/adk_issue_formatting_agent/) - Issue template validationThese samples demonstrate real-world tool integration, multi-step workflows, and GitHub Actions integration.
Sources: contributing/samples/adk_triaging_agent/agent.py1-302 .github/workflows/triage.yml1-56
Refresh this wiki
This wiki was recently refreshed. Please wait 2 days to refresh again.