Building Multi-Agent Systems with A2A Inbound Adapter
What We're Buildingā
In this hands-on guide, we'll build a multi-agent system that exposes specialized Agentverse uAgents through the A2A protocol. By the end, you'll have:
- Multiple A2A endpoints running on different ports
- Specialized agents accessible to A2A clients
- Real-world examples of agent coordination and discovery
- Production-ready configuration for deployment
We'll create two specialized agents:
- Perplexity Search Agent - AI-powered web search and research
- Finance Q&A Agent - Financial analysis and planning assistance
Architectureā

Each agent will run as a separate A2A server, allowing A2A clients to discover and use them independently or in coordination.
š ļø Step 1: Installationā
Install the A2A Inbound adapter package:
pip install "uagents-adapter[a2a-inbound]"
This installs all required dependencies including:
a2a-sdk[all,sqlite]>=0.2.11- A2A SDK with all features + SQLite supportuvicorn>=0.27.0- ASGI server for running the A2A bridge serverhttpx>=0.25.0- Async HTTP clientclick>=8.0.0- CLI framework for command-line interfacepython-dotenv>=1.0.0- Environment variable management
Step 2: Choose Your Agentsā
You have two options for agents:
Option A: Use Existing Agents from Agentverse Marketplaceā
- Visit Agentverse.ai
- Browse the marketplace for agents that match your needs
- Copy the agent address from the agent's profile page
- Ensure the agent is active and responding to messages
Option B: Build Your Own Agentsā
- Create uAgents using the uAgents framework
- Register on Agentverse and get them running
- Copy the agent addresses from your agent profiles
- Test that they respond to chat messages
For this tutorial, we'll use pre-configured agents from the marketplace:
- Perplexity Search Agent:
agent1qgzd0c60d4c5n37m4pzuclv5p9vwsftmfkznksec3drux8qnhmvuymsmshp - Finance Q&A Agent:
agent1qdv2qgxucvqatam6nv28qp202f3pw8xqpfm8man6zyegztuzd2t6yem9evl
Step 3: Build the Multi-Agent Systemā
Agent 1: Perplexity Search Agentā
Create a file called perplexity_adapter.py:
import os
import sys
import time
from uagents_adapter.a2a_inbound.adapter import A2ARegisterTool
def main():
"""Start A2A bridge for Perplexity Search Agent."""
# Set bridge seed for consistent agent identity (required in production)
os.environ["UAGENTS_BRIDGE_SEED"] = "perplexity_bridge_seed_2024"
# Configure the bridge
config = {
"agent_address": "agent1qgzd0c60d4c5n37m4pzuclv5p9vwsftmfkznksec3drux8qnhmvuymsmshp",
"name": "Perplexity Search Agent",
"description": "AI-powered web search and research assistant with real-time information access",
"skill_tags": ["search", "research", "web", "ai", "information", "news"],
"skill_examples": ["Search for latest AI news", "Research quantum computing trends", "Find information about climate change"],
"port": 9002,
"bridge_port": 8002,
"host": "localhost"
}
# Start the A2A bridge
adapter = A2ARegisterTool()
try:
result = adapter.invoke(config)
if result.get("success"):
# Keep the server running
while True:
time.sleep(1)
else:
print(f"ā Failed to start bridge: {result}")
return 1
except KeyboardInterrupt:
print("\nš Shutting down Perplexity bridge...")
return 0
except Exception as e:
print(f"ā Error: {e}")
return 1
if __name__ == "__main__":
sys.exit(main())
Agent 2: Finance Q&A Agentā
Create a file called finance_adapter.py:
import os
import sys
import time
from uagents_adapter.a2a_inbound.adapter import A2ARegisterTool
def main():
"""Start A2A bridge for Finance Q&A Agent."""
# Set bridge seed for consistent agent identity (required in production)
os.environ["UAGENTS_BRIDGE_SEED"] = "finance_bridge_seed_2024"
# Configure the bridge
config = {
"agent_address": "agent1qdv2qgxucvqatam6nv28qp202f3pw8xqpfm8man6zyegztuzd2t6yem9evl",
"name": "Finance Q&A Agent",
"description": "AI-powered financial advisor and Q&A assistant for investment, budgeting, and financial planning guidance",
"skill_tags": ["finance", "investment", "budgeting", "financial_planning", "assistance"],
"skill_examples": ["Analyze AAPL stock performance", "Compare crypto portfolios", "Budget planning advice"],
"port": 9003,
"bridge_port": 8003,
"host": "localhost"
}
# Start the A2A bridge
adapter = A2ARegisterTool()
try:
result = adapter.invoke(config)
if result.get("success"):
# Keep the server running
while True:
time.sleep(1)
else:
print(f"ā Failed to start bridge: {result}")
return 1
except KeyboardInterrupt:
print("\nš Shutting down Finance bridge...")
return 0
except Exception as e:
print(f"ā Error: {e}")
return 1
if __name__ == "__main__":
sys.exit(main())
Step 4: Run Your Multi-Agent Systemā
Terminal 1: Start Perplexity Agentā
python perplexity_adapter.py
Expected output:
INFO:root:š Using provided bridge port: 8002
INFO:uagents_adapter.a2a_inbound.agentverse_executor:š Using user-provided bridge seed from environment
INFO: [a2a_agentverse_bridge]: Starting agent with address: agent1qvdrt7kqg2k67czm8wzs724jv63fsq5cr2lq4mymtptj576sdpu9yngzden
INFO:uagents_adapter.a2a_inbound.agentverse_executor:A2A Bridge agent started with address: agent1qvdrt7kqg2k67czm8wzs724jv63fsq5cr2lq4mymtptj576sdpu9yngzden
INFO:uagents_adapter.a2a_inbound.agentverse_executor:Target Agentverse agent: agent1qgzd0c60d4c5n37m4pzuclv5p9vwsftmfkznksec3drux8qnhmvuymsmshp
INFO: [a2a_agentverse_bridge]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8002&address=agent1qvdrt7kqg2k67czm8wzs724jv63fsq5cr2lq4mymtptj576sdpu9yngzden
INFO: [a2a_agentverse_bridge]: Starting server on http://0.0.0.0:8002 (Press CTRL+C to quit)
INFO: [a2a_agentverse_bridge]: Starting mailbox client for https://agentverse.ai
INFO: [a2a_agentverse_bridge]: Mailbox access token acquired
INFO: [uagents.registration]: Registration on Almanac API successful
INFO:uagents_adapter.a2a_inbound.agentverse_executor:ā
A2A Bridge to Agentverse started successfully
INFO:root:š A2A server starting on localhost:9002
INFO:root:š Bridging to Agentverse agent: agent1qgzd0c60d4c5n37m4pzuclv5p9vwsftmfkznksec3drux8qnhmvuymsmshp
INFO:root:š Agent name: Perplexity Search Agent
INFO:root:š·ļø Tags: search, research, web, ai, information, news
INFO: Started server process [14746]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:9002 (Press CTRL+C to quit)
INFO: [uagents.registration]: Almanac contract registration is up to date!
Terminal 2: Start Finance Agentā
python finance_adapter.py
Expected output:
INFO:root:š Using provided bridge port: 8003
INFO:uagents_adapter.a2a_inbound.agentverse_executor:š Using user-provided bridge seed from environment
INFO: [a2a_agentverse_bridge]: Starting agent with address: agent1qdv8n2zucf50mvyzxwswe02swnwzmt5fctyeug6cewdkaz4wjd46qjggnz2
INFO:uagents_adapter.a2a_inbound.agentverse_executor:A2A Bridge agent started with address: agent1qdv8n2zucf50mvyzxwswe02swnwzmt5fctyeug6cewdkaz4wjd46qjggnz2
INFO:uagents_adapter.a2a_inbound.agentverse_executor:Target Agentverse agent: agent1qdv2qgxucvqatam6nv28qp202f3pw8xqpfm8man6zyegztuzd2t6yem9evl
INFO: [a2a_agentverse_bridge]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8003&address=agent1qdv8n2zucf50mvyzxwswe02swnwzmt5fctyeug6cewdkaz4wjd46qjggnz2
INFO: [a2a_agentverse_bridge]: Starting server on http://0.0.0.0:8003 (Press CTRL+C to quit)
INFO: [a2a_agentverse_bridge]: Starting mailbox client for https://agentverse.ai
INFO:uagents_adapter.a2a_inbound.agentverse_executor:ā
A2A Bridge to Agentverse started successfully
INFO:root:š A2A server starting on localhost:9003
INFO:root:š Bridging to Agentverse agent: agent1qdv2qgxucvqatam6nv28qp202f3pw8xqpfm8man6zyegztuzd2t6yem9evl
INFO:root:š Agent name: Finance Q&A Agent
INFO:root:š·ļø Tags: finance, investment, budgeting, financial_planning, assistance
INFO: Started server process [14541]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:9003 (Press CTRL+C to quit)
INFO: [uagents.registration]: Registration on Almanac API successful
INFO: [uagents.registration]: Almanac contract registration is up to date!
INFO: [a2a_agentverse_bridge]: Mailbox access token acquired
š IMPORTANT: Connect Bridge Agents to Mailboxā
For each agent you start, you MUST complete this step:
-
Look for the Inspector Link in the terminal output:
Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8002&address=agent1q... -
Click the Inspector Link - This will open the Agentverse Agent Inspector in your browser
-
Connect to Mailbox:
- Click the "Connect" button in the Inspector UI
- Select "Mailbox" from the connection options
- Click "Finish" to complete the connection
-
Repeat for Each Agent - You need to do this for both the Perplexity agent (port 8002) and Finance agent (port 8003)
Why This is Required:
- The bridge agents need mailbox access to communicate with your target Agentverse agents
- Without this connection, messages won't reach your target agents
- This establishes the secure communication channel between the bridge and Agentverse
For detailed mailbox connection instructions, refer to: Mailbox Agents Documentation
Success Indicators: After connecting, you should see these log messages:
INFO: [a2a_agentverse_bridge]: Mailbox access token acquired
INFO: [uagents.registration]: Registration on Almanac API successful
Step 5: Test Your Multi-Agent Systemā
Test Agent Discoveryā
Check that both agents are discoverable:
# Discover Perplexity agent
curl http://localhost:9002/.well-known/agent.json
# Discover Finance agent
curl http://localhost:9003/.well-known/agent.json
Test Perplexity Search Agentā
curl -X POST http://localhost:9002 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "message/send",
"params": {
"message": {
"role": "user",
"parts": [{"kind": "text", "text": "What are the latest developments in AI agents?"}],
"messageId": "search-query-1"
},
"contextId": "search-session-123"
},
"id": "search-request-1"
}'
Test Finance Q&A Agentā
curl -X POST http://localhost:9003 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "message/send",
"params": {
"message": {
"role": "user",
"parts": [{"kind": "text", "text": "How should I diversify my investment portfolio?"}],
"messageId": "finance-query-1"
},
"contextId": "finance-session-456"
},
"id": "finance-request-1"
}'
š§ Step 6: Configuration Explainedā
Key Configuration Parametersā
Agent Addressā
"agent_address": "agent1qgzd0c60d4c5n37m4pzuclv5p9vwsftmfkznksec3drux8qnhmvuymsmshp"
- What it is: Unique identifier for your Agentverse uAgent
- How to get it: Copy from Agentverse agent profile page
- Important: Must be an active, running agent
Ports Configurationā
"port": 9002, # A2A server port (what clients connect to)
"bridge_port": 8002, # Internal bridge uAgent port
- A2A Port: Where A2A clients send requests
- Bridge Port: Internal communication with Agentverse
- Rule: Each agent needs unique ports to avoid conflicts
Bridge Seedā
os.environ["UAGENTS_BRIDGE_SEED"] = "perplexity_bridge_seed_2024"
- Purpose: Ensures consistent bridge agent addresses
- Important: Use unique seeds for different agents
- Production: Always set this in production deployments
Agent Metadataā
"name": "Perplexity Search Agent",
"description": "AI-powered web search and research assistant",
"skill_tags": ["search", "research", "web"],
"skill_examples": ["Search for latest AI news", "Research trends"]
- Discovery: Helps A2A clients understand agent capabilities
- Tags: Used for categorization and filtering
- Examples: Show users what queries work well
Step 7: Build an A2A Client for Multi-Agent Coordinationā
Now that your agents are running, let's create a simple A2A client that can discover and coordinate with both agents.