LeafMesh — YAML-native multi-agent orchestration platform
Project description
LeafMesh — Multi-Agent AI Orchestration Platform
YAML-native multi-agent AI platform with self-healing and evolutionary capabilities
LeafMesh transforms multi-agent AI development through declarative YAML configuration that becomes executable intelligence. Built on the MANAGED_MESH architecture with production-ready coordination and persistence.
Core Features
- YAML-Native Intelligence - Zero-code agent creation with AST-parsed configuration
- Built-in Coordination - Manager and Summarizer agents provide automatic oversight
- MANAGED_MESH Architecture - Direct agent communication with conditional routing
- Redis-Powered Persistence - Automatic session management and conversation history
- Enterprise Tool Ecosystem - 15+ built-in tools with OpenAI-compatible function calling
- Advanced Parallel Processing - Multi-session threading with intelligent coordination
Production Features
- Self-Healing Networks - 6 autonomous healing actions with failure detection
- Evolutionary Optimization - Genetic algorithms with real fitness testing
- Adaptive Model Intelligence - ML-powered model selection with performance prediction
Quick Start
1. Installation
pip install leafmesh
2. Environment Setup
# Required: OpenAI API key
export OPENAI_API_KEY="your-openai-key"
# Optional: Additional providers
export ANTHROPIC_API_KEY="your-anthropic-key"
export GOOGLE_API_KEY="your-google-key"
3. Redis Setup
Local Redis:
# macOS
brew install redis && brew services start redis
# Ubuntu/Debian
sudo apt install redis-server && sudo systemctl start redis
# Docker
docker run -d -p 6379:6379 redis:alpine
4. Basic Usage
from leafmesh import LeafMesh
# Initialize from YAML configuration
sdk = LeafMesh.from_yaml("config.yaml")
# Start the mesh
await sdk.start()
# Process requests
response = await sdk.process_request(
session_id="user_session",
input_data={"message": "Hello, how can you help me?"}
)
print(response)
Example YAML Configuration:
name: "my_mesh"
architecture: "managed_mesh"
# Built-in coordination
manager:
enabled: true
model: "gpt-4o"
summarizer:
enabled: true
model: "gpt-4o-mini"
# User-defined agents
agents:
conversation_agent:
name: "conversation_agent"
model: "gpt-4o-mini"
prompt: "You are a helpful AI assistant."
yields:
response: "string"
confidence: "number"
tools: ["calculator", "current_time"]
Architecture Overview
LeafMesh implements a MANAGED_MESH architecture with:
- LLM Agents - YAML-defined with optional Python enhancement
- Manager Agent - Built-in coordination and rule enforcement
- Summarizer Agent - Omnipresent monitoring and analysis
- Redis Persistence - Automatic session and conversation storage
- Event System - All communication flows through events
- Tool System - OpenAI-compatible function calling
For detailed architecture information, see docs/ARCHITECTURE.md
Agent Enhancement
Add Python logic to YAML-defined agents:
@sdk.intelligence("conversation_agent")
async def enhance_conversation(llm_response, input_data, context):
"""Add business logic to agent responses"""
# Access conversation history
history = context.get("conversation_history", [])
# Enhance the LLM response
enhanced_response = add_context(llm_response, history)
# Trigger other agents conditionally
if needs_specialist(enhanced_response):
await sdk.trigger_agents(data={"analysis": enhanced_response})
return {
"response": enhanced_response,
"confidence": calculate_confidence(enhanced_response)
}
Revolutionary Features
Self-Healing Networks
# Enable automatic failure recovery
await sdk.enable_self_healing()
# Monitor agent health
health = await sdk.get_agent_health_status()
stats = await sdk.get_healing_statistics()
Evolutionary Optimization
# Optimize mesh configuration automatically
test_scenarios = [
{"input": "Test case 1", "agents": ["conversation_agent"]},
{"input": "Test case 2", "agents": ["technical_agent"]}
]
best_genome = await sdk.evolve_swarm_architecture(test_scenarios)
await sdk.apply_evolved_configuration()
Adaptive Model Selection
# Automatic model selection based on request characteristics
response = await sdk.adaptive_execute(
prompt="Analyze this complex scenario",
preferred_models=["gpt-4o", "claude-3.5-sonnet"]
)
Documentation
- Architecture Guide - Technical implementation details
- Debugging Guide - Troubleshooting and monitoring
- Getting Started - Run
create-leafmesh my-projectto scaffold a complete example project
Use Cases
LeafMesh excels at:
- Customer Service Systems - Multi-tier workflows with self-healing
- Data Analysis Pipelines - Collaborative analytical workflows
- Content Creation - Coordinated writing and editing
- Decision Support - Complex decision-making with oversight
- Workflow Automation - Business process automation
Framework Comparison
| Feature | LeafMesh | LangGraph | CrewAI | AutoGen |
|---|---|---|---|---|
| YAML Configuration | Primary | Code-based | Code-based | Code-based |
| Built-in Coordination | Manager/Summarizer | Manual | Manual | Manual |
| Auto-Persistence | Redis | Manual | Manual | Manual |
| Self-Healing | Production | None | None | None |
| Evolutionary Optimization | Genetic Algorithm | None | None | None |
Licensing
LeafMesh is commercial software owned by LeafCraft.
- Evaluation: 30-day free evaluation for research/development
- Commercial: Requires valid commercial license for revenue-generating use
- Enterprise: Custom enterprise licensing available
Licensing: info@leafcraftstudios.com
Getting Started
- Install LeafMesh and set up Redis
- Create your first YAML configuration with basic agents
- Add Python enhancements for custom logic
- Enable revolutionary features for production
LeafMesh: Production-ready multi-agent AI with YAML-driven simplicity
Copyright 2025 LeafCraft. All rights reserved.
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 Distributions
Built Distributions
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 leafmesh-2.1.29-cp314-none-any.whl.
File metadata
- Download URL: leafmesh-2.1.29-cp314-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.14
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c42dd4d10e907690830903d1df41c73c9125c64e942c5f6902d4f5f7d67ab616
|
|
| MD5 |
63a6efd60411ec1112ea167484e706ab
|
|
| BLAKE2b-256 |
344cf32a1997827d6cb5c660f474a65c029b68a7b5f3b04cb2847a5052322a29
|
File details
Details for the file leafmesh-2.1.29-cp313-none-any.whl.
File metadata
- Download URL: leafmesh-2.1.29-cp313-none-any.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.13
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e82fbef3dc097afe14e5db4e5cbc6fe6601ee5f796faf2772987435a92a8f5d
|
|
| MD5 |
c1a8ce3071e1261bb95abba0c5c57467
|
|
| BLAKE2b-256 |
9d35d8aaff97c4f203a30cfcc01c1905671ccb9d9729232cd26a5f3771e511df
|
File details
Details for the file leafmesh-2.1.29-cp312-none-any.whl.
File metadata
- Download URL: leafmesh-2.1.29-cp312-none-any.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.12
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b84cc658faf3d01ce1de3e859c1b08966fe3b839b97af28c577418e356f3380
|
|
| MD5 |
c1f63ea62654c65d3732437a54a00455
|
|
| BLAKE2b-256 |
f1bb536a4da1c3ab295d8bd00fa2d67455e9ae237829b1748071aaab8a7174f7
|
File details
Details for the file leafmesh-2.1.29-cp311-none-any.whl.
File metadata
- Download URL: leafmesh-2.1.29-cp311-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50b8dff6ffc1eedea0288798cab9f731e2dd68d07cc313a2eaba7401b513412a
|
|
| MD5 |
8714cf12678fc6cdb38f45a723b071c3
|
|
| BLAKE2b-256 |
dadf0efa6451377aedc62746764563582f90dcf5cb29276f6309a4d3b3617982
|
File details
Details for the file leafmesh-2.1.29-cp310-none-any.whl.
File metadata
- Download URL: leafmesh-2.1.29-cp310-none-any.whl
- Upload date:
- Size: 909.5 kB
- Tags: CPython 3.10
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
536a0498aaca9a834fa891abd082e07854f73fdf072844f315a3f33b88ca907d
|
|
| MD5 |
7080c4b51b4fe9c6d5fc6bacdd7df00c
|
|
| BLAKE2b-256 |
9ad0005851e02e8c3df51ba119730c1bbb137ded4a8a3d34977c359ea162bb1a
|