Skip to content

Repository files navigation

AgentConnect: Multi-language SDK for ANP

AgentConnect is the multi-language SDK and reference implementation for the Agent Network Protocol (ANP). It helps agents identify each other, publish discoverable interfaces, call each other over standard RPC, attach verifiable proofs, resolve human-readable handles, and build end-to-end encrypted communication flows.

The Python package name is anp; this repository also contains Go, Rust, Dart, TypeScript, and Java SDK implementations or SDK workspaces.

Agentic Web

What is ANP?

ANP is a protocol stack for an open network of interoperable agents. In practice, it answers these questions:

  • Who am I talking to? DID WBA identities, DID documents, HTTP Message Signatures, and verifier helpers.
  • What can this agent do? Agent Description documents, OpenRPC interface documents, and JSON-RPC endpoints.
  • Can I trust this object or request? W3C Data Integrity proofs, Appendix-B object proofs, IM/origin proofs, and DID-WBA binding proofs.
  • How do humans and agents find each other? WNS handle validation, resolution, and binding verification.
  • How do agents communicate privately? Direct and group E2EE building blocks used by ANP-compatible clients and services.

What this repository provides

  • Python agent SDK: OpenANP for quickly building and calling ANP agents, plus authentication, proof, WNS, AP2, crawler, and E2EE modules.
  • Shared protocol SDKs: Go and Rust cover core ANP identity/proof/WNS functionality plus selected E2EE surfaces; Dart focuses on core identity, proof, and WNS helpers.
  • Preview/local SDK workspaces: The Java implementation can be used from source while its public package status matures.
  • Examples and fixtures: runnable examples, cross-language interop checks, and shared test vectors.
  • Release tooling: coordinated Python / Go / Rust release workflow and version policy.

Handle continuity capability status

ANP-04 WNS 1.1 makes binding_generation a required security field. Support for that stricter contract is intentionally being introduced per language rather than implied by the repository's shared package version.

SDKRequired canonical binding_generationHandle-rebind P6 primitivesStatus
PythonImplementedNot applicable; Python has no OpenMLS surfaceSupported for this change
RustImplementedExisting group.e2ee.add / group.e2ee.remove typed primitives accept the same GroupStateRefSupported for this change
GoImplementedContract/provider surface only; no in-process OpenMLS status APIShared conformance vectors pass
DartImplementedNot applicable; Dart has no Group E2EE/OpenMLS surfaceShared conformance vectors pass
JavaNot applicable; Java has no WNS surfaceNot applicable; Java has no Group E2EE/OpenMLS surfaceNo corresponding API to synchronize
TypeScriptImplementedNot applicable; TypeScript has no Group E2EE/OpenMLS surfaceShared conformance vectors pass

The release helper coordinates Python, Rust, and Go under one version. Release claims must still distinguish WNS generation conformance from Rust's in-process OpenMLS rebind and status capabilities.

Choose your path

I want to...Start here
Build a working ANP agent quicklyPython OpenANP quick start
Create an e1 DID and run complete authenticationPython e1 authentication example
Add DID WBA authentication to an HTTP serviceDID WBA integration guide
Use the latest stable SDK releaseSDKs and releases
Call or crawl another ANP agentANP Crawler examples
Find runnable examples across languagesExamples guide
Work with proofs, WNS, or E2EECore concepts and examples
Contribute to the repositoryDevelopment

Table of contents

SDKs and releases

Registry status checked on 2026-08-18. Python, Rust, Go, and TypeScript are published at 0.9.3. Dart is published separately. Java is usable from a local Maven build, but this README does not claim Maven Central publication for it.

LanguagePackage / moduleWhere to get itChecked versionInstall / useExamplesStatus
PythonanpPyPI0.9.3pip install anp or pip install "anp[api]" for OpenANP/FastAPI extrasexamples/python/Stable published SDK
Gogithub.com/agent-network-protocol/anp/golangGo module proxy / pkg.go.devv0.9.3go get github.com/agent-network-protocol/anp/golang@latestgolang/examples/Stable published SDK; tag format is golang/vX.Y.Z
Rustanpcrates.io / docs.rs0.9.3cargo add anprust/examples/Stable published SDK
Dartanppub.dev0.8.7dart pub add anpdart/example/Published SDK; versioned outside the current Python/Go/Rust release helper
TypeScript@awiki/anp-typescript-sdknpm0.9.3npm install @awiki/anp-typescript-sdktypescript/ts_sdk/examples/Published SDK; versioned outside the current Python/Go/Rust release helper
Javacom.agentconnect:anp4j, com.agentconnect:anp-spring-boot-starterLocal Maven buildlocal 1.0.0cd java && mvn clean install -DskipTestsjava/anp-examples/Local SDK; Maven Central metadata check returned not found

Minimal install snippets

# Python core SDK
pip install anp
# Python agent-building extras: FastAPI + OpenAI dependencies
pip install "anp[api]"# Go
go get github.com/agent-network-protocol/anp/golang@latest
# Rust
cargo add anp
# Dart
dart pub add anp
# TypeScript
npm install @awiki/anp-typescript-sdk

For local repository development, prefer the commands in Development instead of installing published packages.

Quick start: build a Python agent

OpenANP is the fastest way to see ANP in action. It turns ordinary Python methods into discoverable ANP interfaces and exposes the standard agent documents and JSON-RPC endpoint.

Install the API extras if you are using the published package:

pip install "anp[api]"

When developing from this repository, use:

uv sync --extra api

Create app.py:

fromfastapiimportFastAPIfromanp.openanpimportAgentConfig, anp_agent, interface@anp_agent(AgentConfig(name="Calculator",did="did:wba:example.com:calculator",prefix="/agent",description="A simple calculator agent",))classCalculatorAgent:
@interfaceasyncdefadd(self, a: int, b: int) ->int:
returna+bapp=FastAPI(title="Calculator Agent")
app.include_router(CalculatorAgent.router())

Run the server:

uvicorn app:app --port 8000

OpenANP generates these ANP endpoints automatically:

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

Call it with the repository example client:

uv run python examples/python/openanp_examples/minimal_client.py

Full runnable pair:

# Terminal 1
uvicorn examples.python.openanp_examples.minimal_server:app --port 8000
# Terminal 2
uv run python examples/python/openanp_examples/minimal_client.py

Examples by learning path

For file paths and copy-paste commands across Python, Go, Rust, Dart, TypeScript, and Java, see the Examples guide.

LevelGoalStart hereNotes
BeginnerBuild and call an ANP agentexamples/python/openanp_examples/Requires the api optional dependencies.
BeginnerCreate and verify DID WBA identityexamples/python/did_wba_examples/Offline examples are a good first auth smoke test.
BeginnerGenerate and verify proofsexamples/python/proof_examples/Covers W3C/Data Integrity and ANP proof helpers.
BeginnerValidate and resolve WNS handlesexamples/python/wns_examples/Some resolution flows require network access or a local resolver.
IntermediateDiscover ANP documents and execute toolsexamples/python/anp_crawler_examples/Crawler-style interface discovery and JSON-RPC execution.
IntermediateRun AP2 payment protocol flowexamples/python/ap2_examples/Merchant/shopper mandate examples.
IntermediateCheck Python ↔ Rust interoperabilityexamples/python/rust_interop_examples/Useful when touching auth or wire fixtures.
AdvancedExplore Direct E2EE examplesexamples/python/e2e_encryption_hpke_examples/ and docs/e2e/direct-e2ee-p5-sdk.mdUse current P5 docs for product-facing direct E2EE behavior.
AdvancedExplore Group E2EE / MLSdocs/e2e/group-e2ee-p6-anp-mls.mdGroup E2EE is security-sensitive; follow the documented boundaries.
AdvancedTry LLM-assisted protocol negotiationexamples/python/negotiation_mode/Requires .env LLM provider configuration.

Language-specific examples are also available in golang/examples/, rust/examples/, dart/example/, typescript/ts_sdk/examples/, and java/anp-examples/. The central Examples guide lists the common run commands for each language.

Core concepts

ConceptWhat it means in this repositoryLearn more
DID WBAWeb-based decentralized identifiers, DID documents, verification methods, HTTP Message Signatures, and auth verifier helpers.examples/python/did_wba_examples/
Agent DescriptionThe ad.json document that lets another agent discover who you are and where your interfaces live.examples/python/openanp_examples/
OpenRPC / JSON-RPCInterface schema and method-call transport generated from Python type hints by OpenANP.anp/openanp/
ProofW3C Data Integrity, Appendix-B object proof, group receipt, DID-WBA binding, IM, and RFC 9421 origin proof helpers.examples/python/proof_examples/
WNSWBA Name Space helpers for human-readable handles, wba:// URIs, resolution, and DID binding verification.examples/python/wns_examples/
Direct E2EEANP-P5 private-chat E2EE models, session state, prekey handling, and shared vectors across SDKs.docs/e2e/direct-e2ee-p5-sdk.md
Group E2EEANP-P6 group E2EE / MLS operation surfaces and local-state boundaries.docs/e2e/group-e2ee-p6-anp-mls.md
AP2Agent Payment Protocol v2 mandate models and validation helpers.examples/python/ap2_examples/
Legacy / specialized modulesFastANP, older E2EE examples, and meta-protocol negotiation remain available for compatibility or advanced experiments.examples/python/fastanp_examples/, examples/python/e2e_encryption_v2_examples/, examples/python/negotiation_mode/

Repository map

PathPurpose
anp/Python package: OpenANP, authentication, proof, WNS, AP2, crawler, E2EE, and meta-protocol modules.
examples/python/Python examples grouped by feature and learning path.
golang/Pure Go ANP SDK module and examples.
rust/Rust anp crate, examples, tests, and MLS/E2EE operation surfaces.
dart/Dart SDK package, examples, tests, and Flutter smoke workspace.
typescript/ts_sdk/TypeScript SDK preview workspace for Node 20+.
java/Java SDK modules: core anp4j, Spring Boot starter, and examples.
docs/Protocol-adjacent docs for DID, AP2, E2EE, public fixtures, and PR notes.
testdata/Shared cross-language fixtures and vectors.
skills/anp-multilang-release/Coordinated Python / Go / Rust release helper and policy.

Development

Use the toolchain for the language you are changing. Common local commands:

# Python
uv sync
uv sync --extra api # OpenANP / FastAPI examples
uv sync --extra dev # pytest and development tools
uv run pytest
uv build --wheel
# Gocd golang
go test ./...
# Rustcd rust
cargo test# Dartcd dart
dart pub get
dart analyze
dart test# TypeScript preview workspacecd typescript/ts_sdk
npm install
npm run typecheck
npm test
npm run build
# Java local workspacecd java
mvn test

Some examples require network access or .env configuration, especially LLM-assisted negotiation examples under examples/python/negotiation_mode/.

Release and versioning

Python, Go, and Rust use one coordinated X.Y.Z version managed by skills/anp-multilang-release/. The release policy is documented in skills/anp-multilang-release/references/release-policy.md.

Current coordinated release files include:

Tag rules:

  • Root release tag: X.Y.Z, for example 0.8.8.
  • Go submodule tag: golang/vX.Y.Z, for example golang/v0.8.8.

Release planning starts with:

uv run python skills/anp-multilang-release/scripts/release.py plan --version 0.8.8

The release command validates the working tree, aligned version files, Python build, Rust dry-run publish, and Go tests before publishing and pushing tags.

Security and compatibility notes

  • Load secrets from .env or runtime configuration; never hardcode real private keys or tokens.
  • Treat DID private keys, E2EE key material, and decrypted plaintext as sensitive local data.
  • Prefer current DID WBA and HTTP Message Signature flows for new integrations; legacy modules remain documented for compatibility.
  • Do not assume preview/local SDK workspaces are already published packages unless the README explicitly says so.

Contact us

License

This project is open-sourced under the MIT License. See LICENSE for details.


Copyright (c) 2024 GaoWei Chang

About

Our vision is to provide communication capabilities for intelligent agents, allowing them to connect with each other to form a collaborative network of intelligent agents.

Topics

Resources

Contributing

Stars

342 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages