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

DID Document Generation Tool

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.

Agent Network Explorer

You can explore the Agent Network using natural language through our web-based tool:

This tool allows you to:

  • Explore the Agent Network Protocol (ANP) ecosystem using natural language
  • Connect to the world of agents through the ANP protocol
  • Interact with various types of agents by simply entering the URL of their agent description document

The explorer provides an intuitive interface to understand how agents communicate and operate within the ANP framework, making it easier to visualize the connections and capabilities of different agents in the network.

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.6.tar.gz (96.3 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.6-py3-none-any.whl (130.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agent_connect-0.3.6.tar.gz
  • Upload date:
  • Size: 96.3 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.6.tar.gz
Algorithm Hash digest
SHA256 2a4080277e267ff9bc2790765fac9ed97486174598095213c6e816a245fe8825
MD5 0e20c72dca9715dd6ee52fe5bf3a029e
BLAKE2b-256 81ecf67c0fa838d1a88689f1cf5771a3520a7ac0b50adbd975c1b7a0a438b487

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agent_connect-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 130.8 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 187450c0a9fbc3d16e490af2d192c905e91d7a34dd2289e2effbef7d9b8b90e3
MD5 afe85d86ab910a615686c87c3058b7b8
BLAKE2b-256 3229092881109d7d734c0152fcc125610e7d920b337bf393bc0dc5bad4aafd7e

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