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.
Metadata
Release files for multiagents-framework 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| multiagents_framework-0.1.3.tar.gz | 416.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| multiagents_framework-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 496.7 kB
Release files / multiagents_framework-0.1.3.tar.gz
| Download URL | multiagents_framework-0.1.3.tar.gz |
|---|---|
| Size | 416.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2cdbdc1b860a46844b785704b134735b90a89ec32795d37e263e65e17f6c799
|
|
BLAKE2b-256 checksum How to use checksums |
462cb8b918bbf70b5ffc8f367c2880d6066443dfd5c2cc108cc79634f64f2d6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|
Release files / multiagents_framework-0.1.3-py3-none-any.whl
| Download URL | multiagents_framework-0.1.3-py3-none-any.whl |
|---|---|
| Size | 80.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb72b2eb6fb72157f7fc7664afca918a1fd5bd850ff16a403241a1dbb6c729d9
|
|
BLAKE2b-256 checksum How to use checksums |
a61982e56342b15b1f428713edff8e582d417e40dae01bed9abd47a5a8110787
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|