Skip to main content

LeafMesh — Multi-Agent AI Orchestration Platform

License: Commercial Python 3.8+ Version Redis

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-project to 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

  1. Install LeafMesh and set up Redis
  2. Create your first YAML configuration with basic agents
  3. Add Python enhancements for custom logic
  4. Enable revolutionary features for production

LeafMesh: Production-ready multi-agent AI with YAML-driven simplicity


Copyright 2025 LeafCraft. All rights reserved.

Metadata

Release files for leafmesh 2.4.265

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for leafmesh 2.4.265
File
leafmesh-2.4.265-cp314-none-any.whl CPython 3.14 none any Details
leafmesh-2.4.265-cp313-none-any.whl CPython 3.13 none any Details
leafmesh-2.4.265-cp312-none-any.whl CPython 3.12 none any Details
leafmesh-2.4.265-cp311-none-any.whl CPython 3.11 none any Details
leafmesh-2.4.265-cp310-none-any.whl CPython 3.10 none any Details

Total release size: 16.0 MB

Release files / leafmesh-2.4.265-cp314-none-any.whl

Download URL leafmesh-2.4.265-cp314-none-any.whl
Size 3.6 MB
Tags CPython 3.14
SHA-256 checksum
How to use checksums
33f1dd2a6765869308719018a68540b1a7860cd6aaaf0a2c1c81b48b0d4e3d84
BLAKE2b-256 checksum
How to use checksums
a189f0c788fd2e738d97ee188c22eb32da59d8368a01531d79f99bf713bba79b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / leafmesh-2.4.265-cp313-none-any.whl

Download URL leafmesh-2.4.265-cp313-none-any.whl
Size 3.4 MB
Tags CPython 3.13
SHA-256 checksum
How to use checksums
4721e51a48447466c9c2281eac8e2dfc920b9225c1298f4114f810b68b8852c4
BLAKE2b-256 checksum
How to use checksums
b7bb55643eecf71d7d7ed915601b2a3e5e086a50ce29ffd6263db6eae8c1aef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / leafmesh-2.4.265-cp312-none-any.whl

Download URL leafmesh-2.4.265-cp312-none-any.whl
Size 3.4 MB
Tags CPython 3.12
SHA-256 checksum
How to use checksums
b595a47aa3b4861c5a70893ef0bc7306892a1d0c26e27bf5364fe36667dbf074
BLAKE2b-256 checksum
How to use checksums
08a14cb2dce9bfc38f900d5283294cfc81b796e9c4e25c1913ee395a9aac4b74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / leafmesh-2.4.265-cp311-none-any.whl

Download URL leafmesh-2.4.265-cp311-none-any.whl
Size 3.5 MB
Tags CPython 3.11
SHA-256 checksum
How to use checksums
a87afb6997849d682e5f7280f820dfef3d03bf38a11d9eaf1d666b3a510a6a74
BLAKE2b-256 checksum
How to use checksums
19a7331801a858025a04a3fbd63f84712416ba444995080c685d349fd8c378f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / leafmesh-2.4.265-cp310-none-any.whl

Download URL leafmesh-2.4.265-cp310-none-any.whl
Size 2.0 MB
Tags CPython 3.10
SHA-256 checksum
How to use checksums
2f5cc02f0fba9ce2d1080bcedd1f2d408896db37cccb6b9658525c6404c7194b
BLAKE2b-256 checksum
How to use checksums
111e7ad47ee74b6b3ff9bfed022bd6b3356b4d9b8bbc272c20d3b3fc3051f07c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

2.4.265 This release

5 release files

2.4.99

5 release files

2.4.98

5 release files

2.4.95

5 release files

2.4.48

5 release files

2.4.39

5 release files

2.4.33

5 release files

2.4.32

5 release files

2.4.31

5 release files

2.4.30

5 release files

2.4.28

5 release files

2.4.25

5 release files

2.4.24

5 release files

2.4.19

5 release files

2.4.18

5 release files

2.4.17

5 release files

2.4.3

5 release files

2.4.0

5 release files

2.2.46

5 release files

2.1.51

5 release files

2.1.50

5 release files

2.1.42

5 release files

2.1.39

5 release files

2.1.38

5 release files

2.1.29

5 release files

2.1.28

5 release files

2.1.18

5 release files

2.1.9

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page