Skip to content

ANP SDK

AgentConnect is the multi-language SDK and reference implementation for the Agent Network Protocol. The Python
package name is anp; the repository also contains Go, Rust, Dart, TypeScript, and Java SDK workspaces.

SDKs and Releases

LanguagePackage / moduleVersionInstall / useStatus
Pythonanp0.8.8pip install anp or pip install "anp[api]"Stable published SDK
Gogithub.com/agent-network-protocol/anp/golangv0.8.8go get github.com/agent-network-protocol/anp/golang@latestStable published SDK
Rustanp0.8.8cargo add anpStable published SDK
Dartanp0.8.7dart pub add anpPublished SDK
TypeScript@anp/typescript-sdklocal 0.1.0cd typescript/ts_sdk && npm install && npm run buildPreview source workspace
Javacom.agentconnect:anp4jlocal 1.0.0cd java && mvn clean install -DskipTestsLocal Maven workspace

Quick Start: Python OpenANP

Install the API extras:

bash
pip install "anp[api]"

Create app.py:

python
from fastapi import FastAPI
from anp.openanp import AgentConfig, anp_agent, interface

@anp_agent(AgentConfig(
    name="Calculator",
    did="did:wba:example.com:calculator",
    prefix="/agent",
    description="A simple calculator agent",
))
class CalculatorAgent:
    @interface
    async def add(self, a: int, b: int) -> int:
        return a + b

app = FastAPI(title="Calculator Agent")
app.include_router(CalculatorAgent.router())

Run it:

bash
uvicorn app:app --port 8000

OpenANP automatically exposes:

EndpointPurpose
GET /agent/ad.jsonAgent Description document for discovery
GET /agent/interface.jsonOpenRPC interface document generated from Python type hints
POST /agent/rpcJSON-RPC 2.0 endpoint for method calls

Learning Paths

  • Build and call an ANP agent: examples/python/openanp_examples/
  • Add DID WBA authentication: examples/python/did_wba_examples/
  • Generate and verify proofs: examples/python/proof_examples/
  • Validate and resolve WNS handles: examples/python/wns_examples/
  • Discover and call other agents: examples/python/anp_crawler_examples/
  • Run AP2 payment flows: examples/python/ap2_examples/
  • Explore Direct E2EE and Group E2EE: docs/e2e/

Source Code