Skip to content

ulab-uiuc/AgentProtocols

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Multiagent-Protocol

Paper License Python

A comprehensive multi-agent communication framework supporting multiple protocols for distributed AI systems. This framework enables seamless interaction between AI agents across different communication paradigms with built-in security, monitoring, and scalability features.

🌟 Features

  • πŸ”— Multi-Protocol Support: ANP, A2A, ACP, Agora, and custom protocols
  • πŸ—οΈ Modular Architecture: Protocol-agnostic design with pluggable backends
  • πŸ”’ Security-First: DID authentication, E2E encryption, privacy protection
  • πŸ“Š Real-time Monitoring: Performance metrics, health checks, and observability
  • 🌐 Distributed Systems: Support for complex multi-agent workflows
  • πŸ§ͺ Testing Frameworks: Comprehensive testing suites for each protocol
  • ⚑ High Performance: Async/await patterns, concurrent execution

πŸ“‹ Table of Contents

πŸš€ Quick Start

Prerequisites

# Required environment
Python 3.11+
OpenAI API Key (for LLM-based agents)

Installation

# Clone the repository
git clone https://github.com/MultiagentBench/Multiagent-Protocol.git
cd Multiagent-Protocol

# Install dependencies
conda create -n map python==3.11 -y
conda activate map

pip install -r requirements.txt

# Set environment variables
export OPENAI_API_KEY='sk-your-openai-api-key-here'
export OPENAI_BASE_URL='https://your-base-url-here'

🎯 Supported Scenarios & Getting Started

1. 🌍 GAIA (General AI Agent) Framework

Purpose: Task execution and coordination across distributed AI agents

All Available Runners:

# Run with different protocols
python -m scenarios.gaia.runners.run_anp        # ANP Protocol
python -m scenarios.gaia.runners.run_a2a        # A2A Protocol
python -m scenarios.gaia.runners.run_acp        # ACP Protocol
python -m scenarios.gaia.runners.run_agora      # Agora Protocol

# Protocol Router coordination
python -m scenarios.gaia.runners.run_meta_protocol

2. πŸ“‘ Streaming Queue

Purpose: High-throughput message processing with coordinator-worker patterns

Quick Start:

# 1. Set up environment
export OPENAI_API_KEY='sk-your-key'

# 2. Run streaming queue with A2A
python -m scenarios.streaming_queue.runner.run_a2a

# 3. Observe coordinator-worker message processing
# Expected: High-frequency message exchange with load balancing

All Available Runners:

# Stream processing with different protocols
python -m scenarios.streaming_queue.runner.run_anp     # ANP Streaming
python -m scenarios.streaming_queue.runner.run_a2a     # A2A Streaming
python -m scenarios.streaming_queue.runner.run_acp     # ACP Streaming
python -m scenarios.streaming_queue.runner.run_agora   # Agora Streaming

# Protocol Router coordination
python -m scenarios.streaming_queue.runner.run_meta_network

3. πŸ›‘οΈ Safety Tech

Purpose: Privacy-preserving agent communication and security testing

Quick Start:

# 1. Set up environment
export OPENAI_API_KEY='sk-your-key'

# 2. Run privacy-aware security tests
python -m scenarios.safety_tech.runners.run_unified_security_test_anp

# 3. Review privacy protection mechanisms
# Expected: Encrypted communication with privacy compliance reports

All Available Runners:

# Unified security testing
python -m scenarios.safety_tech.runners.run_unified_security_test_anp
python -m scenarios.safety_tech.runners.run_unified_security_test_a2a
python -m scenarios.safety_tech.runners.run_unified_security_test_acp
python -m scenarios.safety_tech.runners.run_unified_security_test_agora

# Protocol Router security analysis
python -m scenarios.safety_tech.runners.run_s2_meta

4. πŸ”„ Fail Storm Recovery

Purpose: Fault-tolerant systems with automatic recovery mechanisms

Supported Protocols: ANP, A2A, ACP, Agora, Protocol Router

Usage:

export OPENAI_API_KEY='sk-your-key-here'

# Fault tolerance testing
python -m scenarios.fail_storm_recovery.runners.run_anp
python -m scenarios.fail_storm_recovery.runners.run_a2a
python -m scenarios.fail_storm_recovery.runners.run_acp
python -m scenarios.fail_storm_recovery.runners.run_agora

# Protocol Router coordination
python -m scenarios.fail_storm_recovery.runners.run_meta # no adapter
python -m scenarios.fail_storm_recovery.runners.run_meta_network # with adapter

5. πŸ§ͺ RouterBench - Protocol Routing Benchmark

Purpose: Benchmark and evaluate protocol routing performance and decision-making

Quick Start:

# 1. Set up environment
export OPENAI_API_KEY='sk-your-key'

# 2. Run the benchmark test
python /root/Multiagent-Protocol/routerbench/run_benchmark.py

# 3. Review benchmark results
# Expected: Protocol routing accuracy, latency metrics, and performance analysis
# Results saved to: routerbench/results/benchmark_results.json

Features:

  • Protocol selection accuracy testing
  • Routing latency benchmarking
  • Multi-protocol comparison
  • Detailed performance reports

πŸ”§ Protocol Guide

ANP (Agent Network Protocol)

  • Features: DID authentication, E2E encryption, WebSocket communication
  • Use Cases: Secure agent networks, identity-verified communications
  • Dependencies: agentconnect_src/ (AgentConnect SDK)

A2A (Agent-to-Agent Protocol)

  • Features: Direct peer communication, JSON-RPC messaging, event streaming
  • Use Cases: High-performance agent coordination, real-time messaging
  • Dependencies: a2a-sdk, a2a-server

ACP (Agent Communication Protocol)

  • Features: Session management, conversation threads, message history
  • Use Cases: Conversational agents, multi-turn interactions
  • Dependencies: acp-sdk

Agora Protocol

  • Features: Tool orchestration, LangChain integration, function calling
  • Use Cases: Tool-enabled agents, LLM-powered workflows
  • Dependencies: agora-protocol, langchain

Protocol Router

  • Features: Protocol abstraction, adaptive routing, multi-protocol support
  • Use Cases: Protocol-agnostic applications, seamless migration

βš™οΈ Configuration

Environment Variables

# Required
export OPENAI_API_KEY='sk-your-openai-api-key'

# Optional
export ANTHROPIC_API_KEY='your-anthropic-key'
export OPENAI_BASE_URL='https://api.openai.com/v1'  # Custom endpoint
export LOG_LEVEL='INFO'                              # DEBUG, INFO, WARNING, ERROR

Configuration Files

Each scenario uses YAML configuration files located in scenario/{scenario}/config/:

# Example: scenario/gaia/config/anp.yaml
model:
  type: "openai"
  name: "gpt-4o"
  temperature: 0.0
  api_key: "${OPENAI_API_KEY}"

network:
  host: "127.0.0.1"
  port_range:
    start: 9000
    end: 9010

agents:
  - id: 1
    name: "Agent1"
    tool: "create_chat_completion"
    max_tokens: 500

workflow:
  type: "sequential"
  max_steps: 5

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Multiagent-Protocol                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Scenarios                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚  β”‚  GAIA   β”‚ β”‚  Streaming  β”‚ β”‚ Safety Tech β”‚ β”‚ Fail Storm  β”‚β”‚
β”‚  β”‚         β”‚ β”‚    Queue    β”‚ β”‚             β”‚ β”‚  Recovery   β”‚β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Protocol Backends                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚  β”‚ ANP β”‚ β”‚ A2A β”‚ β”‚ ACP β”‚ β”‚Agoraβ”‚ β”‚Protocol Routerβ”‚          β”‚
β”‚  β””β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Core Infrastructure                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚
β”‚  β”‚   Network   β”‚ β”‚   Agents    β”‚ β”‚ Monitoring  β”‚            β”‚
β”‚  β”‚   Layer     β”‚ β”‚   Layer     β”‚ β”‚   Layer     β”‚            β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ§ͺ Development

Adding New Protocols

  1. Create protocol backend in scenario/{scenario}/protocol_backends/{protocol_name}/
  2. Implement required interfaces: agent.py, network.py, comm.py
  3. Add configuration in scenario/{scenario}/config/{protocol_name}.yaml
  4. Create runner in scenario/{scenario}/runners/run_{protocol_name}.py

Code Structure

scenario/
β”œβ”€β”€ {scenario}/                    # Scenario implementation
β”‚   β”œβ”€β”€ config/                   # Configuration files
β”‚   β”œβ”€β”€ protocol_backends/        # Protocol implementations
β”‚   β”‚   β”œβ”€β”€ {protocol}/
β”‚   β”‚   β”‚   β”œβ”€β”€ agent.py         # Agent implementation
β”‚   β”‚   β”‚   β”œβ”€β”€ network.py       # Network coordinator
β”‚   β”‚   β”‚   └── comm.py          # Communication backend
β”‚   β”œβ”€β”€ runners/                  # Entry point scripts
β”‚   └── tools/                    # Scenario-specific tools
β”œβ”€β”€ common/                       # Shared utilities
└── requirements.txt              # Dependencies

πŸ“Š Monitoring & Observability

The framework includes comprehensive monitoring capabilities:

  • Performance Metrics: Message throughput, latency, success rates
  • Health Monitoring: Agent status, network connectivity, resource usage
  • Security Auditing: Authentication events, encryption status, privacy compliance
  • Custom Dashboards: Protocol-specific visualizations and alerts

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Steps

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and add tests
  4. Ensure all tests pass: pytest
  5. Commit changes: git commit -m 'Add amazing feature'
  6. Push to branch: git push origin feature/amazing-feature
  7. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support


Built with ❀️ by the Multi-Agent Systems Community

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages