Hybrid Event-Driven Orchestration Framework
Project description
MultiAgents Framework
๐ LLM-Powered Multi-Agent Orchestration Framework
A hybrid event-driven orchestration framework designed specifically for LLM agents and AI developers. Build intelligent, conversational, and autonomous multi-agent systems with built-in DSPy integration, real-time collaboration, and production-ready tooling.
โ ๏ธ Experimental: This framework is in active development. APIs may change between versions.
๐ฏ Built for LLM Agents
Perfect for AI developers building:
- ๐ค Conversational AI Systems - Multi-agent chat with intelligent routing
- ๐ Research Assistants - Collaborative research with specialized agents
- ๐ง LLM-Driven Workflows - Dynamic orchestration with real-time decisions
- ๐ ๏ธ Tool-Using Agents - Multi-modal agents with external integrations
- ๐ Data Analysis Pipelines - Intelligent data processing with LLM insights
โจ Key Features
- ๐ง LLM-First Design: Built-in DSPy integration with Gemini, GPT, Claude support
- ๐ฌ Conversational AI: Intelligent routing between conversation and task execution
- ๐ง Tool Integration: Easy integration with web search, calculators, APIs
- ๐ญ Multi-Agent Collaboration: Specialized agents working together seamlessly
- ๐ Production Monitoring: Complete observability designed for LLM workflows
- ๐ Event-Driven: Scalable async communication perfect for AI workloads
- ๐ก๏ธ Fault Tolerance: Built-in compensation and rollback for complex workflows
Quick Start
Prerequisites
- Python 3.8+
- Redis Server (for event bus and state storage)
Start Redis:
# macOS with Homebrew
brew services start redis
# Ubuntu/Debian
sudo systemctl start redis
# Docker
docker run -d -p 6379:6379 redis:alpine
Installation
Install from PyPI (Recommended):
# Install the framework
pip install multiagents-framework
# Or with uv (faster)
uv add multiagents-framework
Development Installation:
1. Clone the repository:
git clone https://github.com/xavierau/multiagents.git
cd multiagents
2. Create virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
3. Install in development mode:
pip install -e .
Verify Installation:
multiagents --version
multiagents --help
๐ Quick Start Examples
Run Interactive Examples:
# Interactive example menu
python run_examples.py
# Or run specific examples:
multiagents --examples
Available Examples:
- ๐ฌ Smart Research Assistant - LLM-powered conversational research with web search
- ๐ค Interactive Chatbot - Multi-personality conversational AI with DSPy
- ๐ E-commerce Workflow - Complete order processing with compensations
- ๐ Monitoring Demo - Production-ready observability features
Try the Smart Research Assistant:
# Navigate to example (if installed from source)
cd examples/smart_research_assistant
python cli.py
# Ask questions like:
# "What are the latest trends in renewable energy?"
# "Calculate compound interest on $5000 at 8% for 3 years"
# "Hi!" (conversational mode)
Framework Overview
Core Components
- Orchestrator: Manages workflow state and coordinates activities
- Workers: Stateless task executors created with simple decorators
- Event Bus: Decoupled communication layer (Redis Pub/Sub)
- Monitoring: Comprehensive observability and debugging
Basic Usage
from multiagents import (
Orchestrator, WorkflowBuilder, WorkerManager, worker
)
from multiagents.event_bus.redis_bus import RedisEventBus
# Define workers
@worker("process_data")
async def process_data_worker(context):
data = context["input_data"]
# Process the data
return {"processed": data, "timestamp": "2024-01-01T00:00:00Z"}
# Create workflow
workflow = (WorkflowBuilder("data_processing")
.add_step("process", "process_data")
.build())
# Set up framework
event_bus = RedisEventBus()
worker_manager = WorkerManager(event_bus)
orchestrator = Orchestrator(workflow, event_bus)
# Register worker and start
worker_manager.register(process_data_worker)
await event_bus.start()
await worker_manager.start()
await orchestrator.start()
# Execute workflow
transaction_id = await orchestrator.execute_workflow(
"data_processing",
{"input_data": "example data"}
)
Monitoring & Observability
The framework includes comprehensive monitoring:
from multiagents.monitoring import MonitoringConfig, EventMonitor, WorkerMonitor
# Setup monitoring
config = MonitoringConfig()
logger = config.create_logger()
event_monitor = EventMonitor(logger=logger)
worker_monitor = WorkerMonitor(logger=logger)
# Integrate with framework
event_bus = RedisEventBus(event_monitor=event_monitor, logger=logger)
worker_manager = WorkerManager(event_bus, worker_monitor=worker_monitor, logger=logger)
Monitoring Features:
- Event Lifecycle Tracking: Complete event journey from dispatch to completion
- Worker Performance: Success rates, processing times, health monitoring
- Structured Logging: JSON logs with automatic rotation
- Error Tracking: Detailed error context and failure patterns
- Real-time Metrics: Performance dashboards and alerting
Configuration (monitoring.yaml):
logging:
default_logger: "file"
level: "INFO"
file_path: "./logs/multiagents.log"
event_monitoring:
enabled: true
trace_retention_hours: 24
worker_monitoring:
enabled: true
health_check_interval_seconds: 30
๐ Example Applications
1. ๐ฌ Smart Research Assistant
LLM-powered conversational research system
- Intelligent routing between conversation and research
- Multi-agent collaboration (Coordinator, Researcher, Analyst, Formatter)
- Real Google Custom Search API integration
- Gemini LLM with DSPy optimization
- Production-ready configuration system
2. ๐ค Interactive Chatbot
Multi-personality conversational AI
- DSPy-powered natural conversations
- Configurable personalities and responses
- Context-aware conversation management
- Real-time interaction with memory
3. ๐ E-commerce Order Processing
Production-ready order workflow
- Multi-step order validation and processing
- Intelligent inventory and payment handling
- Automatic compensation and rollback
- LLM-generated confirmations and notifications
4. ๐ Production Monitoring
Enterprise-grade observability
- Real-time agent performance monitoring
- Event lifecycle tracking and debugging
- Structured logging with automatic rotation
- Error pattern analysis and alerting
Development
Project Structure
multiagents/
โโโ orchestrator/ # Workflow orchestration
โโโ worker_sdk/ # Worker development SDK
โโโ event_bus/ # Event bus implementations
โโโ monitoring/ # Observability system
โโโ core/ # Core utilities
โโโ examples/ # Example implementations
Key Design Principles
- SOLID Principles: Clean, maintainable architecture
- Event-Driven: Fully decoupled communication
- Fault Tolerance: Built-in compensation and rollback
- Observability: Comprehensive monitoring and debugging
- Developer Experience: Simple, intuitive APIs
Common Commands
# Install dependencies
pip install -r requirements.txt
# Run examples
python run_examples.py
# Run tests (when available)
pytest
# Format code
black .
ruff check --fix .
# Type checking
mypy multiagents/
Architecture
The framework follows a hybrid orchestration/choreography pattern:
- Orchestration: Centralized workflow management with state machine
- Choreography: Decoupled event-driven communication between components
- Saga Pattern: Distributed transaction management with compensations
- Event Sourcing: Complete audit trail of all activities
This approach provides the benefits of both patterns:
- Centralized Logic: Easy to understand and debug workflows
- Decoupled Components: Scalable and resilient architecture
- Fault Tolerance: Automatic compensation and recovery
- Observability: Complete visibility into system behavior
Contributing
- Follow SOLID principles and clean code practices
- Add comprehensive monitoring to all components
- Include tests for new functionality
- Update documentation and examples
๐ LLM Agent Integration
Claude Code Integration: This framework includes specialized Claude Code subagents for enhanced development:
# Auto-install Claude subagent (when using Claude Code)
multiagents install-agent claude-code
# Or manually copy the agent
cp multiagents/agents/multiagents.md ~/.claude/agents/
llms.txt Support:
This project includes llms.txt for LLM consumption with documentation pointers to GitHub for always up-to-date information.
๐ Community & Support
- GitHub: https://github.com/xavierau/multiagents
- PyPI: https://pypi.org/project/multiagents-framework/
- Issues: Report bugs and request features
- Discussions: Community discussions and help
๐ License
MIT License - see LICENSE file for details.
Built with โค๏ธ for the LLM agent community
Making multi-agent AI systems accessible, reliable, and production-ready.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multiagents_framework-0.1.1.tar.gz.
File metadata
- Download URL: multiagents_framework-0.1.1.tar.gz
- Upload date:
- Size: 339.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc00c2d91584db86cf1c63d3ed442a9a7a3f207047f91fe4dc4350edd9f2ac71
|
|
| MD5 |
1bc85b7aab50e3d88af51d8d38f6d182
|
|
| BLAKE2b-256 |
ec8132c0b4e69a5532d4cd2f723b5cb27ee73be6605fcd3503241bdf7f3d632f
|
File details
Details for the file multiagents_framework-0.1.1-py3-none-any.whl.
File metadata
- Download URL: multiagents_framework-0.1.1-py3-none-any.whl
- Upload date:
- Size: 77.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd07e75a8ff2f96d3303373bbd43e6222d95f5357519dbd6f6fcbaea340e1c01
|
|
| MD5 |
d6c44af034cd82364db33732c83bed52
|
|
| BLAKE2b-256 |
1974ec408f85f1ea24c86c888988dea9798af68b40a5530ae28035961bcd0827
|