Skip to main content

ADR-070: ADK (Agent Development Kit) Integration

Status

Accepted - January 13, 2026

Track: T.2 - External Tools Integration

Context

Problem Statement

CODITECT has 150+ agents defined in markdown, but lacks:

  1. Multi-Agent Orchestration - No native patterns for sequential, parallel, or hierarchical agent coordination
  2. Standardized Evaluation - No built-in framework for testing agent accuracy and reliability
  3. Remote Agent Communication - No protocol for agent-to-agent communication across trust boundaries
  4. Code-First Development - Agents are markdown-defined, not programmatically composable

Solution: Google ADK

Agent Development Kit (ADK) is Google's open-source, code-first Python framework for building, evaluating, and deploying sophisticated AI agents.

Key Features:

FeatureDescription
Code-FirstDefine agent logic in Python for flexibility and testability
Multi-Agent PatternsSequential, Parallel, Loop, and Hierarchical orchestration
Rich Tool Ecosystem50+ tools including Google APIs, OpenAPI, MCP
Evaluation FrameworkBuilt-in testing with metrics and CI/CD integration
A2A ProtocolAgent-to-Agent communication for remote agents
A2UI IntegrationGenerate rich UIs via companion A2UI standard
Model-AgnosticWorks with Gemini, Claude, GPT, and others

ADK Version

  • Current: Latest from main branch (15.6K+ stars)
  • PyPI: pip install google-adk
  • Submodules: adk-python, adk-samples

Decision

Integrate ADK as the agent orchestration and evaluation backbone for CODITECT, enabling:

  1. CODITECT ↔ ADK Agent Bridge - Convert markdown agents to ADK format
  2. Multi-Agent Workflows - Use ADK patterns for complex orchestration
  3. Agent Evaluation - Built-in testing and quality gates
  4. A2A Protocol - Remote agent communication
  5. Integration with A2UI - Rich UI responses (see ADR-069)

Integration Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│ CODITECT + ADK INTEGRATION │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ CODITECT Agent Definitions │ │
│ │ (agents/*.md - 150+ agents) │ │
│ └───────────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ adk-coditect-adapter.py │ │
│ │ Converts markdown → ADK Python │ │
│ └───────────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ ADK Agent Types │ │
│ │ │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
│ │ │ LlmAgent │ │ Sequential │ │ Parallel │ │ Loop │ │ │
│ │ │ │ │ Agent │ │ Agent │ │ Agent │ │ │
│ │ │ Single LLM │ │ Pipeline │ │ Fan-out │ │ Iterative │ │ │
│ │ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │ │
│ └───────────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ┌────────────────────────┼────────────────────────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Runner │ │ Evaluator │ │ A2A Client │ │
│ │ Orchestrate │ │ Test/QA │ │ Remote Comm │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘

ADK Core Concepts

Agent Types

Agent TypeClassUse CaseExample
LLM AgentLlmAgentSingle agent with LLM reasoningChat assistant, code reviewer
Sequential AgentSequentialAgentOrdered pipelineResearch → Analyze → Report
Parallel AgentParallelAgentConcurrent executionMulti-source search
Loop AgentLoopAgentIterative refinementQuality improvement until threshold
HierarchicalLlmAgent with sub_agentsDelegation patternCoordinator → Specialists

Agent Definition

from google.adk.agents import Agent, LlmAgent

# Simple agent
search_agent = Agent(
name="search_assistant",
model="gemini-2.5-flash",
instruction="You are a helpful assistant that searches for information.",
description="An assistant that can search the web.",
tools=[google_search, web_fetch]
)

# Agent with sub-agents (hierarchical)
coordinator = LlmAgent(
name="coordinator",
model="gemini-2.5-flash",
instruction="Delegate tasks to appropriate specialists.",
sub_agents=[research_agent, writer_agent, editor_agent]
)

Multi-Agent Patterns

Sequential Pipeline

from google.adk.agents import SequentialAgent

research_pipeline = SequentialAgent(
name="research_pipeline",
agents=[
researcher, # Step 1: Gather information
analyzer, # Step 2: Analyze findings
reporter, # Step 3: Generate report
]
)

Parallel Fan-Out

from google.adk.agents import ParallelAgent

comprehensive_search = ParallelAgent(
name="multi_search",
agents=[
web_search_agent,
document_search_agent,
code_search_agent,
]
)

Iterative Loop

from google.adk.agents import LoopAgent

quality_loop = LoopAgent(
name="quality_refinement",
agent=editor_agent,
max_iterations=5,
stop_condition="quality_score >= 0.9"
)

Runner (Orchestration Engine)

The Runner manages agent execution lifecycle:

from google.adk import Runner

runner = Runner(agent=my_agent)

# Synchronous execution
response = runner.run(
session_id="session-123",
message="What is the weather in NYC?"
)

# Asynchronous execution
async for event in runner.run_async(session_id="session-123", message="..."):
print(event)

# Live bidirectional streaming
async for event in runner.run_live(session_id="session-123"):
# Audio/video streaming with Gemini Live
pass

Evaluation Framework

from google.adk.evaluation import Evaluator, EvalDataset

# Load dataset
dataset = EvalDataset.from_file("eval_datasets/test_set.json")

# Create evaluator
evaluator = Evaluator(
agent=my_agent,
dataset=dataset,
metrics=["accuracy", "tool_accuracy", "latency"]
)

# Run evaluation
results = await evaluator.run()

print(f"Accuracy: {results.accuracy:.2%}")
print(f"Tool Accuracy: {results.tool_accuracy:.2%}")
print(f"Avg Latency: {results.avg_latency:.0f}ms")

A2A Protocol (Agent-to-Agent)

from google.adk.a2a import A2AClient

# Connect to remote agent
remote_agent = A2AClient(
url="https://travel-agent.example.com",
auth_token="..."
)

# Send task (may return A2UI response)
response = await remote_agent.send_task(
task="Book a flight from SFO to JFK",
context={"date": "2026-01-20"}
)

CODITECT Components

Created Components (T.2)

TypeComponentPurpose
Agentadk-orchestratorMulti-agent coordination using ADK patterns
Agentadk-agent-builderBuild ADK agents from specifications
Skilladk-evaluationEvaluate agent performance
Skilladk-tool-integrationIntegrate tools with ADK agents
Command/adk-evalRun agent evaluations
Command/adk-runExecute ADK agents
Hookadk-agent-structure-validationValidate ADK agent directory structure
Workflowadk-agent-developmentEnd-to-end ADK development workflow
Scriptadk-coditect-adapter.pyConvert CODITECT agents to ADK format

CODITECT ↔ ADK Agent Mapping

CODITECT AgentADK PatternUse Case
senior-architectHierarchical coordinatorSystem design, delegation
testing-specialistLoopAgentIterative QA until quality threshold
devops-engineerSequentialAgentBuild → Test → Deploy pipeline
research-analystParallelAgentMulti-source information gathering
codi-documentation-writerLlmAgentSingle-purpose documentation

Usage Examples

Orchestrate Research Workflow

/agent adk-orchestrator "Coordinate research: parallel web/doc search, then sequential analysis and reporting"

Build Deployment Pipeline

/agent adk-orchestrator "Create sequential pipeline: lint → test → build → deploy with rollback"

Evaluate Agent Quality

/adk-eval agents/search-assistant eval_datasets/search_tests.json --min-accuracy 0.85

Convert CODITECT Agent to ADK

python scripts/adk-coditect-adapter.py convert agents/senior-architect.md --output adk_agents/

ADK Source Structure

adk-python/src/google/adk/
├── agents/ # Agent implementations
│ ├── base_agent.py # BaseAgent class
│ ├── llm_agent.py # LlmAgent (primary)
│ ├── loop_agent.py # LoopAgent (iterative)
│ ├── parallel_agent.py # ParallelAgent (concurrent)
│ └── sequential_agent.py # SequentialAgent (pipeline)
├── runners.py # Core orchestration engine
├── tools/ # 50+ tool integrations
│ ├── google_api_tool/ # Google APIs
│ ├── openapi_tool/ # OpenAPI specs
│ └── mcp_tool/ # Model Context Protocol
├── models/ # LLM integrations
│ ├── gemini/ # Gemini models
│ ├── anthropic/ # Claude integration
│ └── litellm/ # Multi-provider
├── evaluation/ # Evaluation framework
│ ├── evaluator.py # Main evaluator
│ ├── metrics/ # Built-in metrics
│ └── datasets/ # Dataset handling
├── sessions/ # Session management
├── memory/ # Long-term memory
├── a2a/ # Agent-to-Agent protocol
├── cli/ # CLI tools
└── telemetry/ # Observability

ADK Samples

40+ sample agents in adk-samples:

SampleCategoryDescription
hello_worldGetting StartedBasic agent
customer_serviceEnterpriseSupport chatbot
data_scienceAnalysisData analysis agent
travel_bookingMulti-agentA2A + A2UI integration
code_assistantDevelopmentCode generation
rag_agentRAGRetrieval-augmented agent
multi_tool_agentToolsTool orchestration

Implementation

Phase 1: Foundation (Complete)

  • Add adk-python submodule at submodules/tools/adk-python/
  • Add adk-samples submodule at submodules/tools/adk-samples/
  • Create adk-orchestrator agent
  • Create adk-agent-builder agent
  • Create adk-evaluation skill
  • Create adk-tool-integration skill
  • Create /adk-eval command
  • Create /adk-run command
  • Create adk-agent-structure-validation hook
  • Create adk-agent-development workflow
  • Create adk-coditect-adapter.py script

Phase 2: Agent Conversion (Planned)

  • Convert core CODITECT agents to ADK format
  • Build agent registry with ADK metadata
  • Create ADK test datasets for CODITECT agents
  • Implement evaluation CI/CD pipeline

Phase 3: Orchestration (Planned)

  • Build multi-agent workflow templates
  • Integrate with CODITECT task tracking
  • Add A2A support for remote CODITECT agents
  • Create visual workflow editor

Phase 4: Production (Planned)

  • Deploy ADK agents to Vertex AI
  • Integrate with CODITECT Cloud backend
  • Add production monitoring (telemetry)
  • Build customer-facing agent builder UI

Configuration

ADK Installation

# Install ADK
pip install google-adk

# Or from source
pip install git+https://github.com/google/adk-python.git@main

ADK CLI Commands

# Run agent
adk run agents/my_agent --message "Hello"

# Start web UI
adk web agents/my_agent --port 8080

# Evaluate agent
adk eval agents/my_agent eval_datasets/test.json

# Create new agent
adk create my_new_agent

CODITECT Configuration

File: ~/.coditect/config/adk.json

{
"adk": {
"default_model": "gemini-2.5-flash",
"agents_path": "~/.coditect/adk_agents/",
"eval_datasets_path": "~/.coditect/eval_datasets/",
"evaluation": {
"min_accuracy": 0.85,
"metrics": ["accuracy", "tool_accuracy", "latency"],
"parallel_workers": 4
},
"a2a": {
"enabled": true,
"auth_method": "oauth2"
}
}
}

Consequences

Positive

  1. Multi-Agent Orchestration - Sequential, Parallel, Loop, Hierarchical patterns
  2. Code-First Development - Python-based agent definitions
  3. Built-in Evaluation - Testing framework with metrics and CI/CD
  4. A2A Protocol - Remote agent communication
  5. A2UI Integration - Rich UI responses (ADR-069)
  6. Model-Agnostic - Works with Gemini, Claude, GPT
  7. 50+ Tools - Rich tool ecosystem
  8. Production Ready - Deploy to Cloud Run, Vertex AI
  9. Community - 15.6K+ stars, active development

Negative

  1. Python Dependency - Requires Python 3.10+ runtime
  2. Learning Curve - New patterns for existing CODITECT users
  3. Conversion Effort - 150+ agents to convert (gradual)
  4. Complexity - Multi-agent systems add orchestration complexity

Neutral

  1. Dual System - CODITECT markdown + ADK Python coexist
  2. Version Management - ADK evolves rapidly (bi-weekly releases)
  3. Google Ecosystem - Optimized for Gemini, but model-agnostic

Alternatives Considered

Option A: Build Custom Orchestration (Rejected)

Effort: 6-12 months development Reason: ADK provides mature orchestration patterns; no need to reinvent

Option B: LangChain Integration (Rejected)

Issue: Different abstraction level, heavier dependency Reason: ADK is more focused on agent orchestration, cleaner integration

Option C: AutoGen (Rejected)

Issue: Microsoft-specific, different multi-agent approach Reason: ADK's patterns align better with CODITECT architecture

Option D: CrewAI (Rejected)

Issue: Less mature, smaller ecosystem Reason: ADK has larger community, better Google integration

  • Submodules:
    • submodules/tools/adk-python/
    • submodules/tools/adk-samples/
  • Agents:
    • agents/adk-orchestrator.md
    • agents/adk-agent-builder.md
  • Skills:
    • skills/adk-evaluation/SKILL.md
    • skills/adk-tool-integration/SKILL.md
  • Commands:
    • commands/adk-eval.md
    • commands/adk-run.md
  • Hook: hooks/adk-agent-structure-validation.md
  • Workflow: workflows/devops/adk-agent-development.yaml
  • Script: scripts/adk-coditect-adapter.py
  • Track: internal/project/plans/2026-01-13T05-27-27Z-pilot-tracks/TRACK-T-TOOLS.md
  • ADR-069: A2UI Integration (companion ADR)

Appendix

A. ADK Agent Directory Structure (Required)

my_agent/
├── __init__.py # MUST contain: from . import agent
└── agent.py # MUST define: root_agent = Agent(...) OR app = App(...)

B. Evaluation Dataset Format

[
{
"input": "What is the capital of France?",
"expected_output": "Paris",
"expected_tool_calls": [],
"tags": ["geography", "simple"]
},
{
"input": "Book a flight from SFO to JFK",
"expected_output": null,
"expected_tool_calls": ["search_flights", "book_flight"],
"expected_tool_args": {
"search_flights": {"origin": "SFO", "destination": "JFK"}
},
"tags": ["booking", "multi-tool"]
}
]

C. CODITECT to ADK Conversion Example

Input (CODITECT markdown):

---
title: Code Reviewer
model: sonnet
tools: Read, Write, Edit
---

# Code Reviewer Agent

Review code for quality, security, and best practices.

Output (ADK Python):

from google.adk.agents import Agent
from google.adk.tools import read_file, write_file, edit_file

root_agent = Agent(
name="code_reviewer",
model="claude-sonnet-4",
instruction="Review code for quality, security, and best practices.",
description="Code review agent for CODITECT",
tools=[read_file, write_file, edit_file]
)

D. Quick Reference

# Install ADK
pip install google-adk

# Run agent
adk run agents/my_agent --message "Hello"

# Evaluate agent
adk eval agents/my_agent eval_datasets/test.json

# Web UI
adk web agents/my_agent

# CODITECT commands
/adk-eval agents/search-assistant tests.json
/adk-run agents/my_agent "Task description"
/agent adk-orchestrator "Create multi-agent workflow"
ResourceURL
Documentationhttps://google.github.io/adk-docs
Python ADKhttps://github.com/google/adk-python
Sampleshttps://github.com/google/adk-samples
Java ADKhttps://github.com/google/adk-java
Go ADKhttps://github.com/google/adk-go
ADK Webhttps://github.com/google/adk-web
A2A Protocolhttps://github.com/google-a2a/A2A
A2UIhttps://github.com/google/A2UI

Author: CODITECT Integration System Track: T.2 - ADK Integration Repository: google/adk-python