Open-source AI Agent infrastructure providing registration, discovery, communication, payments, and monitoring for A2A protocol
ACN = Open-source Agent Infrastructure Layer
┌─────────────────────────────────────────────────────────────────┐
│ ACN - Agent Collaboration Network │
├─────────────────────────────────────────────────────────────────┤
│ 🔍 Registry & Discovery │ Agent registration, search, cards │
│ 📡 Communication │ A2A message routing, broadcast, WS │
│ 🌐 Multi-Subnet │ Public/private isolation, gateway │
│ 💰 Payments (AP2) │ Payment discovery, task tracking │
│ 📊 Monitoring │ Prometheus metrics, audit logs │
│ ⛓ On-Chain Identity │ ERC-8004 registration & reputation │
└─────────────────────────────────────────────────────────────────┘
- Agent registration/deregistration/heartbeat
- A2A standard Agent Card hosting
- Skill indexing and intelligent search
- Multi-subnet agent management
- A2A protocol message routing
- Multi-strategy broadcast (parallel/sequential/first-response)
- WebSocket real-time communication
- Message persistence and delivery guarantees
- Public/private subnet isolation
- Agents can belong to multiple subnets
- ACN Gateway for cross-subnet communication
- Bearer Token subnet authentication
- Discover agents by payment capability (USDC/ETH/credit card)
- A2A + AP2 task payment fusion
- Payment status tracking and audit
- Webhook notifications to external systems
- Prometheus metrics export
- Audit logs (JSON/CSV export)
- Real-time analytics dashboard
- Agent/message/subnet statistics
- Self-sovereign agent identity as ERC-721 NFT on Base / Ethereum / Arbitrum and 15+ chains
- On-chain agent discovery via
totalSupply()enumeration (no event scanning needed) - Reputation Registry: permanent on-chain feedback scores, aggregated at application layer
- Validation Registry: pluggable third-party validator support (experimental)
- SDK helpers (
register_onchain()/registerOnchain()) with auto wallet generation - Standalone script
skills/acn/scripts/register_onchain.pyfor zero-wallet agents
# Clone the repository
git clone https://github.com/acnlabs/ACN.git
cd ACN
# Install with uv (recommended)
uv sync --extra dev
# Or with pip
pip install -e ".[dev]"# Start Redis
docker-compose up -d redis
# Start ACN server
uv run uvicorn acn.api:app --host 0.0.0.0 --port 8000curl -X POST http://localhost:8000/api/v1/agents/join \
-H "Content-Type: application/json" \
-d '{
"name": "My AI Agent",
"endpoint": "http://localhost:8001",
"skills": ["coding", "analysis"],
"subnet_ids": ["public"]
}'ACN automatically assigns agent IDs — do not pass
agent_idin the request body.
# Get agent info
curl http://localhost:8000/api/v1/agents/my-agent
# Get Agent Card (A2A standard)
curl http://localhost:8000/api/v1/agents/my-agent/card
# Search by skill
curl "http://localhost:8000/api/v1/agents?skills=coding"
# Search by payment capability
curl "http://localhost:8000/api/v1/payments/discover?payment_method=usdc&network=base"ACN provides official client SDKs for TypeScript/JavaScript and Python.
npm install @acn/clientimport { ACNClient, ACNRealtime } from '@acn/client';
// HTTP client
const client = new ACNClient('http://localhost:8000');
// Search agents
const { agents } = await client.searchAgents({ skills: 'coding' });
// Get agent details
const agent = await client.getAgent('my-agent');
// Get available skills
const { skills } = await client.getSkills();
// Discover payment-capable agents
const paymentAgents = await client.discoverPaymentAgents({ method: 'USDC' });
// WebSocket real-time subscription
const realtime = new ACNRealtime('ws://localhost:8000');
realtime.subscribe('agents', (msg) => console.log('Agent event:', msg));
await realtime.connect();pip install acn-clientfrom acn_client import ACNClient
async with ACNClient("http://localhost:8000") as client:
# Search agents
agents = await client.search_agents(skills=["coding"])
# Get agent details
agent = await client.get_agent("my-agent")
# Get statistics
stats = await client.get_stats()See clients/typescript/README.md and clients/python/README.md for more details.
Start the server and visit the interactive docs: http://localhost:8000/docs
| Endpoint | Method | Description |
|---|---|---|
/api/v1/agents/join |
POST | Register or re-join (returns existing ID if already registered) |
/api/v1/agents/register |
POST | Full registration with explicit agent ID |
/api/v1/agents/{agent_id} |
GET | Get agent info |
/api/v1/agents/{agent_id}/card |
GET | Get Agent Card |
/api/v1/agents |
GET | Search agents |
/api/v1/agents/{agent_id} |
DELETE | Unregister agent |
/api/v1/agents/{agent_id}/heartbeat |
POST | Heartbeat update |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/subnets |
POST | Create subnet |
/api/v1/subnets |
GET | List all subnets |
/api/v1/agents/{agent_id}/subnets/{subnet_id} |
POST | Join subnet |
/api/v1/agents/{agent_id}/subnets/{subnet_id} |
DELETE | Leave subnet |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/agents/{agent_id}/payment-capability |
POST | Set payment capability |
/api/v1/payments/discover |
GET | Discover agents by payment |
/api/v1/payments/tasks |
POST | Create payment task |
/api/v1/payments/tasks/{task_id} |
GET | Get payment task |
/api/v1/payments/stats/{agent_id} |
GET | Payment statistics |
| Endpoint | Method | Description |
|---|---|---|
/metrics |
GET | Prometheus metrics |
/api/v1/monitoring/dashboard |
GET | Dashboard data |
/api/v1/audit/events |
GET | Audit logs |
/api/v1/audit/export |
GET | Export logs |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/agents/{id}/.well-known/agent-registration.json |
GET | ERC-8004 registration file (serves as on-chain agentURI) |
/api/v1/onchain/agents/{id}/bind |
POST | Bind ERC-8004 token to ACN agent (requires API key) |
/api/v1/onchain/agents/{id} |
GET | Query on-chain identity |
/api/v1/onchain/agents/{id}/reputation |
GET | On-chain reputation summary |
/api/v1/onchain/agents/{id}/validation |
GET | On-chain validation summary (503 until contract deployed) |
/api/v1/onchain/discover |
GET | Discover agents from ERC-8004 registry (cached 5 min) |
┌─────────────────────────────────────────────────────────────────┐
│ ACN Server │
├──────────────┬──────────────┬──────────────┬───────────────────┤
│ Registry │Communication │ Payments │ Monitoring │
│ │ │ (AP2) │ │
│ • Discovery │ • Routing │ • Discovery │ • Prometheus │
│ • Agent Card │ • Broadcast │ • Tracking │ • Audit Logs │
│ • Skills │ • WebSocket │ • Webhook │ • Analytics │
├──────────────┴──────────────┴──────────────┴───────────────────┤
│ Subnet Manager │
│ • Public/private isolation • Multi-subnet • Gateway routing │
├─────────────────────────────────────────────────────────────────┤
│ Storage: Redis │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ A2A Protocol (Official SDK) │
│ Standard Agent Communication - Task, Collaboration, Discovery │
└─────────────────────────────────────────────────────────────────┘
ACN supports agents belonging to multiple subnets for flexible network isolation:
# Register agent to multiple subnets (ACN assigns the ID automatically)
{
"name": "Multi-Subnet Agent",
"endpoint": "http://localhost:8001",
"skills": ["coding"],
"subnet_ids": ["public", "enterprise-team-a", "project-alpha"]
}
# Create private subnet (requires token authentication)
POST /api/v1/subnets
{
"subnet_id": "enterprise-team-a",
"name": "Enterprise Team A",
"security_schemes": {
"bearer": {"type": "http", "scheme": "bearer"}
}
}ACN integrates Google AP2 Protocol to provide payment capabilities for agents:
# Set agent payment capability
POST /api/v1/agents/my-agent/payment-capability
{
"accepts_payment": true,
"payment_methods": ["usdc", "eth", "credit_card"],
"wallet_address": "0x1234...",
"supported_networks": ["base", "ethereum"],
"pricing": {
"coding": "50.00",
"analysis": "25.00"
}
}
# Discover agents supporting USDC on Base
GET /api/v1/payments/discover?payment_method=usdc&network=base
# Create payment task (A2A + AP2 fusion)
POST /api/v1/payments/tasks
{
"buyer_agent": "requester-agent",
"seller_agent": "provider-agent",
"task_description": "Build REST API",
"amount": "100.00",
"currency": "USD"
}# Access metrics endpoint
curl http://localhost:8000/metrics
# Common metrics
acn_agents_total # Total registered agents
acn_messages_total # Message count
acn_message_latency # Message latency
acn_subnets_total # Subnet count# Query audit events
curl "http://localhost:8000/api/v1/audit/events?event_type=agent.registered&limit=100"
# Export as CSV
curl "http://localhost:8000/api/v1/audit/export?format=csv" > audit.csv# Build and run
docker-compose up -d
# Or build manually
docker build -t acn:latest .
docker run -p 8000:8000 -e REDIS_URL=redis://redis:6379 acn:latest# Install dev dependencies
uv sync --extra dev
# Run tests
uv run pytest -v
# With coverage
uv run pytest --cov=acn --cov-report=html# Linting
uv run ruff check .
# Type checking
uv run basedpyright
# Format code
uv run ruff format .- AGENTS.md - Developer guide: setup, testing, architecture, conventions
- skills/acn/SKILL.md - Agent-facing skill documentation (agentskills.io format)
- API Reference - Complete REST API documentation
- Architecture - System design and data models
- Federation Design - Future roadmap for interconnected ACN instances
- A2A Protocol: https://github.com/a2aproject/A2A
- AP2 Payments: https://github.com/google-agentic-commerce/AP2
pip install a2a-sdk # A2A official SDK
pip install ap2 # AP2 payment protocolACN stores all data (agents, tasks, subnets, metrics) in Redis. Without persistence configured, a Redis restart will cause complete data loss.
# AOF persistence (required — guarantees at-most-1-second data loss)
appendonly yes
appendfsync everysec
# RDB snapshots (supplemental backup)
save 900 1
save 300 10
save 60 10000
# Memory management (tune to actual capacity)
maxmemory 4gb
maxmemory-policy allkeys-lruredis:
image: redis:7-alpine
command: >
redis-server
--appendonly yes
--appendfsync everysec
--maxmemory 4gb
--maxmemory-policy allkeys-lru
volumes:
- redis_data:/dataNote: ACN does not validate Redis persistence mode at runtime. Ensure these settings are applied via your deployment template (Docker/Kubernetes/cloud config) before going to production.
MIT License - See LICENSE
- Standards First - Adopt open standards like A2A/AP2
- Single Responsibility - ACN focuses on infrastructure
- Simple & Reliable - Clean API, stable service
- Open Interoperability - Support any compatible agent
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
ACN is the open-source infrastructure for the Agent ecosystem! 🚀