A minimal A2A agent that echoes messages back. The simplest starting point for understanding the A2A protocol.
- Agent card discovery via
/.well-known/agent-card.json SendMessageandGetTaskoperations- The one-call
A2A.agententrypoint -- a handler block that routes operations with pattern matching and returns a complete Rack app
git clone https://github.com/general-intelligence-systems/a2a.git
cd a2a/examples/basic
docker compose up -d --buildExpected output:
[+] Building 12.3s (9/9) FINISHED
[+] Running 1/1
✔ Container basic-agent-1 Started
docker compose logsExpected output:
agent-1 | 0.0s info: main [pid=1] [2025-05-01 12:00:00 +0000]
agent-1 | | Echo Agent starting...
agent-1 | 0.0s info: main [pid=1] [2025-05-01 12:00:00 +0000]
agent-1 | | Agent card: Echo Agent
agent-1 | 0.01s info: Falcon::Controller [pid=1] [2025-05-01 12:00:00 +0000]
agent-1 | | Starting Falcon Host ...
curl http://localhost:9292/.well-known/agent-card.jsonExpected output:
{
"name": "Echo Agent",
"description": "A simple echo agent that repeats your message.",
"url": "http://localhost:9292",
"version": "1.0.0"
}curl -X POST http://localhost:9292/ \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"SendMessage","params":{}}'Expected output:
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}This is a bare-bones echo agent -- it returns an empty response object. See the full example for a complete implementation with all 11 operations.
docker compose down| File | Purpose |
|---|---|
config.ru |
Rack entry point -- builds the agent with A2A.agent and boots the server |
agent_card.yml |
Agent card definition |
falcon.rb |
Falcon server config (binds to port 9292) |
Gemfile |
Dependencies |
Dockerfile |
Container build |
docker-compose.yml |
Single-service compose config |