Global orchestrator package for development workflows
Project description
Mahavishnu - Multi-Engine Orchestration Platform
Etymology: From Sanskrit maha (great) + Vishnu (the preserver in Hindu trinity)
Part of the Bodai Ecosystem - The Orchestrator component
Mahavishnu is a world-class multi-engine orchestration platform that provides unified interfaces for managing workflows across multiple repositories. It enables intelligent workflow routing, cross-repository coordination, and headless AI worker orchestration.
Ecosystem Components
| Component | Role | Port | Description |
|---|---|---|---|
| Mahavishnu | Orchestrator | 8680 | Multi-engine workflow orchestration |
| Akosha | Seer | 8682 | Cross-system intelligence & embeddings |
| Dhruva | Curator | 8683 | Persistent object storage with ACID |
| Session-Buddy | Builder | 8678 | Session lifecycle & knowledge graphs |
| Crackerjack | Inspector | 8676 | Quality gates & CI/CD validation |
| Oneiric | Resolver | N/A | Conflict resolution library |
Features
- Multi-Pool Orchestration - Horizontal scaling across local, delegated, and cloud workers
- Cross-Repository Coordination - Track issues, todos, and dependencies across your entire ecosystem
- Headless AI Workers - Execute tasks in parallel using Claude Code and Qwen workers
- Goal-Driven Teams - Create intelligent multi-agent teams from natural language goals
- OpenTelemetry Integration - Native OTel trace ingestion with semantic search using DuckDB
- Repository Messaging - Async message passing between repositories for event-driven coordination
- Role-Based Organization - Intelligent repository taxonomy for workflow routing
- MCP Server - FastMCP-based server exposing 49+ production-ready tools
Quick Links
Essential Reading
- Getting Started Guide - New to Mahavishnu? Start here!
- MCP Tools Reference - Complete API documentation for all 49 MCP tools
- Architecture Documentation - System architecture and design decisions
Visual Learning (Diagrams & Charts)
- Visual Guide - START HERE - 50+ diagrams covering architecture, workflows, security, testing, and more!
- Workflow Diagrams - Common operational procedures with step-by-step visualizations
- Architecture Diagram - Interactive Mermaid diagram of system components
Detailed Guides
- Pool Architecture - Multi-pool orchestration details
- Goal-Driven Teams - Create teams from natural language goals
- Admin Shell Guide - Interactive debugging and monitoring
Table of Contents
- Architecture
- Installation
- Quick Start
- Core Concepts
- Goal-Driven Teams
- MCP Tools
- Configuration
- Development
- Documentation
- Project Status
- Contributing
- License
Architecture
Mahavishnu follows a modular, async-first architecture with these core components:
+-----------------------------------------------------------------+
| Mahavishnu |
+-----------------------------------------------------------------+
| +-------------+ +--------------+ +--------------------+ |
| | CLI | | MCP Server | | Admin Shell | |
| | (Typer) | | (FastMCP) | | (IPython) | |
| +------+------+ +------+-------+ +---------+----------+ |
| | | | |
| +----------------+--------------------+ |
| | |
| +-----------------+------------------+ |
| | MahavishnuApp (Core) | |
| | - Config (Oneiric patterns) | |
| | - Adapter Manager | |
| | - Pool Manager | |
| | - Worker Manager | |
| +-----------------+------------------+ |
| | |
| +------------------------+-----------------------------+ |
| | | | |
| v v v |
| +----------+ +----------+ +---------+ |
| | Pools | | Workers | |Coord | |
| | - Local | | - Qwen | |- Issues | |
| | - Deleg | | - Claude | |- Todos | |
| | - K8s | | - Cont | |- Deps | |
| +----------+ +----------+ +---------+ |
| |
| +-------------------------------------------------------+ |
| | Adapters (Pluggable) | |
| | +----------+ +----------+ +----------------+ | |
| | |LlamaIndex| | Prefect | | Agno | | |
| | | (RAG) | |(Flows) | | (Agents) | | |
| | +----------+ +----------+ +----------------+ | |
| +-------------------------------------------------------+ |
+-----------------------------------------------------------------+
Core Components
Adapter Architecture
- Async base adapter interface for orchestration engines
- Pluggable adapters for LlamaIndex (RAG), Prefect (flows), Agno (agents)
- Easy to add new orchestration backends
Configuration System
- Oneiric-based layered configuration (defaults -> YAML -> env vars)
- Type-safe Pydantic models with validation
- Environment variable overrides via
MAHAVISHNU_{GROUP}__{FIELD}
Pool Management
- Multi-pool orchestration across local, delegated, and cloud workers
- Auto-routing strategies: round_robin, least_loaded, random, affinity
- Memory aggregation across pools with cross-pool search
Error Handling
- Custom exception hierarchy with circuit breaker patterns
- Structured error context with
message,details, andto_dict() - Retry logic with exponential backoff
Installation
Prerequisites
- Python 3.13 or later
- uv (recommended) or pip
- git
Install Mahavishnu
# Clone the repository
git clone https://github.com/lesleslie/mahavishnu.git
cd mahavishnu
# Create virtual environment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install with development dependencies
uv pip install -e ".[dev]"
# Verify installation
mahavishnu --help
See Getting Started Guide for detailed installation instructions.
Quick Start
1. Configure Repositories
Edit settings/repos.yaml to define your repositories:
repos:
- name: "my-project"
package: "my_project"
path: "/path/to/my-project"
nickname: "myproj"
role: "app"
tags: ["backend", "python"]
description: "My backend application"
mcp: "native"
2. Configure Mahavishnu
Edit settings/mahavishnu.yaml:
server_name: "Mahavishnu Orchestrator"
log_level: INFO
repos_path: settings/repos.yaml
# Pool management
pools:
enabled: true
default_type: "mahavishnu"
routing_strategy: "least_loaded"
# Worker orchestration
workers:
enabled: true
max_concurrent: 10
default_type: "terminal-qwen"
# Quality control
qc:
enabled: true
min_score: 80
3. List Repositories
# List all repositories
mahavishnu list-repos
# Filter by tag
mahavishnu list-repos --tag python
# Filter by role
mahavishnu list-repos --role orchestrator
# Show role details
mahavishnu show-role orchestrator
4. Start MCP Server
mahavishnu mcp start
The MCP server starts on http://127.0.0.1:3000 and exposes 49+ production-ready tools.
5. Use Admin Shell
mahavishnu shell
Interactive shell commands:
ps()- Show all workflowstop()- Show active workflows with progresserrors(n=10)- Show recent errors%repos- List repositories
For more workflows, see the Getting Started Guide.
Core Concepts
Repository Roles
Mahavishnu uses a role-based taxonomy to organize repositories:
| Role | Description | Capabilities |
|---|---|---|
| orchestrator | Coordinates workflows | sweep, schedule, monitor, route |
| resolver | Resolves components | resolve, activate, swap, explain |
| manager | Manages state | capture, search, restore, track |
| inspector | Validates quality | test, lint, scan, report |
| builder | Builds applications | render, route, authenticate |
| tool | MCP integrations | connect, expose, integrate |
Pool Types
MahavishnuPool (Direct Management)
- Low-latency local worker execution
- Dynamic scaling (min_workers to max_workers)
- Use for: local development, debugging, CI/CD
SessionBuddyPool (Delegated)
- Delegates to Session-Buddy instances (3 workers each)
- Remote execution via MCP protocol
- Use for: distributed workloads, multi-server deployments
KubernetesPool (Cloud-Native)
- Deploys workers as Kubernetes Jobs/Pods
- Auto-scaling via HPA
- Use for: production deployments, auto-scaling workloads
Worker Types
- terminal-qwen - Headless Qwen CLI execution
- terminal-claude - Headless Claude Code CLI execution
- container-executor - Containerized task execution (Phase 3)
Goal-Driven Teams
Create intelligent multi-agent teams from natural language goals. The GoalDrivenTeamFactory converts your task description into a fully-configured team with appropriate agents, roles, and collaboration modes.
from mahavishnu.engines.goal_team_factory import GoalDrivenTeamFactory
# Create factory
factory = GoalDrivenTeamFactory()
# Parse a natural language goal
parsed = await factory.parse_goal("Review this code for security vulnerabilities")
# -> intent: "review", skills: ["security", "quality"], confidence: 0.85
# Create team configuration
team_config = await factory.create_team_from_goal(parsed.raw_goal)
# -> Team with coordinator, security_specialist, quality_specialist
Quick Example
from mahavishnu.engines.agno_adapter import AgnoAdapter
from mahavishnu.core.config import MahavishnuSettings
# Initialize
settings = MahavishnuSettings()
adapter = AgnoAdapter(config=settings)
await adapter.initialize()
# Create team from goal
team_id = await adapter.create_team_from_goal(
"Review this code for security vulnerabilities"
)
# Run the team
result = await adapter.run_team(team_id, "Analyze the auth module")
CLI Usage
# Parse a goal to see detected intent and skills
mahavishnu goal parse "Build a REST API with authentication"
# Create and run a team from a goal
mahavishnu goal run "Review code for security issues" --repo ./myproject
See Goal-Driven Teams Documentation for complete guide with examples, skill reference, and collaboration modes.
MCP Tools
Mahavishnu's MCP server exposes 49 production-ready tools across 6 categories:
Pool Management (10 tools)
pool_spawn- Spawn new worker poolpool_execute- Execute task on specific poolpool_route_execute- Auto-route to best poolpool_list- List all active poolspool_monitor- Monitor pool metricspool_scale- Scale pool worker countpool_close- Close specific poolpool_close_all- Close all poolspool_health- Get health statuspool_search_memory- Search memory across pools
Worker Orchestration (8 tools)
worker_spawn- Spawn worker instancesworker_execute- Execute task on workerworker_execute_batch- Execute on multiple workersworker_list- List all workersworker_monitor- Monitor worker statusworker_collect_results- Collect worker resultsworker_close- Close specific workerworker_close_all- Close all workers
Coordination (13 tools)
coord_list_issues- List cross-repository issuescoord_get_issue- Get issue detailscoord_create_issue- Create new issuecoord_update_issue- Update issuecoord_close_issue- Close issuecoord_list_todos- List todo itemscoord_get_todo- Get todo detailscoord_create_todo- Create todocoord_complete_todo- Complete todocoord_get_blocking_issues- Get blocking issuescoord_check_dependencies- Validate dependenciescoord_get_repo_status- Get repo statuscoord_list_plans- List plans
Repository Messaging (7 tools)
send_repository_message- Send message between reposbroadcast_repository_message- Broadcast to multiple reposget_repository_messages- Get messages for repoacknowledge_repository_message- Acknowledge messagenotify_repository_changes- Notify about changesnotify_workflow_status- Notify about workflow statussend_quality_alert- Send quality alert
OpenTelemetry (4 tools)
ingest_otel_traces- Ingest OTel tracessearch_otel_traces- Semantic search tracesget_otel_trace- Get trace by IDotel_ingester_stats- Get ingester stats
Session Buddy (7 tools)
index_code_graph- Index codebase structureget_function_context- Get function contextfind_related_code- Find related codeindex_documentation- Index documentationsearch_documentation- Search documentationsend_project_message- Send project messagelist_project_messages- List project messages
See MCP Tools Reference for complete documentation with examples.
Configuration
Mahavishnu uses a layered configuration system:
- Default values in Pydantic models
settings/mahavishnu.yaml(committed to git)settings/local.yaml(gitignored, local overrides)- Environment variables:
MAHAVISHNU_{GROUP}__{FIELD}
Environment Variables
# Authentication
export MAHAVISHNU_AUTH__SECRET="your-32-character-secret"
# Pool configuration
export MAHAVISHNU_POOLS__ENABLED="true"
export MAHAVISHNU_POOLS__DEFAULT_TYPE="mahavishnu"
# OTel storage
export MAHAVISHNU_OTEL_STORAGE__CONNECTION_STRING="postgresql://..."
# Cross-project auth
export MAHAVISHNU_CROSS_PROJECT_AUTH_SECRET="shared-secret"
Key Configuration Sections
# Pool management
pools:
enabled: true
default_type: "mahavishnu"
routing_strategy: "least_loaded" # round_robin, least_loaded, random, affinity
memory_aggregation_enabled: true
# Worker orchestration
workers:
enabled: true
max_concurrent: 10
default_type: "terminal-qwen"
# OpenTelemetry trace storage
otel_storage:
enabled: false # Set to true to enable PostgreSQL + pgvector
connection_string: "" # Set via environment variable
embedding_model: "all-MiniLM-L6-v2"
# OpenTelemetry ingester (DuckDB)
otel_ingester:
enabled: false # Set to true for zero-dependency OTel storage
hot_store_path: ":memory:" # Use file path for persistence
Development
Running Tests
# Run all tests
pytest
# Run unit tests only
pytest tests/unit/
# Run with coverage
pytest --cov=mahavishnu --cov-report=html
# Run specific test file
pytest tests/unit/test_config.py -v
# Property-based tests
pytest tests/property/
Code Quality
# Format code
ruff format mahavishnu/
# Lint code
ruff check mahavishnu/
# Type checking
mypy mahavishnu/
# Security scan
bandit -r mahavishnu/
# Run all checks via Crackerjack
crackerjack run
Project Structure
mahavishnu/
+-- mahavishnu/
| +-- core/ # Core application logic
| | +-- app.py # MahavishnuApp main class
| | +-- config.py # Configuration models
| | +-- adapters/ # Adapter implementations
| +-- engines/ # Engine implementations
| | +-- agno_adapter.py # Agno multi-agent adapter
| | +-- goal_team_factory.py # Goal-driven team creation
| | +-- agno_teams/ # Team configuration and management
| | +-- agno_tools/ # Native Agno tools
| +-- mcp/ # MCP server and tools
| | +-- server_core.py
| | +-- tools/ # MCP tool implementations
| +-- pools/ # Pool management
| +-- workers/ # Worker orchestration
| +-- cli.py # CLI commands
+-- tests/ # Test suite
+-- docs/ # Documentation
+-- examples/ # Example scripts
| +-- goal_driven_team_tutorial.py # Goal-driven teams tutorial
+-- settings/ # Configuration files
+-- mahavishnu.yaml
+-- repos.yaml
Documentation
- Getting Started - Installation and first steps
- MCP Tools Reference - Complete API documentation
- Architecture - System architecture and evolution
- Pool Architecture - Multi-pool orchestration details
- Goal-Driven Teams - Create teams from natural language goals
- Admin Shell Guide - Interactive debugging
- Production Deployment - Production readiness
- MCP Tools Specification - Detailed tool specs
- Security Checklist - Security guidelines
Project Status
Current Implementation
Quality Score: 92/100 (Excellent - Production Ready)
Completed:
- Security hardening (JWT auth, Claude Code + Qwen support)
- Async base adapter architecture
- FastMCP-based MCP server (49 tools)
- Multi-pool orchestration (local, delegated, K8s)
- Worker orchestration (terminal-qwen, terminal-claude)
- Cross-repository coordination (issues, todos, dependencies)
- Repository messaging (async event-driven)
- OpenTelemetry integration (DuckDB + semantic search)
- Configuration system (Oneiric patterns)
- CLI with authentication framework
- Admin shell (IPython-based)
- Test infrastructure (12 test files)
Partially Complete:
- LlamaIndex adapter (RAG pipelines, fully implemented)
- Prefect adapter (stub, framework skeleton)
- Agno adapter (stub, framework skeleton)
Roadmap:
- Phase 3: Adapter Implementation (6-9 weeks)
- Phase 4: Production Features (error recovery, full observability)
- Phase 5: Comprehensive Testing & Documentation
- Phase 6: Production Readiness (security audit, benchmarking)
Estimated Time to Production: 10 weeks from current state
Contributing
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
pytest - Run quality checks:
ruff check mahavishnu/andmypy mahavishnu/ - Commit your changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Submit a pull request
Development Guidelines
- Follow PEP 8 style guide
- Add tests for new features
- Update documentation as needed
- Keep PRs focused and small
- Write clear commit messages
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Oneiric - Configuration and logging framework
- FastMCP - MCP server implementation
- mcp-common - Shared MCP types and contracts
- Crackerjack - Quality control and testing
Made with :heart: by the Mahavishnu team
For questions and support, please open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
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 mahavishnu-0.3.2.tar.gz.
File metadata
- Download URL: mahavishnu-0.3.2.tar.gz
- Upload date:
- Size: 4.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
187d6522c06c2a2cfa1f7db09c2712c997664f67e18eafafc2f02bb2a11308c7
|
|
| MD5 |
e9f9eef2f4700a9bd8ca803dda0c4bfc
|
|
| BLAKE2b-256 |
0d8bb6eac7e96bbd8cecf4920b6bfa8a17890adc2db26000372b4d52efbee011
|
File details
Details for the file mahavishnu-0.3.2-py3-none-any.whl.
File metadata
- Download URL: mahavishnu-0.3.2-py3-none-any.whl
- Upload date:
- Size: 971.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
141bd2b3b040948e10e4630db5558182cd693ef1a6de8a5d413a722fb0bced7a
|
|
| MD5 |
9968e92938c20ce07e9f693ce1d97dc7
|
|
| BLAKE2b-256 |
a25510422f561e29575f1ebe3c7cc64d9faf2e21ea430aa52808d3fce945e786
|