Welcome to TellTimeAgent and the Multi-Agent demo β a minimal Agent2Agent (A2A) implementation using Google's Agent Development Kit (ADK).
This example demonstrates how to build, serve, and interact with three A2A agents:
- TellTimeAgent β replies with the current time.
- GreetingAgent β fetches the time and generates a poetic greeting.
- OrchestratorAgent β routes requests to the appropriate child agent.
All of them work together seamlessly via A2A discovery and JSON-RPC.
version_3_multi_agent/
βββ .env # Your GOOGLE_API_KEY (not committed)
βββ pyproject.toml # Dependency config
βββ README.md # You are reading it!
βββ app/
β βββ cmd/
β βββ cmd.py # CLI to interact with the OrchestratorAgent
βββ agents/
β βββ tell_time_agent/
β β βββ __main__.py # Starts TellTimeAgent server
β β βββ agent.py # Gemini-based time agent
β β βββ task_manager.py # In-memory task handler for TellTimeAgent
β βββ greeting_agent/
β β βββ __main__.py # Starts GreetingAgent server
β β βββ agent.py # Orchestrator that calls TellTimeAgent + LLM greeting
β β βββ task_manager.py # Task handler for GreetingAgent
β βββ host_agent/
β βββ entry.py # CLI to start OrchestratorAgent server
β βββ orchestrator.py # LLM router + TaskManager for OrchestratorAgent
β βββ agent_connect.py # Helper to call child A2A agents
βββ server/
β βββ server.py # A2A JSON-RPC server implementation
β βββ task_manager.py # Base in-memory task manager interface
βββ utilities/
βββ discovery.py # Finds agents via `agent_registry.json`
βββ agent_registry.json # List of child-agent URLs (one per line)-
Clone & navigate
git clone https://github.com/theailanguage/a2a_samples.git cd a2a_samples/version_3_multi_agent -
Create & activate a venv
python3 -m venv .venv source .venv/bin/activate -
Install dependencies
Using
uv:uv pip install .Or with pip directly:
pip install . -
Set your API key
Create
.envat the project root:echo "GOOGLE_API_KEY=your_api_key_here" > .env
Start the TellTimeAgent
python3 -m agents.tell_time_agent \
--host localhost --port 10000Start the GreetingAgent
python3 -m agents.greeting_agent \
--host localhost --port 10001Start the Orchestrator (Host) Agent
python3 -m agents.host_agent.entry \
--host localhost --port 10002Launch the CLI (cmd.py)
python3 -m app.cmd.cmd --agent http://localhost:10002Try it out!
> What time is it?
Agent says: The current time is: 2025-05-05 14:23:10
> Greet me
Agent says: Good afternoon, friend! The golden sun dips low...- Discovery: OrchestratorAgent reads
utilities/agent_registry.json, fetches each agentβs/β.well-known/agent.json. - Routing: Based on intent, the Orchestratorβs LLM calls its tools:
list_agents()β lists child-agent namesdelegate_task(agent_name, message)β forwards tasks
- Child Agents:
- TellTimeAgent returns the current time.
- GreetingAgent calls TellTimeAgent then crafts a poetic greeting.
- JSON-RPC: All communication uses A2A JSON-RPC 2.0 over HTTP via Starlette & Uvicorn.
- A2A GitHub: https://github.com/google/A2A
- Google ADK: https://github.com/google/agent-development-kit