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/agent-network-protocol/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 (service.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

Tools

We provide a DID document generation tool, which you can run by executing python generate_did_doc.py to generate a DID document.

python generate_did_doc.py <did> [--agent-description-url URL] [--verbose]

For detailed usage, refer to the documentation: README_did_generater_cn.md.

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.

Copyright Notice

Copyright (c) 2024 GaoWei Chang
This file is released under the MIT License. You are free to use and modify it, but you must retain this copyright notice.

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.5.tar.gz (67.9 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.5-py3-none-any.whl (93.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agent_connect-0.3.5.tar.gz
  • Upload date:
  • Size: 67.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/23.5.0

File hashes

Hashes for agent_connect-0.3.5.tar.gz
Algorithm Hash digest
SHA256 2ba4dc4ce8f0b749d57ed95d5bf5d60d5d7174a3773d72f6b8a2d96cdedfd5f5
MD5 a363c4682c301d3f3043560eecc7a250
BLAKE2b-256 95d7f8ec62333f38aa5d97d730abeb088cb7251fdfe76810ce2c277c4ec19777

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agent_connect-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 93.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/23.5.0

File hashes

Hashes for agent_connect-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4f9dc52eb982014f0ac91de603c6efa6c99d0031c2bc358276b5c04dd67328a3
MD5 5d2051c25fee18d92afc3c06c3a36d14
BLAKE2b-256 caf33b7ebecb6948133e8adec7ca5a7dda5f2b0be1fdabffa3b1135a87e70435

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