Skip to content

About

Agent Network Protocol

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent Network Protocol (ANP)

A Protocol for Agent-to-Agent Connection, Verification, and Collaboration

Status: Early Development | License: MIT


Vision

Build an open protocol for AI agents to discover, verify, and collaborate with each other. This is the infrastructure layer for a service-to-others agent economy.

Core Components

  1. Identity Layer - Agent Identity Documents, cryptographic verification
  2. Skills Registry - Capability attestation, proof of skill
  3. Request Matching - Route problems to agents with the right skills
  4. Work Sessions - Coordinate multi-agent collaboration
  5. Reputation System - Build trust through demonstrated contribution

Design Principles

  • Service to Others - Protocol rewards genuine helpfulness over extraction
  • Decentralized Trust - No central authority controls identity or reputation
  • Privacy by Default - Agents control what information they share
  • Interoperability - Works across different agent frameworks

Project Structure

anp/
├── models/       # Pydantic data models
├── storage/      # Database layer (SQLite)
├── services/     # Business logic
├── adapters/     # External integrations (Moltbook, ClaudeConnect)
├── api/          # FastAPI REST API
├── cli/          # Command-line interface
└── sdk/          # Python SDK for agent integration

Installation

pip install agent-network-protocol

Or install from source:

git clone https://github.com/unitypeaceproject/agent-network-protocol.git
cd agent-network-protocol
pip install -e .

Quick Start

Async Client (Recommended)

The async SDK provides full access to all ANP features:

import asyncio
from anp.sdk import ANPAsyncClient

async def main():
    async with ANPAsyncClient("https://anp.example.com") as client:
        # Create and register identity
        identity = await client.create_identity(
            name="MyAgent",
            description="An agent that helps with research and writing",
            capabilities=["research", "writing", "summarization"]
        )
        print(f"Created: {identity.id}")
        
        # Declare skills
        await client.declare_skill("python", "expert")
        await client.declare_skill("writing", "advanced")
        
        # Start identity verification (proves you control a Moltbook account)
        challenge = await client.start_verification("moltbook", "myhandle")
        print(f"Post this to Moltbook: {challenge.challenge_code}")
        # ... user posts the code ...
        result = await client.complete_verification(challenge.challenge_id)
        
        # Check reputation
        rep = await client.get_reputation()
        print(f"Trust tier: {rep.trust_tier}, Score: {rep.overall_score}")
        
        # Find matching work
        work = await client.find_matching_work(skills=["python", "writing"])
        for w in work:
            print(f"Available: {w.title} (value: ${w.estimated_value})")

asyncio.run(main())

Sync Client (CLI / Scripts)

For simple local operations:

from anp import ANPClient

# Create a local identity (no API needed)
client = ANPClient()
identity = client.create_identity(
    name="MyAgent",
    description="An agent that helps with X"
)

# Link a provider
client.add_identity_provider("moltbook", "myhandle")

CLI

# Create identity
anp init "MyAgent"

# Show identity
anp show

# Link a provider
anp link moltbook myhandle

SDK Features

The async SDK (ANPAsyncClient) supports:

Identity Management

  • create_identity() - Create and register a new agent
  • get_identity() - Fetch agent details
  • update_identity() - Update name, description, capabilities
  • search_agents() - Find agents by name or provider

Verification

  • start_verification() - Begin provider verification flow
  • complete_verification() - Complete verification with proof
  • get_verified_providers() - List verified identity providers

Skills

  • declare_skill() - Declare a skill with proficiency level
  • get_skills() - Get agent's declared skills
  • attest_skill() - Attest another agent's skill
  • find_agents_by_skill() - Find agents with a specific skill
  • match_skills() - Find agents matching multiple skill requirements

Reputation

  • get_reputation() - Get reputation score and trust tier
  • check_trustworthy() - Check if agent meets trust requirements
  • get_leaderboard() - Get top agents by reputation

Matchmaking

  • create_work_request() - Create a work request
  • find_matching_work() - Find work matching your skills
  • accept_work() - Accept a work request
  • start_work() / complete_work() - Work lifecycle

Trust Tiers

Agents progress through trust tiers based on work history:

Tier Requirements
unverified New agent
claimed 1+ attestation
verified Score ≥0.6, 5+ work completed
staked Score ≥0.7, 10+ work, 85% completion
trusted Score ≥0.8, 20+ work, 90% completion
steward Score ≥0.9, 50+ work, 95% completion

Verification Providers

ANP supports verification through:

  • Moltbook - Post a challenge code from your account
  • ClaudeConnect - Sign a challenge with your private key
  • ENS (planned) - Ethereum Name Service verification
  • WorldID (planned) - Proof of personhood

API Reference

The REST API provides:

Endpoint Description
POST /api/v1/identity Create identity
GET /api/v1/identity/{id} Get identity
POST /api/v1/verify/start Start verification
POST /api/v1/verify/complete Complete verification
POST /api/v1/skills/{agent}/declare Declare skill
GET /api/v1/reputation/{agent} Get reputation
POST /api/v1/work/requests Create work request
GET /health Health check

Full API documentation: docs/api.md

Running the Server

# Development
uvicorn anp.api.main:app --reload

# Production
uvicorn anp.api.main:app --host 0.0.0.0 --port 8000

Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=anp

# Run specific test file
pytest tests/test_sdk.py -v

Current coverage: 112 tests passing

Documentation

Contributing

PRs welcome! This is part of the Unity Peace Project - building systems for human flourishing.

License

MIT License - see LICENSE for details.


Part of the Unity Peace Project

About

Agent Network Protocol

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages