Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

🤖 TellTimeAgent - A2A Agent Using Google ADK

Welcome to TellTimeAgent — a minimal Agent2Agent (A2A) implementation using Google's Agent Development Kit (ADK).

This example demonstrates how to build, serve, and interact with a Gemini-powered agent that replies with the current time.


📦 Project Structure

a2a_samples/version_2_adk_agent/
├── .env                       # API key goes here (not committed)
├── pyproject.toml            # Dependency config (used with uv or pip)
├── README.md                 # You're reading it!
├── app/
│   └── cmd/
│       └── cmd.py            # Command-line app to talk to the agent
├── agents/
│   └── google_adk/
│       ├── __main__.py       # Starts the agent + A2A server
│       ├── agent.py          # Gemini agent definition using Google ADK
│       └── task_manager.py   # Handles task lifecycle
├── server/
│   ├── server.py             # A2A server logic (routes, JSON-RPC)
│   └── task_manager.py       # In-memory task storage + interface
└── models/
    ├── agent.py              # AgentCard, AgentSkill, AgentCapabilities
    ├── json_rpc.py           # JSON-RPC request/response formats
    ├── request.py            # SendTaskRequest, A2ARequest union
    └── task.py               # Task structure, messages, status

🚀 Features

✅ Gemini-powered A2A agent using Google ADK
✅ Follows JSON-RPC 2.0 specification
✅ Supports session handling and memory
✅ Custom A2A server implementation (non-streaming)
✅ CLI to interact with agent
✅ Fully commented and beginner-friendly


💠 Setup

1. Clone and navigate to the repo

git clone https://github.com/your-username/a2a-adk-telltime-agent.git
cd a2a_samples/version_2_adk_agent

2. Create virtual environment

python3 -m venv .venv
source .venv/bin/activate

3. Install dependencies

Using uv:

uv pip install .

Or using pip (if you generated a requirements.txt):

pip install -r requirements.txt

🔑 API Key Setup

Create a .env file in the root directory:

touch .env

And add your Gemini API key:

GOOGLE_API_KEY=your_api_key_here

▶️ Running the Agent

In one terminal window:

source .venv/bin/activate
cd a2a_samples/version_2_adk_agent
python3 -m agents.google_adk

You should see:

Uvicorn running on http://localhost:10002

🧑‍💻 Running the Client

Open a second terminal window:

source .venv/bin/activate
cd a2a_samples/version_2_adk_agent
python3 -m app.cmd.cmd --agent http://localhost:10002

You can now type messages like:

what time is it?

And get a Gemini-powered response!


🔍 Agent Workflow (A2A Lifecycle)

  1. The client queries the agent using a CLI (cmd.py)
  2. The A2A client sends a task using JSON-RPC to the A2A server
  3. The server parses the request, invokes the task manager
  4. The task manager calls the Gemini-powered TellTimeAgent
  5. The agent responds with current system time
  6. The server wraps the response and sends it back to the client

📸 Screenshot (Optional)

Add a screenshot or GIF of the CLI interaction here!


📜 License

MIT — free for personal and commercial use.


🙌 Acknowledgements


🌐 Connect with Me