learning-it by example

Back to the video

Agent2Agent (A2A) Protocol With Working Python Code

Two agents that share no code can still work together, if they share a protocol.

Video #32 ยท AI agents and MCP

Steps in the video

  1. 0:00 Two agents, no shared code, and one business card
  2. 0:29 The idea
  3. 1:07 Setup
  4. 1:36 The price agent
  5. 2:11 Served over A2A
  6. 2:32 The client agent
  7. 3:29 What this does not show
  8. 4:01 Mistakes to avoid
  9. 4:29 My take and next steps
  10. 5:03 Recap

Files

  • client_agent.py (27 lines)
  • price_agent.py (46 lines)
  • run.py (17 lines)

Download the code (zip)

Tested with

Python 3.12.15 | a2a-sdk[http-server]==1.2.3, uvicorn==0.54.0

What this does not show

One made-up price agent and one client on one machine, with no authentication, no HTTPS, no streaming, no input-required tasks and no push notifications. No language model is involved; the answer comes from a small table.

Sources

Learning IT by Example.