Skip to main content

An SDK that enables agents to connect with each other, allowing them to perform identity authentication, end-to-end encrypted communication, automatic protocol negotiation based on LLMs, and efficient data exchange.

Project description

AgentConnect

What is AgentConnect

AgentConnect is an open-source implementation of the Agent Network Protocol (ANP).

The Agent Network Protocol (ANP) aims to become the HTTP of the Agentic Internet era.

Our vision is to define how agents connect with each other and build an open, secure, and efficient collaboration network for billions of agents.

Agentic Web

While current internet infrastructure is well-established, there's still a lack of optimal communication and connection solutions for the specific needs of agent networks. We are committed to addressing three major challenges faced by agent networks:

  • 🌐 Interconnectivity: Enable communication between all agents, break down data silos, and allow AI to access complete contextual information.
  • 🖥️ Native Interfaces: AI shouldn't have to mimic human internet interactions; it should interact with the digital world through its most proficient methods (APIs or communication protocols).
  • 🤝 Efficient Collaboration: Leverage AI for self-organizing and self-negotiating agents to build a more cost-effective and efficient collaboration network than the existing internet.

AgentConnect Architecture

The technical architecture of AgentConnect is illustrated below:

Project Architecture

Corresponding to the three-layer architecture of the Agent Network Protocol, AgentConnect primarily includes:

  1. 🔒 Authentication and End-to-End Encryption Modules Implements W3C DID-based authentication and end-to-end encrypted communication, including DID document generation, verification, retrieval, and end-to-end encryption based on DID and ECDHE (Elliptic Curve Diffie-Hellman Ephemeral). Currently supports HTTP-based DID authentication.

  2. 🌍 Meta-Protocol Module Built on LLM (Large Language Models) and meta-protocols, this module handles application protocol negotiation, protocol code implementation, protocol debugging, and protocol processing.

  3. 📡 Application Layer Protocol Integration Framework Manages protocol specifications and code for communication with other agents, including protocol loading, unloading, configuration, and processing. This framework enables agents to easily load and run required protocols on demand, accelerating protocol negotiation.

Beyond these features, AgentConnect will focus on performance and multi-platform support:

  • Performance: As a fundamental codebase, we aim to provide optimal performance and plan to rewrite core components in Rust.
  • Multi-Platform: Currently supports Mac, Linux, and Windows, with future support for mobile platforms and browsers.

Documentation

Here are some of our blogs:

Milestones

Both protocol and implementation development follow this progression:

  • Build authentication and end-to-end encrypted communication protocol and implementation. This foundational core is essentially complete.
  • Meta-protocol design and implementation. Protocol design and code development are basically complete.
  • Application layer protocol design and development. Currently in progress.

To establish ANP as an industry standard, we plan to form an ANP Standardization Committee at an appropriate time, working towards recognition by international standardization organizations like W3C.

Installation

pip install agent-connect

Running

After installing the agent-connect library, you can run our demos to experience its capabilities.

Clone the repository:

git clone https://github.com/chgaowei/AgentConnect.git

Decentralized Authentication Based on did:wba and HTTP

did:wba is a Web-based Decentralized Identifier. More information: did:wba, a Web-based Decentralized Identifier.

Our latest version supports decentralized authentication based on did:wba and HTTP. We provide a did:wba server for testing. Server API documentation: did:wba Server Test API Documentation.

Example code path: examples/did_wba_examples. Including:

  • basic.py: A basic example of DID WBA authentication. Creates a DID document and private key, uploads the DID document to the server, and tests DID authentication.
  • full.py: Builds on basic.py, adding token verification and DID document validation.
  • client.py: A client example for testing if your server supports DID WBA authentication, using pre-created DID documents and private keys.

Run these files directly to experience DID WBA authentication:

python basic.py
python full.py
python client.py

You can also experience DID WBA authentication through our demo page: DID WBA Authentication Page. This page demonstrates the process of creating a DID identity on one platform (pi-unlimited.com) and then verifying the identity on another platform (agent-network-protocol.com).

Meta-Protocol Negotiation Example

We support meta-protocol negotiation where Alice and Bob first negotiate a protocol, generate processing code, and then communicate using the protocol code.

Run the demo code in examples/negotiation_mode directory. Start Bob's node first, then Alice's node.

  1. Start Bob's node
python negotiation_bob.py
  1. Start Alice's node
python negotiation_alice.py

The logs will show successful connection, protocol negotiation, code generation, and data communication between Alice and Bob.

Note: Meta-protocol negotiation requires Azure OpenAI API configuration (currently only supports Azure OpenAI). Configure these environment variables in the ".env" file in the project root: AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_DEPLOYMENT, AZURE_OPENAI_MODEL_NAME

Contact Us

Author: Gaowei Chang
Email: chgaowei@gmail.com

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_connect-0.3.1.tar.gz (66.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_connect-0.3.1-py3-none-any.whl (87.5 kB view details)

Uploaded Python 3

File details

Details for the file agent_connect-0.3.1.tar.gz.

File metadata

  • Download URL: agent_connect-0.3.1.tar.gz
  • Upload date:
  • Size: 66.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/23.5.0

File hashes

Hashes for agent_connect-0.3.1.tar.gz
Algorithm Hash digest
SHA256 dcc66a50e2ab57c03babde088a3160bdf5920ec15c88867b27da19a5ccd6c312
MD5 3937b64627ce374d7e213f14b68e710b
BLAKE2b-256 c9bfc87986e5da3e335f27dfb11e3dd9fca7bde7b44ff366041412ab580e310b

See more details on using hashes here.

File details

Details for the file agent_connect-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: agent_connect-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 87.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/23.5.0

File hashes

Hashes for agent_connect-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77e7238a36ab39322dd643d2ffd5ee3f6dc0d033fdf59ffe4bcd3ac1eb591d88
MD5 29452ff6fdd24f679cbc179f68d5d84a
BLAKE2b-256 e6ae076c1a20cb2b08863101bd4ef9fe9bc2eee740b79be20890cbfafef1fe3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page