A Byzantine Fault-Tolerant Consensus Protocol for Multi-Agent LLM Systems
Reaching Agreement Among Reasoning LLM Agents with Formal Guarantees
π Documentation β’ π Quick Start β’ π― Features β’ ποΈ Architecture
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.
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 |
| Output first consensus | Stability guarantee (Ξ² rounds) | Robust consensus |
- 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
- β 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
- π§ 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
- π 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
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 β
ββββββββββββββββββ ββββββββββββββββββ ββββββββββββ
- 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
- Python 3.9+
- Docker (optional, for containerized deployment)
- GPU (optional, for OpenClaw nodes)
# 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 keysfrom 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}")# 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
}
}'- Technical Specification - Complete system design and implementation details
- API Reference - REST API documentation
- Deployment Guide - Production deployment instructions
- Contributing - How to contribute to the project
# 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 reached1. 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)
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
# 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: 300openclaw:
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)# Start all services
docker-compose up -d
# Services:
# - aegean-service:8000 (Consensus API)
# - openclaw-gateway:9000 (OpenClaw Gateway)
# - prometheus:9090 (Metrics)
# - grafana:3000 (Dashboards)# 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=aegeanWe welcome contributions! Please see CONTRIBUTING.md for guidelines.
# Install dev dependencies
pip install -r requirements-dev.txt
# Run tests
pytest tests/
# Run linter
flake8 src/
black src/
# Run type checker
mypy src/This project is licensed under the MIT License - see the LICENSE file for details.
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}
}- Original paper: Reaching Agreement Among Reasoning LLM Agents
- Microsoft AutoGen - Multi-agent framework
- FastAPI - Modern web framework
- OpenClaw - LLM inference platform
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: aegean-dev@your-org.com
Built with β€οΈ for the Multi-Agent AI Community
β Star us on GitHub if you find this project useful!