Skip to content

🀝 Aegean: A Byzantine Fault-Tolerant Consensus Protocol for Multi-Agent LLM Systems | The multi-agent consensus protocol implemented based on the paper supports dynamic integration of frameworks such as AutoGen and OpenClaw

License

Notifications You must be signed in to change notification settings

hetu-project/aegean-consensus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🀝 Aegean Consensus

A Byzantine Fault-Tolerant Consensus Protocol for Multi-Agent LLM Systems

License: MIT Python 3.9+ Paper

Reaching Agreement Among Reasoning LLM Agents with Formal Guarantees

πŸ“– Documentation β€’ πŸš€ Quick Start β€’ 🎯 Features β€’ πŸ—οΈ Architecture


🌟 Overview

Aegean is a production-ready implementation of the consensus protocol described in the paper "Reaching Agreement Among Reasoning LLM Agents" (arXiv:2512.20184). It enables multiple LLM agents to reach reliable consensus on complex reasoning tasks with formal guarantees of correctness.

Why Aegean?

Traditional multi-agent systems suffer from three critical problems:

Problem Traditional Approach Aegean Solution Performance Gain
πŸ”„ Fixed Rounds Predetermined iteration limit Adaptive termination via stability horizon 1.2-20Γ— faster
⏱️ Barrier Sync Wait for slowest agent Early termination mechanism Latency decoupled
⚠️ Temporary Agreement Output first consensus Stability guarantee (β rounds) Robust consensus

Key Results from Paper

  • Latency Reduction: 1.2Γ— to 20.2Γ— faster (AIME dataset)
  • Token Efficiency: 1.1Γ— to 4.4Γ— fewer tokens
  • Accuracy Improvement: +2.3% to +5.1% across benchmarks
  • Formal Guarantees: Refinement validity, monotonicity, and termination

🎯 Features

Core Protocol

  • βœ… Quorum Detection - Byzantine fault-tolerant voting (Section 5.1)
  • βœ… Stability Horizon - Prevents premature consensus (Section 5.2)
  • βœ… Early Termination - Cancels slow agents after quorum (Section 6)
  • βœ… Refinement Rounds - Iterative solution improvement
  • βœ… Formal Guarantees - Proven safety and liveness properties

Multi-Framework Support

  • πŸ”§ AutoGen Integration - Native support for Microsoft AutoGen
  • πŸ¦… OpenClaw Integration - Dynamic node activation via message triggers
  • πŸ”Œ Custom Agents - Easy-to-implement agent interface
  • 🌐 Distributed Architecture - gRPC-based multi-node deployment

Production Ready

  • πŸš€ FastAPI Service - RESTful API with async support
  • πŸ“Š Prometheus Metrics - Built-in monitoring and alerting
  • 🐳 Docker/K8s - Container-ready deployment
  • πŸ“ Structured Logging - Debug-friendly with correlation IDs

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Client Layer                          β”‚
β”‚         Web UI | CLI | Python SDK | REST API            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Aegean Consensus Service                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Consensus Coordinator                             β”‚ β”‚
β”‚  β”‚  β€’ Leader Election                                 β”‚ β”‚
β”‚  β”‚  β€’ Quorum Detection                                β”‚ β”‚
β”‚  β”‚  β€’ Stability Tracking                              β”‚ β”‚
β”‚  β”‚  β€’ Early Termination                               β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  OpenClaw Gateway                                  β”‚ β”‚
β”‚  β”‚  β€’ Dynamic Node Activation                         β”‚ β”‚
β”‚  β”‚  β€’ Lifecycle Management                            β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                             β”‚              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
β”‚ AutoGen Agents β”‚         β”‚ OpenClaw Nodes β”‚  β”‚  Custom  β”‚
β”‚ (Static Pool)  β”‚         β”‚ (On-Demand)    β”‚  β”‚  Agents  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Design Highlights

  • Passive OpenClaw Activation: Nodes start only when needed, saving GPU resources
  • Dynamic Registration: Agents register at runtime, not pre-configured
  • Direct Communication: HTTP/gRPC for low-latency consensus
  • Hybrid Agent Pool: Mix static (AutoGen) and dynamic (OpenClaw) agents

πŸš€ Quick Start

Prerequisites

  • Python 3.9+
  • Docker (optional, for containerized deployment)
  • GPU (optional, for OpenClaw nodes)

Installation

# Clone the repository
git clone https://github.com/your-org/aegean-consensus.git
cd aegean-consensus

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env with your API keys

Basic Usage

from aegean import ConsensusCoordinator, AgentRegistry

# Initialize
registry = AgentRegistry()
coordinator = ConsensusCoordinator(
    agent_registry=registry,
    quorum_size=2,
    stability_horizon=2
)

# Run consensus
result = await coordinator.run_consensus(
    consensus_id="task-001",
    task="What is the capital of France?",
    enable_openclaw=True
)

print(f"Consensus: {result.final_solution.answer}")
print(f"Rounds: {result.current_round}")
print(f"Agents: {result.participating_agents}")

Run as Service

# Start the FastAPI service
python main.py

# Or use Docker
docker-compose up -d

# Test the API
curl -X POST http://localhost:8000/api/consensus/solve \
  -H "Content-Type: application/json" \
  -d '{
    "task": "Solve: 2x + 5 = 13",
    "config": {
      "quorum_size": 2,
      "stability_horizon": 2,
      "enable_openclaw": true
    }
  }'

πŸ“– Documentation


πŸ”¬ How It Works

The Aegean Protocol (Simplified)

# Algorithm 1 from the paper
def aegean_consensus(task, agents):
    # 1. Leader Election
    leader = elect_leader(agents)
    
    # 2. Collect Initial Solutions
    solutions = collect_solutions(agents, task)
    
    # 3. Refinement Loop
    for round in range(max_rounds):
        # Check quorum (β‰₯ ⌈N/2βŒ‰ agents agree)
        candidate = check_quorum(solutions)
        
        if candidate:
            # Update stability tracker
            if stability_tracker.update(candidate):
                # Stable for Ξ² rounds β†’ consensus!
                return candidate
        
        # Refine solutions based on previous round
        solutions = refine_solutions(agents, solutions)
    
    return None  # No consensus reached

Key Mechanisms

1. Quorum Detection (Section 5.1)

Quorum Size Ξ± = ⌈N/2βŒ‰ (simple majority)
Example: 5 agents β†’ need 3 to agree

2. Stability Horizon (Section 5.2)

Candidate must maintain quorum for Ξ² consecutive rounds
Example: Ξ²=2 means 2 rounds of stable agreement

3. Early Termination (Section 6)

Cancel slow agents after collecting Ξ± responses
Latency = max(fastest Ξ± agents), not max(all agents)

πŸ§ͺ Benchmarks

Performance comparison on standard datasets (from paper):

Dataset Metric Baseline Aegean Improvement
GSM8K Latency 41.2s 10.0s 4.1Γ— faster
Tokens 1,200 1,090 1.1Γ— fewer
Accuracy 87.5% 89.8% +2.3%
MMLU Latency 88.4s 10.0s 8.8Γ— faster
Tokens 2,700 1,000 2.7Γ— fewer
Accuracy 76.2% 78.0% +1.8%
AIME Latency 202.0s 10.0s 20.2Γ— faster
Tokens 4,400 1,000 4.4Γ— fewer
Accuracy 23.3% 28.4% +5.1%

Note: Results from paper experiments with N=5 agents, Ξ±=3, Ξ²=2


πŸ› οΈ Configuration

Basic Configuration

# config/production.yaml
consensus:
  quorum_size: 2          # ⌈N/2βŒ‰ for N agents
  stability_horizon: 2    # Ξ² rounds for stability
  max_rounds: 5           # Maximum refinement rounds
  timeout: 300            # Seconds

agents:
  autogen:
    - id: agent_0
      model: gpt-4
      temperature: 0.7
    - id: agent_1
      model: claude-3-opus
      temperature: 0.7

openclaw:
  enabled: true
  cluster_url: http://openclaw-cluster:9000
  timeout: 300

OpenClaw Integration

openclaw:
  enabled: true
  cluster_url: http://openclaw-cluster:9000
  callback_url: http://aegean-service:8000
  activation_mode: passive    # Start nodes on-demand
  registration_mode: dynamic  # Register at runtime
  communication: direct       # HTTP/gRPC (not message queue)

🐳 Deployment

Docker Compose

# Start all services
docker-compose up -d

# Services:
# - aegean-service:8000 (Consensus API)
# - openclaw-gateway:9000 (OpenClaw Gateway)
# - prometheus:9090 (Metrics)
# - grafana:3000 (Dashboards)

Kubernetes

# Deploy to K8s cluster
kubectl apply -f k8s/aegean-deployment.yaml
kubectl apply -f k8s/openclaw-deployment.yaml

# Check status
kubectl get pods -l app=aegean

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Setup

# Install dev dependencies
pip install -r requirements-dev.txt

# Run tests
pytest tests/

# Run linter
flake8 src/
black src/

# Run type checker
mypy src/

πŸ“„ License

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


πŸ“š Citation

If you use Aegean in your research, please cite the original paper:

@article{aegean2024,
  title={Reaching Agreement Among Reasoning LLM Agents},
  author={[Authors from paper]},
  journal={arXiv preprint arXiv:2512.20184},
  year={2024}
}

πŸ™ Acknowledgments


πŸ“ž Contact


Built with ❀️ for the Multi-Agent AI Community

⭐ Star us on GitHub if you find this project useful!

About

🀝 Aegean: A Byzantine Fault-Tolerant Consensus Protocol for Multi-Agent LLM Systems | The multi-agent consensus protocol implemented based on the paper supports dynamic integration of frameworks such as AutoGen and OpenClaw

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages