A2A Python Tutorial: Build, Run and Call an Agent

A2A Python Tutorial: Build, Run and Call an Agent

This series walks you through building, running, and calling an A2A agent with the Python SDK in eight steps, from a first echo server to streaming and multi-turn interactions with an LLM example.

Before you start, pick your path — and note where the no-key guarantee ends:

  • The standard-library path needs nothing but Python. The local first-reply sample runs a loopback echo server and a client with the Python standard library alone — no SDK, no API key, no model, no account.
  • The SDK path through step 6 also runs key-free. This series runs the official helloworld agent from a2a-samples: you clone one pinned commit, install the SDK with pinned versions (a2a-sdk==1.3.0), and by step 6 you have completed a first request and reply on loopback — still no API key, no model, no account. Setup covers every command. The steps as published were verified on this site on 2026-11-14 against that pinned commit and those pinned versions (Python 3.12); they are not a compatibility guarantee for newer upstream releases.
  • Step 7 is where that changes. The LangGraph example needs a Gemini API key and its own dependencies; go straight to Streaming and Multi-Turn Interactions if that is where you are heading.

By the end, you will have run an echo A2A server, called it from a client, and seen how streaming and multi-turn interactions work in the LangGraph-based example. New to the protocol itself? Start with What is A2A? .

  1. Introduction
  2. Setup
  3. Agent Skills and Agent Card
  4. The Agent Executor
  5. Starting the Server
  6. Interacting with the Server
  7. Streaming and Multi-Turn Interactions
  8. Next Steps

All sample code comes from the official a2a-samples repository. For tutorials in other languages, see Tutorials .