This project demonstrates a minimal implementation of Google's Agent-to-Agent (A2A) protocol using Python. It features:
- A simple A2A server agent (
TellTimeAgent) built with Flask - A client agent that discovers and communicates with it
- Full compliance with the A2A message structure and discovery flow
This is perfect for beginners who want to understand how agents discover each other and exchange messages using A2A.
- Implements A2A discovery via
/.well-known/agent.json - Exposes a
tasks/sendendpoint for receiving tasks - Replies to queries with the current system time
- Client generates a task and parses the response using A2A conventions
a2a_samples/
├── server/
│ └── tell_time_server.py # Flask-based A2A server agent
├── client/
│ └── time_client.py # A2A client agent that queries the server
pip install flask requestscd a2a_samples/server
python tell_time_server.pyIn a separate terminal:
cd a2a_samples/client
python time_client.pyConnected to: TellTimeAgent – Tells the current time when asked.
Agent says: The current time is: 2025-04-16 22:10:45
Want to understand the A2A protocol in detail?
This project is licensed under the GNU General Public License v3.0.
See the LICENSE file for full details.