Cross-framework orchestration for AI agents.
ProtoMesh is a middleware for orchestrating multi-agent systems, enabling seamless integration between frameworks like LangGraph and CrewAI with shared state, optimistic locking, and policy-based governance.
- Shared State Fabric: In-memory store with optimistic concurrency control (versioning).
- Governance Engine: Pre-execution hooks for policies (e.g., AllowLists).
- Adapters: Native integration for LangGraph (Nodes) and CrewAI (Tools).
- Observability: JSON-based event tracing.
Requires Python 3.12+.
# Using uv (recommended)
uv venv
source .venv/bin/activate
uv pip install -e .from protomesh.core.mesh import ProtoMesh
from protomesh.core.governance import AllowListPolicy
# Initialize Mesh
mesh = ProtoMesh()
# Add Governance Policy
policy = AllowListPolicy(name="SecureWrite", allowed_actions=["write"])
mesh.governance.register_policy(policy)
# Write State (with tracing and policy check)
mesh.write("key1", {"status": "active"}, agent_id="agent-007")
# Read State
entity = mesh.read("key1")
print(entity.data)A full example integrating CrewAI and LangGraph is available in protomesh/examples/demo_workflow.py.
Requires GOOGLE_API_KEY for Gemini/ or you can modify it for other LLMs in protomesh/examples/demo_workflow.py as it uses LiteLLM.
export GOOGLE_API_KEY=your_key_here
python protomesh/examples/demo_workflow.pyExecution Flow (demo_workflow.py)
sequenceDiagram
participant User
participant CrewAI
participant ProtoMesh
participant LangGraph
User->>CrewAI: Kickoff researcher task
CrewAI->>ProtoMesh: write("research_topic", {...})
ProtoMesh->>ProtoMesh: Check AllowListPolicy
ProtoMesh->>ProtoMesh: Increment version (v1)
ProtoMesh->>ProtoMesh: Emit trace: state_update
CrewAI-->>User: Task complete
User->>LangGraph: Invoke workflow
LangGraph->>ProtoMesh: read("research_topic")
ProtoMesh-->>LangGraph: Return entity (v1)
LangGraph->>LangGraph: Summarize topic
LangGraph-->>User: Final result
Run unit tests:
pytest tests/