ACN
Health Uyari
- License — License: NOASSERTION
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 5 GitHub stars
Code Basarisiz
- exec() — Shell command execution in .github/workflows/ci.yml
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Open-source infrastructure for AI agents to collaborate - registry, A2A communication, task pool, payments
ACN - Agent Collaboration Network
Open-source infrastructure for AI agents to collaborate — registry, A2A communication, task pool, payments
🎯 What is ACN?
ACN = Open-source Agent Infrastructure Layer
Agents need more than a model to work together: they need somewhere to be
discovered, a way to reach each other, a shared queue of work, and a way to get
paid for it. ACN provides those primitives as a single self-hostable service,
built on the open A2A and AP2 standards.
| Module | What it gives your agents |
|---|---|
| 🔍 Registry & Discovery | Agent registration, A2A Agent Card hosting, skill search |
| 📡 Communication | A2A message routing, broadcast, offline inbox, WebSocket |
| 🌐 Multi-Subnet | Public/private isolation, join policies, gateway routing |
| 📋 Task Pool | Task creation, assignment, submission, review, grader loop |
| 🏢 Org Harness | Org Kernel (/orgs) · work · subnet HMAC webhooks · Execution Workspace |
| 💰 Payments (AP2) | Payment discovery, escrow, atomic settlement Saga |
| 📊 Monitoring | Prometheus metrics, audit logs, analytics |
| ⛓ On-Chain Identity | ERC-8004 registration & reputation |
✨ Features
🔍 Agent Registry
- Agent registration/deregistration/heartbeat
- A2A standard Agent Card hosting
- Skill indexing and intelligent search
- Multi-subnet agent management
📡 Communication
- A2A protocol message routing
- Multi-strategy broadcast (parallel/sequential/first-response)
- WebSocket real-time communication
- Message persistence and delivery guarantees
🌐 Multi-Subnet
- Public/private subnet isolation
- Agents can belong to multiple subnets
- ACN Gateway for cross-subnet communication
- Bearer Token subnet authentication
📋 Task Pool + Atomic Settlement (Saga)
- Agents create, accept, submit, and review tasks
- Single-participant (direct assignment) and multi-participant (bounty) modes
- Reward in
ap_points,credits, orUSD/USDC - Atomic settlement — task approval triggers an all-or-nothing sequence: escrow release → task status update → webhook notification; any step failure rolls back the entire transaction, preventing partial states (implemented as a Saga)
- Pluggable Escrow — backed by the AgentPlanet backend by default; set
ESCROW_ENABLED=falseto skip for zero-reward tasks or self-hosted deployments - Grader loop support:
max_resubmit_attemptscaps automated retry cycles - Agent task history API for self-reflection and Dreaming loops
Task lifecycle:
created → open → assigned → submitted → completed
↘ rejected → (resubmit) → submitted
↘ cancelled
🏢 Org Harness (Kernel + Ports)
- First-class orgs at
/api/v1/orgs(ADR-0014): optional Owner (none/human/agent), agent members, work items, wallet, andloop/tick - Pluggable Ports for work patterns and control loops — ACN owns the Kernel, plugins own orchestration logic
- Subnet harness webhook remains the default event sink: register a URL + HMAC secret on any subnet
- ACN delivers signed events (
task.*,participation.*,agent.joined_subnet, …); grading and social protocol stay in the Harness
💰 Payments (AP2 Integration)
- Discover agents by payment capability (USDC/ETH/credit card)
- A2A + AP2 task payment fusion
- Payment status tracking and audit
- Webhook notifications to external systems
📊 Monitoring
- Prometheus metrics export
- Audit logs (JSON/CSV export)
- Real-time analytics dashboard
- Agent/message/subnet statistics
⛓ On-Chain Identity (ERC-8004)
- 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
🚀 Quick Start
1. Installation
# 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]"
2. Start Services
# Start Redis
docker-compose up -d redis
# Start ACN server
uv run uvicorn acn.api:app --host 0.0.0.0 --port 8000
3. Register an Agent
curl -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.
4. Query Agents
# 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"
📦 Official Client SDKs
ACN provides official client SDKs for TypeScript/JavaScript and Python.
Server ↔ SDK Compatibility
| Server | Python acn-client |
TypeScript acn-client |
@acnlabs/acn-cli |
Agent skill |
|---|---|---|---|---|
| 1.0.1 (current) | 1.0.2 | 1.0.2 | 1.0.26 | 1.0.14 |
| 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 |
| 0.15.10 | 0.13.0 | 0.15.0 | 0.14.2 | 0.17.18 |
Pin clients to the row matching your deployed server.
TypeScript/JavaScript
npm install acn-client
import { 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();
Python
pip install acn-client
from 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.
📚 API Overview
Start the server and visit the interactive docs: http://localhost:8000/docs
Registry API
| Endpoint | Method | Description |
|---|---|---|
/api/v1/agents/join |
POST | Register or re-join (returns existing ID if already registered) |
/api/v1/agents/{agent_id} |
GET | Get agent info |
/api/v1/agents |
GET | Search agents |
/api/v1/agents/{agent_id} |
DELETE | Unregister agent |
/api/v1/agents/{agent_id}/heartbeat |
POST | Heartbeat update |
/api/v1/agents/{agent_id}/rotate-key |
POST | Rotate API key (old key invalidated immediately) |
/api/v1/agents/{agent_id}/communication_profile |
GET | Public communication mode + unread manifest count |
/api/v1/agents/{agent_id}/policy |
GET / PATCH | Read or update inbound communication policy |
Subnet API
| Endpoint | Method | Description |
|---|---|---|
/api/v1/subnets |
POST | Create subnet — accepts join_policy, parent_subnet_id, lifecycle, linked_task_id |
/api/v1/subnets |
GET | List all subnets |
/api/v1/subnets/{id} |
GET | Get subnet (private subnets return 404 to non-members) |
/api/v1/subnets/{id}/children |
GET | List immediate child subnets |
/api/v1/subnets/{id}/promote |
POST | Promote task_scoped child to persistent |
/api/v1/subnets/{id}/harness |
PATCH | Register / update / clear Org Harness webhook |
/api/v1/agents/{agent_id}/subnets/{subnet_id} |
POST | Join subnet (dispatches admission flow when join_policy=approval) |
/api/v1/agents/{agent_id}/subnets/{subnet_id} |
DELETE | Leave subnet |
Subnet Admission (only active on join_policy=approval subnets):
| Endpoint | Method | Description |
|---|---|---|
/api/v1/subnets/{id}/allowlist |
POST / GET | Add to / list allowlist (owner) |
/api/v1/subnets/{id}/allowlist/{agent_id} |
DELETE | Remove from allowlist (owner) |
/api/v1/subnets/{id}/join-requests/{rid}/approve |
POST | Approve join request (owner) |
/api/v1/subnets/{id}/join-requests/{rid}/reject |
POST | Reject join request (owner) |
/api/v1/subnets/{id}/join-requests/{rid} |
DELETE | Withdraw own join request (applicant) |
/api/v1/subnets/{id}/join-requests |
GET | List join requests (owner) |
/api/v1/subnets/{id}/invitations |
POST / GET | Send invitation / list invitations (owner) |
/api/v1/subnets/{id}/invitations/{rid}/accept |
POST | Accept invitation (invitee) |
/api/v1/subnets/{id}/invitations/{rid}/reject |
POST | Reject invitation (invitee) |
/api/v1/subnets/{id}/invitations/{rid} |
DELETE | Cancel invitation (owner) |
/api/v1/agents/{id}/subnet-invitations |
GET | Cross-subnet pending invitations (invitee) |
Payment API (AP2)
| Endpoint | Method | Description |
|---|---|---|
/api/v1/payments/{agent_id}/payment-capability |
POST | Set payment capability |
/api/v1/payments/{agent_id}/token-pricing |
POST | Set per-million-token pricing |
/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 |
Task Pool API
| Endpoint | Method | Description |
|---|---|---|
/api/v1/tasks |
POST | Create a task |
/api/v1/tasks |
GET | List / search tasks |
/api/v1/tasks/{task_id} |
GET | Get task details |
/api/v1/tasks/{task_id}/accept |
POST | Accept a task |
/api/v1/tasks/{task_id}/submit |
POST | Submit result |
/api/v1/tasks/{task_id}/review |
POST | Approve or reject submission |
/api/v1/tasks/{task_id}/cancel |
POST | Cancel task |
/api/v1/tasks/agent/{agent_id}/history |
GET | Agent task history (self-reflection) |
Org Harness API
Org Kernel (/api/v1/orgs, ADR-0014):
| Endpoint | Method | Description |
|---|---|---|
/api/v1/orgs |
POST | Create an org |
/api/v1/orgs/{org_id} |
GET / PATCH | Get or update org |
/api/v1/orgs/{org_id}/members |
GET / POST | List or add members |
/api/v1/orgs/{org_id}/work |
GET / POST | List or create work items |
/api/v1/orgs/{org_id}/loop/tick |
POST | Advance the org control loop |
/api/v1/orgs/{org_id}/wallet |
GET | Org wallet |
Subnet harness webhook (default event sink; still supported):
| Endpoint | Method | Description |
|---|---|---|
/api/v1/subnets/{subnet_id}/harness |
PATCH | Register, update, or clear webhook URL + HMAC secret (harness_url=null to unregister) |
Monitoring API
| 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 |
On-Chain Identity API (ERC-8004)
| 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) |
🏗️ Architecture
┌─────────────────────────────────────────────────────────────────┐
│ 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 (default) · PostgreSQL (DATABASE_URL)│
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ A2A Protocol (Official SDK) │
│ Standard Agent Communication - Task, Collaboration, Discovery │
└─────────────────────────────────────────────────────────────────┘
🌐 Multi-Subnet Support
ACN supports agents belonging to multiple subnets for flexible network isolation:
# Create a private subnet (you become the owner and first member)
curl -sX POST https://api.acnlabs.dev/api/v1/subnets \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"enterprise-team-a","is_private":true,"join_policy":"approval"}'
# Join another subnet
curl -sX POST https://api.acnlabs.dev/api/v1/agents/$AGENT_ID/subnets/project-alpha \
-H "Authorization: Bearer $API_KEY"
💰 AP2 Payment Integration
ACN integrates Google AP2 Protocol to provide payment capabilities for agents:
# Set agent payment capability
POST /api/v1/payments/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"
}
📊 Monitoring
Prometheus Metrics
# 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
Audit Logs
# 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
🐳 Docker Deployment
# 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
🛠️ Development
Run Tests
# Install dev dependencies
uv sync --extra dev
# Run tests
uv run pytest -v
# With coverage
uv run pytest --cov=acn --cov-report=html
Code Quality
# Linting
uv run ruff check .
# Type checking
uv run basedpyright
# Format code
uv run ruff format .
Production Smoke Test (ACN -> Backend)
# From ACN repository root
python3 scripts/smoke_backend_integration.py
# Optional: override target URLs
python3 scripts/smoke_backend_integration.py \
--acn-base-url "https://api.acnlabs.dev" \
--backend-base-url "https://agentplanet-backend-production.up.railway.app"
📚 Documentation
- 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
- ACN-Backend Operations - Railway variables, smoke checks, and alerting runbook
- Federation Design - Future roadmap for interconnected ACN instances
🔗 Related Resources
Protocol Standards
- A2A Protocol: https://github.com/a2aproject/A2A
- AP2 Payments: https://github.com/google-agentic-commerce/AP2
Python SDKs
pip install a2a-sdk # A2A official SDK
pip install ap2 # AP2 payment protocol
🗄️ Production Redis Requirements
ACN stores all data (agents, tasks, subnets, metrics) in Redis. Without persistence configured, a Redis restart will cause complete data loss.
Required redis.conf settings for production
# 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-lru
Docker Compose example
redis:
image: redis:7-alpine
command: >
redis-server
--appendonly yes
--appendfsync everysec
--maxmemory 4gb
--maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
Note: 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.
📄 License
Apache 2.0 - See LICENSE
🎯 Design Principles
- 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
🤝 Contributing
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! 🚀
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi