A hands-on engineering lab for exploring the Google Agent Development Kit (ADK). Each experiment investigates how ADK works internally through documentation, source code analysis, runtime verification, and database inspection, with every finding backed by practical experimentation.
Most Google ADK examples demonstrate how to build an agent.
This repository focuses on understanding how Google ADK works internally.
Each experiment follows the same engineering methodology:
- Read the official documentation
- Explore the ADK source code
- Build a runnable example
- Verify runtime behavior
- Inspect the SQLite database (where applicable)
- Document only verified findings
The objective is to build a deep understanding of AI agent runtime architecture rather than simply producing working examples.
This repository explores:
- Runtime Bootstrapping
- Session Management
- Persistent Conversation Memory
- Conversation State
- Event Lifecycle
- Context Management
- Event Compaction
- Token Optimization
- Streaming Responses
- Model Context Protocol (MCP)
- Semantic Routing
- Agent Delegation
- Invocation Lifecycle
- Coordinator Agent Architecture
- Long-Term Memory
- Retrieval-Augmented Generation (RAG)
- Production Deployment Patterns
- Python 3.14
- Google Agent Development Kit (ADK)
- Google Gemini 2.5 Flash
- Vertex AI
- Google Cloud Platform
- SQLite
- Model Context Protocol (MCP)
- Google Maps MCP Server
- AgentTool
The objective of this repository is to:
- Explore Google ADK concepts through practical implementation
- Understand the runtime architecture behind ADK
- Document observations from each experiment
- Evaluate production-oriented design patterns
- Build reusable runtime components
- Serve as a reference for future ADK projects
- Custom Runtime Launcher
- Runtime Bootstrapping
- Runner
- Session Management
- In-Memory Session Service
- Persistent Session Management
- Conversation Memory
- Environment Configuration
- Event Lifecycle
- Context Reconstruction
- Event Compaction
- Context Management
- Token Optimization
- Google Maps MCP Integration
- Multi-Agent Coordination using AgentTool
- Google Maps MCP Tool Integration
- Coordinator Agent
- Semantic Routing
- Streaming Responses
Current Focus: Investigating how Google ADK implements streaming responses, emits Partial Events, reconstructs final Events, and manages the complete streaming execution lifecycle.
| Experiment | Status |
|---|---|
| β Experiment 01 β Building a Custom ADK Runtime | Completed |
| β Experiment 02 β Implementing Persistent Session Management | Completed |
| β Experiment 03 β Understanding Conversation State | Completed |
| β Experiment 04 β Understanding Event Lifecycle | Completed |
| β Experiment 05 β Context Management & Token Optimization | Completed |
| π§ Experiment 06 β Streaming Responses | In Progress |
| β Experiment 07 β Google Maps MCP Integration | Completed |
| β Experiment 08 β Multi-Agent Coordination using AgentTool | Completed |
The implementation in this repository follows these principles:
- Single Responsibility Principle (SRP)
- Separation of Concerns
- Modular Runtime Design
- Reusable Components
- Production-Oriented Architecture
- Incremental Experimentation
Every conclusion in this repository is based on evidence rather than assumptions.
Whenever possible, findings are verified through:
- Official Google ADK documentation
- ADK source code analysis
- Runtime experiments
- SQLite database inspection
Only verified observations are documented.
Each experiment validates findings by comparing runtime behavior with the Google ADK source code to ensure conclusions accurately reflect the framework's implementation.
The following diagram illustrates the high-level runtime architecture used throughout the experiments.
User
β
βΌ
python -m launcher.run
β
βΌ
bootstrap.py
β
βββββββββββββΌβββββββββββββ
βΌ βΌ βΌ
env.py session.py runner.py
β β² β
βΌ β βΌ
Vertex AI Config β Runner Execution
β β
ββββββββββββββ
β
βΌ
DatabaseSessionService
β
βΌ
SQLite Database
β
βΌ
Session Events
β
βΌ
Context Reconstruction
β
βΌ
Event Compaction (Optional)
β
βΌ
Coordinator Agent
β
ββββββββββββββββ
βΌ βΌ
Conversation Google Maps
Context Agent MCP Agent
β β
ββββββββ¬ββββββββ
βΌ
Gemini Model
β
βΌ
Final Response
.
β
βββ launcher/
β βββ __init__.py
β βββ console.py
β βββ run.py
β
βββ runtime/
β βββ __init__.py
β βββ bootstrap.py
β βββ config.py
β βββ context.py
β βββ env.py
β βββ logger.py
β βββ runner.py
β βββ session.py
β
βββ experiments/
β βββ Experiment-01-Building-a-Custom-ADK-Launcher.md
β βββ Experiment-02-Implementing-Persistent-Session-Management.md
β βββ Experiment-03-Understanding-Conversation-State.md
β βββ Experiment-04-Understanding-Event-Lifecycle.md
β βββ Experiment-05-Context-Management-and-Token-Optimization.md
β βββ Experiment-05βRuntime-Verification-of-Event-Compaction.md
β βββ Experiment-07-Google-Maps-MCP-Integration.md
β βββ Experiment-08-Multi-Agent-Coordination-using-AgentTool.md
β
βββ data/
β
βββ multi_tool_agent/
β βββ __init__.py
β βββ agent.py
β
βββ common/
β βββ __init__.py
β βββ agent.py
β βββ coordinator/
β βββ __init__.py
β βββ agent.py
β
βββ context_agent/
β βββ __init__.py
β βββ agent.py
β
βββ mcp_integration/
β βββ __init__.py
β βββ agent.py
β
βββ .env.example
βββ .gitignore
βββ requirements.txt
βββ README.md
git clone https://github.com/a1108/google-adk-experiments.git
cd google-adk-experimentspython -m venv .venvsource .venv/bin/activate.venv\Scripts\activatepip install -r requirements.txtCopy .env.example to .env and update the required values.
Example:
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_CLOUD_PROJECT=<your-project-id>
GOOGLE_CLOUD_LOCATION=us-central1Launch the custom runtime:
python -m launcher.runadk webThe custom runtime automatically:
- Loads environment variables
- Initializes the session service
- Loads or creates a conversation session
- Creates the ADK Runner
- Starts the interactive console
Each experiment builds upon previous work and explores one architectural concept in Google ADK.
Every experiment documents:
- Objective
- Research Questions
- Runtime Verification
- Architecture / Runtime Flow
- Findings
- Verification Checklist
- References
| Experiment | Status |
|---|---|
| Experiment 01 β Building a Custom ADK Runtime | β |
| Experiment 02 β Persistent Session Management | β |
| Experiment 03 β Understanding Conversation State | β |
| Experiment 04 β Understanding Event Lifecycle | β |
| Experiment 05 β Context Management & Token Optimization | β |
| Experiment 06 β Streaming Responses | π§ |
| Experiment 07 β Google Maps MCP Integration | β |
| Experiment 08 β Multi-Agent Coordination using AgentTool | β |
Every concept in this repository follows the same engineering process.
Read Documentation
β
βΌ
Explore Source Code
β
βΌ
Build Experiment
β
βΌ
Run & Verify
β
βΌ
Inspect Runtime
β
βΌ
Document Findings
The focus is on understanding the underlying architecture rather than simply building a working example.
β Built a custom Google ADK runtime
β Explored ADK runtime architecture through engineering experiments
β Implemented persistent conversation memory
β Investigated Event Lifecycle, Context Reconstruction, Event Compaction and Token Optimization
β Built a Google Maps MCP specialist agent
β Implemented a Coordinator Agent using AgentTool
β Verified semantic routing using ADK Trace
β Investigated Invocation lifecycle during delegated agent execution
β Structured the repository as an engineering lab instead of isolated examples
- Google Agent Development Kit (ADK) Documentation
- Google ADK GitHub Repository
- Google Gemini Documentation
- Vertex AI Documentation
- Model Context Protocol Specification
Upcoming experiments will explore:
- Streaming Responses
- Long-Term Memory
- Retrieval-Augmented Generation (RAG)
- Production Deployment Patterns
- Advanced Multi-Agent Workflows
This repository is intended for educational purposes, experimentation, and knowledge sharing.
Feel free to explore the code, learn from the experiments, and adapt the ideas for your own projects.