The delegate agent demonstrates A2A delegation with Python ADK. This agent showcases:
- Agent-to-Agent (A2A) communication patterns
- RESTful API endpoints
- Health monitoring
- Docker containerization
- Multi-platform deployment
Before you begin, ensure you have the following tools installed:
- uv package manager
- Docker for containerization
- Make for build automation
Copy the .env template and add the Google API key:
cp .env.example .envRun the agent with:
# Native Python environment
make run
# Docker container
make docker-runAfter successful start, the agent will be available at:
- Server: http://127.0.0.1:8100
- Agent Card: http://127.0.0.1:8100/.well-known/agent-card.json
Ask the agent a question using curl:
curl http://localhost:8100/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "message/send",
"params": {
"message": {
"role": "agent",
"parts": [
{
"kind": "text",
"text": "What is the weather in New York?"
}
],
"messageId": "9229e770-767c-417b-a0b0-f0741243c589",
"contextId": "abcd1234-5678-90ab-cdef-1234567890ab"
},
"metadata": {}
}
}' | jqThe agent can be configured using environment variables:
AGENT_A2A_RPC_URL: Base URL for the Agent-to-Agent communicationSUB_AGENTS: JSON map of sub agents to delegate to. Format:{"agent_name": {"url": "http://agent-url/.well-known/agent-card.json"}}(default: empty)
The delegate agent can work with multiple sub agents by configuring the SUB_AGENTS environment variable. Each sub agent is defined by its name and the URL to its agent card. See .env.example for an example configuration.