How google-a2a/a2a-python works
Project type and purpose
• This is an open-source Python SDK (“a2a-sdk”) that implements the Agent2Agent (A2A) protocol.
• It provides both a client library (to call A2A servers) and a server framework (to host agentic applications).
• Key use case: allow developers to build “agent servers” and invoke them via gRPC or JSON-RPC transports.
File structure
• Top-level “src/a2a” contains five main packages:
• auth – user authentication models
• client – A2A client classes and helpers
• grpc – generated protobuf stubs and gRPC wiring
• server – server framework (subpackages for apps, agent execution, events, request handlers, and tasks)
• utils – shared utilities (artifact, telemetry, proto conversions)
• Configuration & build: buf.gen.yaml for Protobuf codegen, pyproject.toml / noxfile.py for packaging and testing.
• Tests exercise every submodule and integration flows.
README for additional insights
• Confirms dual client/server nature.
• Examples show a remote agent running a server, and a client invoking it.
• Underlying transports: gRPC and JSON-RPC (via FastAPI/Starlette).
Don’t over-complicate—capture essential elements
• Them in the order a request flows.
• Abstract interfaces vs. default (in-memory) implementations.
• Call out external dependencies (e.g., replaceable queues, DBs, telemetry sinks).