Skip to main content

LeafMesh — YAML-native multi-agent orchestration platform

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

leafmesh-2.3.43-cp314-none-any.whl (2.3 MB view details)

Uploaded CPython 3.14

leafmesh-2.3.43-cp313-none-any.whl (2.2 MB view details)

Uploaded CPython 3.13

leafmesh-2.3.43-cp312-none-any.whl (2.2 MB view details)

Uploaded CPython 3.12

leafmesh-2.3.43-cp311-none-any.whl (2.3 MB view details)

Uploaded CPython 3.11

leafmesh-2.3.43-cp310-none-any.whl (1.3 MB view details)

Uploaded CPython 3.10

File details

Details for the file leafmesh-2.3.43-cp314-none-any.whl.

File metadata

  • Download URL: leafmesh-2.3.43-cp314-none-any.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.14
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for leafmesh-2.3.43-cp314-none-any.whl
Algorithm Hash digest
SHA256 24e55224d7e7d9e74803a2eac4563107d7ff9a11b9d5968799bb76347a72309f
MD5 6f5f6bf81a6abadea0bb980642a3ba5e
BLAKE2b-256 a8ceb7b770d3a7c82be0cc7a1b35e7062da3ce63aadba1f7e0f1b2e6d1470e3e

See more details on using hashes here.

File details

Details for the file leafmesh-2.3.43-cp313-none-any.whl.

File metadata

  • Download URL: leafmesh-2.3.43-cp313-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.13
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for leafmesh-2.3.43-cp313-none-any.whl
Algorithm Hash digest
SHA256 13408b13628bb8b06625854f9c3a2bcfd6f01b0890dd464576f58a5c948cd7c0
MD5 3d479618a3dfd4daecf4dfc8d63346e5
BLAKE2b-256 70eae5b7c4e8c96b3fae5fc5314e971b402f622b7ace78a3c4d6905979f34bf6

See more details on using hashes here.

File details

Details for the file leafmesh-2.3.43-cp312-none-any.whl.

File metadata

  • Download URL: leafmesh-2.3.43-cp312-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.12
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for leafmesh-2.3.43-cp312-none-any.whl
Algorithm Hash digest
SHA256 03a3ba9ded84375a8bc92fb1c43355dba6d1b329c182a077b3636334303aec12
MD5 4aa832348b0ee80a7bcf4087ec8cfc1b
BLAKE2b-256 2184c0d69ae380f1215b14e511a32d5ba1809c43e00c4f7fce56a8d1b7f99b3d

See more details on using hashes here.

File details

Details for the file leafmesh-2.3.43-cp311-none-any.whl.

File metadata

  • Download URL: leafmesh-2.3.43-cp311-none-any.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for leafmesh-2.3.43-cp311-none-any.whl
Algorithm Hash digest
SHA256 7fe3ec96417cf987518afa0431bc520f65205a42c310b68e16f6dc7fa02ad4f9
MD5 1639504b65456f54afbdee55d2dca2f3
BLAKE2b-256 a1e6707be6751e10577901ad14be799848b00e213a13a13089dec21b80e0ee07

See more details on using hashes here.

File details

Details for the file leafmesh-2.3.43-cp310-none-any.whl.

File metadata

  • Download URL: leafmesh-2.3.43-cp310-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for leafmesh-2.3.43-cp310-none-any.whl
Algorithm Hash digest
SHA256 9dadb5005b69b5d4ae776099c56a35b3379e242cca7009ccff4a2ab0860a2365
MD5 2e2768557f2c5d3749860ae32efdfb39
BLAKE2b-256 19f474e8eea12f35cf70f61535ef1e4fc4740378a381ff67f023d2c6f136d25f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page