CI status Python 3.9+ License MIT JSON-RPC 2.0

🤖 A2A Protocol

Multi-Agent Communication for AI Agents

A clean, open-source reference implementation of the Agent-to-Agent (A2A) protocol — specialized AI agents that discover each other and collaborate over JSON-RPC 2.0. Built with Python, FastAPI and Pydantic.

What is A2A?

Instead of one monolithic model doing everything, the A2A pattern splits work across focused agents that expose their capabilities and talk to each other over plain HTTP. A coordinator analyzes each problem, routes it to the right specialist agent(s), and merges the results — and because the transport is just JSON-RPC, agents built on different frameworks can interoperate.

🧮 Math Agent

Arithmetic, statistics, linear algebra and probability distributions — with safe, AST-based expression evaluation.

port 8001

📊 Data Analyst Agent

Correlation analysis, distribution summaries, reports and visualizations powered by pandas & matplotlib.

port 8002

🧭 Orchestrator

Analyzes a problem, decides which agents are needed, routes the work and combines answers into one solution.

coordinator

Architecture at a glance

graph TD
    U["👤 User / Caller"] --> O["🧭 Multi-Agent Orchestrator
analyze · route · combine"] O -->|JSON-RPC 2.0| MA["🧮 Math Agent
:8001"] O -->|JSON-RPC 2.0| DA["📊 Data Analyst Agent
:8002"] MA <-->|A2A Protocol over HTTP| DA

Every agent publishes an Agent Card at / and /.well-known/agent.json for runtime capability discovery. Read the full design — sequence diagrams, data model and extension guide — in the Technical Architecture.

Quick start

# 1. Clone & install
git clone https://github.com/rrahimi-uci/a2a-poc.git
cd a2a-poc
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

# 2. Launch the whole system (both agents + demo)
python scripts/launch_system.py

Or talk to an agent directly with one curl:

curl -X POST http://localhost:8001/ \
  -H "Content-Type: application/json" \
  -d '{"id":"1","jsonrpc":"2.0","method":"message/send",
       "params":{"message":{"role":"user",
       "parts":[{"kind":"text","text":"calculate mean of [1,2,3,4,5]"}]}}}'

Why it's useful

Learn more