CapabilityMesh is the first comprehensive solution designed specifically for universal capability discovery and trust management across multiple Python agent frameworks - CrewAI, AutoGen, LangGraph, A2A, and custom implementations.
CapabilityMesh is the FIRST and ONLY package that solves multi-framework agent discovery and collaboration.
Today's multi-agent ecosystem is fragmented. Each framework operates in isolation:
โ CrewAI agents can't discover AutoGen agents
โ LangGraph workflows can't find A2A services
โ No standard way to query "which agents can translate?"
โ Manual integration required for every framework pair
โ No trust or reputation across frameworks
โ Reinventing discovery for each new agent
โ
Universal discovery across ALL frameworks (CrewAI, AutoGen, LangGraph, A2A, custom)
โ
Semantic capability matching with natural language queries
โ
Built-in trust and reputation management
โ
Multiple storage backends (in-memory, SQLite, Redis)
โ
A2A protocol compatible
โ
Zero-config default, production-ready optional features
โ
5 lines of code to working multi-agent discovery
from capabilitymesh import Mesh
mesh = Mesh() # Zero-config, works immediately!
@mesh.agent(name="translator", capabilities=["translation", "nlp"])
def translate(text: str, target_lang: str = "es") -> str:
return f"[Translated to {target_lang}]: {text}"
# Discover agents by capability (agent registered immediately!)
agents = await mesh.discover("translation")
result = await mesh.execute(agents[0].id, "Hello world!", target_lang="es")That's it! No configuration, no setup, no complexity. Just register and discover.
๐ก Deployment Note: This example runs in a single process. For distributed systems (microservices, multi-process), see Discovery Architecture for deployment patterns.
# Core package (includes semantic search, trust, in-memory storage)
pip install capabilitymesh
# With SQLite persistence
pip install capabilitymesh[sqlite]
# With Redis (distributed systems)
pip install capabilitymesh[redis]
# With framework integrations
pip install capabilitymesh[crewai] # CrewAI support
pip install capabilitymesh[autogen] # AutoGen support
pip install capabilitymesh[langgraph] # LangGraph support
# Everything
pip install capabilitymesh[all]Discover agents across ANY framework with natural language or exact matching:
from capabilitymesh import Mesh
mesh = Mesh()
# Register agents from different frameworks
@mesh.agent(name="summarizer", capabilities=["summarization", "nlp"])
async def summarize(text: str) -> str:
return "Summary: " + text[:100]
@mesh.agent(name="translator", capabilities=["translation", "language"])
def translate(text: str) -> str:
return "Translated: " + text
# Exact capability matching (works immediately)
agents = await mesh.discover("translation")
# Returns: [translator]
agents = await mesh.discover("summarization")
# Returns: [summarizer]
# Natural language discovery (enhanced with sentence-transformers/OpenAI)
# See examples/04_semantic_search.py for advanced semantic matching
agents = await mesh.discover("convert to another language")
# Can match 'translator' with enhanced embeddingsNo Other Package Does This! CapabilityMesh is the ONLY solution for cross-framework capability discovery.
Register agents from ANY framework and discover them universally:
from capabilitymesh import Mesh
from crewai import Agent as CrewAgent
from autogen import AssistantAgent
mesh = Mesh()
# CrewAI agent
crew_researcher = CrewAgent(
role="researcher",
goal="Research topics thoroughly",
backstory="Expert researcher"
)
await mesh.register(crew_researcher, name="crew-researcher")
# AutoGen agent
autogen_coder = AssistantAgent(
name="coder",
system_message="You write clean Python code"
)
await mesh.register(autogen_coder, name="autogen-coder")
# Python function
@mesh.agent(name="my-analyzer", capabilities=["analysis"])
def analyze(data):
return {"result": "analyzed"}
# NOW: Discover across ALL frameworks!
all_agents = await mesh.list_agents()
# Returns: [crew-researcher, autogen-coder, my-analyzer]
# Find by capability - framework doesn't matter!
researchers = await mesh.discover("research information")
coders = await mesh.discover("write code")
analyzers = await mesh.discover("analysis")Unique Value: Mix and match agents from different frameworks in the same workflow!
Automatically track agent reliability and filter by trust level:
from capabilitymesh import Mesh, TrustLevel
mesh = Mesh()
# Register agents
@mesh.agent(name="reliable-service", capabilities=["task-a"])
def reliable_agent(task):
return "success" # Always works
@mesh.agent(name="unstable-service", capabilities=["task-a"])
def unstable_agent(task):
if random.random() < 0.5:
raise ValueError("Failed!")
return "success"
# Execute multiple times - trust scores update automatically!
for i in range(20):
try:
await mesh.execute(reliable_id, f"task-{i}")
await mesh.execute(unstable_id, f"task-{i}")
except:
pass
# Check trust scores
reliable_score = await mesh.trust.get_score(reliable_id)
print(f"Reliable agent: {reliable_score.level.name}") # HIGH or VERIFIED
print(f"Success rate: {reliable_score.success_rate:.1%}") # ~100%
unstable_score = await mesh.trust.get_score(unstable_id)
print(f"Unstable agent: {unstable_score.level.name}") # LOW or MEDIUM
print(f"Success rate: {unstable_score.success_rate:.1%}") # ~50%
# Discover only trusted agents!
trusted = await mesh.discover("task-a", min_trust=TrustLevel.MEDIUM)
# Returns only agents with MEDIUM+ trustTrust Levels: UNTRUSTED โ LOW โ MEDIUM โ HIGH โ VERIFIED (auto-calculated based on success rate)
Choose the storage that fits your needs:
from capabilitymesh import Mesh
from capabilitymesh.storage import InMemoryStorage, SQLiteStorage, RedisStorage
# Option 1: In-Memory (default, zero-config)
mesh = Mesh() # Fast, simple, no persistence
# Option 2: SQLite (persistent, full-text search)
mesh = Mesh(storage=SQLiteStorage("agents.db"))
# Agents persist across restarts
# Built-in FTS5 full-text search
# Option 3: Redis (distributed, scalable)
mesh = Mesh(storage=RedisStorage(host="localhost", port=6379))
# Multiple instances share the same agent registry
# Perfect for microservices
# โ ๏ธ IMPORTANT: Redis storage requires manual registration
# Use await mesh.register() instead of @mesh.agent decorator
# See Redis Usage Notes below for details| Storage | Persistence | Search | Distribution | Best For |
|---|---|---|---|---|
| InMemory | No | Basic | Single | Dev, Testing |
| SQLite | Yes (file) | Full-text (FTS5) | Single | Production |
| Redis | Yes (remote) | Basic | Multi-instance | Cloud, Scale |
๐ Note on Distributed Systems: Redis enables discovery across multiple processes/machines, but execution is process-local for Python functions. For true distributed execution, use A2A adapters (HTTP-based agents). See Discovery Architecture for details.
Decorators do not work with Redis storage due to async event loop timing. Use manual registration instead:
# โ DON'T: Decorators with Redis (causes event loop conflicts)
storage = RedisStorage(host="localhost", port=6379)
mesh = Mesh(storage=storage)
@mesh.agent(name="agent", capabilities=["math"]) # โ Fails!
def my_agent(x):
return x * 2
# โ
DO: Manual registration with Redis (works perfectly)
async def setup():
storage = RedisStorage(host="localhost", port=6379)
mesh = Mesh(storage=storage)
def my_agent(x: int) -> int:
return x * 2
# Use await mesh.register() instead
await mesh.register(my_agent, name="agent", capabilities=["math"])
return mesh
# โ
ALTERNATIVE: Decorators with InMemory (works great for dev/test)
mesh = Mesh() # Default InMemory storage
@mesh.agent(name="agent", capabilities=["math"]) # โ
Works!
def my_agent(x):
return x * 2Why? Decorators run at module import time (before async event loop exists), but Redis operations require async context. This is a Python async limitation, not a bug.
Recommendation:
- Development: Use decorators with InMemory storage
- Production with Redis: Use
await mesh.register()
Find agents using natural language queries. The default keyword-based embedder provides basic matching, with enhanced semantic search available via sentence-transformers or OpenAI embeddings:
from capabilitymesh import Mesh
mesh = Mesh() # Semantic search enabled by default!
# Register agents with descriptive capabilities
@mesh.agent(
name="sentiment-analyzer",
capabilities=["sentiment-analysis", "emotion-detection", "nlp"],
)
async def analyze_sentiment(text: str):
return {"sentiment": "positive", "confidence": 0.95}
@mesh.agent(
name="entity-extractor",
capabilities=["entity-extraction", "ner", "nlp"],
)
def extract_entities(text: str):
return ["person", "organization", "location"]
# Natural language queries
agents = await mesh.discover("understand the mood of customer reviews")
# Returns: [sentiment-analyzer] - semantic match!
agents = await mesh.discover("find people and places mentioned in text")
# Returns: [entity-extractor] - semantic match!
agents = await mesh.discover("nlp")
# Returns: [sentiment-analyzer, entity-extractor] - both matchHow it works: Uses TF-IDF keyword embeddings by default (no external dependencies). Upgrade to sentence-transformers or OpenAI embeddings for even better results!
Define rich capabilities with versioning, constraints, and metadata:
from capabilitymesh import (
Capability,
CapabilityVersion,
CapabilityConstraints,
SemanticMetadata,
CapabilityType,
IOFormat,
)
# Define a structured capability with full specifications
capability = Capability(
name="translate-en-es",
description="Translate English text to Spanish",
capability_type=CapabilityType.STRUCTURED,
version=CapabilityVersion.from_string("2.1.0"),
# Performance constraints
constraints=CapabilityConstraints(
max_response_time_ms=100,
max_cost_per_call=0.001,
min_availability=0.999,
rate_limit_per_minute=1000,
),
# Semantic metadata for better discovery
semantic=SemanticMetadata(
tags=["translation", "nlp", "spanish"],
categories=["Natural Language Processing"],
domains=["linguistics", "localization"],
),
)
# Register agent with rich capability
@mesh.agent(name="professional-translator", capabilities=[capability])
async def translate(text: str, target_lang: str = "es"):
return f"Translated: {text}"Capabilities include:
- Semantic versioning with compatibility checking
- Performance constraints (latency, cost, SLA)
- Input/output schemas (JSON Schema support)
- Semantic metadata for better discovery
- Deprecation notices
import asyncio
from capabilitymesh import Mesh, Capability, TrustLevel
async def main():
# Initialize mesh with persistent storage
mesh = Mesh(storage=SQLiteStorage("multi_agent.db"))
# Register a document processing pipeline
@mesh.agent(name="pdf-extractor", capabilities=["text-extraction", "pdf"])
def extract_text(pdf_path: str) -> str:
return f"Extracted text from {pdf_path}"
@mesh.agent(name="summarizer", capabilities=["summarization", "nlp"])
async def summarize(text: str) -> str:
await asyncio.sleep(0.1) # Simulate async processing
return f"Summary: {text[:100]}..."
@mesh.agent(name="translator", capabilities=["translation", "nlp"])
def translate(text: str, target_lang: str = "es") -> str:
return f"[{target_lang}] {text}"
# Process a document through the pipeline
pdf_path = "document.pdf"
# Step 1: Extract text
extractors = await mesh.discover("extract text from pdf")
text = await mesh.execute(extractors[0].id, pdf_path)
print(f"Extracted: {text}")
# Step 2: Summarize
summarizers = await mesh.discover("summarize text")
summary = await mesh.execute(summarizers[0].id, text)
print(f"Summary: {summary}")
# Step 3: Translate
translators = await mesh.discover("translate to Spanish")
translated = await mesh.execute(translators[0].id, summary, target_lang="es")
print(f"Translated: {translated}")
# Check trust scores
for agent in [extractors[0], summarizers[0], translators[0]]:
score = await mesh.trust.get_score(agent.id)
print(f"{agent.name}: {score.level.name} ({score.success_rate:.0%} success)")
if __name__ == "__main__":
asyncio.run(main())from capabilitymesh import Mesh
from crewai import Agent, Crew, Task
mesh = Mesh()
# Register CrewAI agents
researcher = Agent(
role="Senior Research Analyst",
goal="Uncover cutting-edge developments",
backstory="Expert at finding and analyzing information"
)
writer = Agent(
role="Tech Content Writer",
goal="Create engaging technical content",
backstory="Skilled writer with tech background"
)
# Register with CapabilityMesh
await mesh.register(researcher, name="researcher")
await mesh.register(writer, name="writer")
# Now discover them universally!
research_agents = await mesh.discover("research and analyze information")
writing_agents = await mesh.discover("write content")from capabilitymesh import Mesh
from autogen import AssistantAgent, UserProxyAgent
mesh = Mesh()
# Register AutoGen agents
coder = AssistantAgent(
name="coder",
system_message="You are an expert Python developer"
)
reviewer = AssistantAgent(
name="code_reviewer",
system_message="You review code for quality and security"
)
# Register with CapabilityMesh
await mesh.register(coder, name="python-coder")
await mesh.register(reviewer, name="code-reviewer")
# Discover across frameworks
coders = await mesh.discover("write python code")
reviewers = await mesh.discover("review code quality")- A2A: Defines agent communication format
- CapabilityMesh: Adds discovery, trust, and multi-framework support
- Together: CapabilityMesh makes ANY agent A2A-compatible
- CrewAI Crews: Only works with CrewAI agents
- AutoGen Groups: Only works with AutoGen agents
- CapabilityMesh: Works with ALL frameworks + custom agents
- Manual: Write custom code for each framework pair (Nยฒ complexity)
- CapabilityMesh: Write once, works with all frameworks (N complexity)
- LC/LI: Tool/function calling within a single framework
- CapabilityMesh: Agent discovery and collaboration ACROSS frameworks
| Feature | CapabilityMesh | A2A | CrewAI | AutoGen | LangGraph |
|---|---|---|---|---|---|
| Multi-framework discovery | โ | โ | โ | โ | โ |
| Semantic search | โ | โ | โ | โ | โ |
| Built-in trust | โ | โ | โ | โ | โ |
| Multiple storage backends | โ | โ | โ | โ | โ |
| Zero-config default | โ | โ | โ | โ | โ |
| Production-ready | โ | โ | โ | โ | โ |
CapabilityMesh is the ONLY solution for universal multi-framework agent discovery.
๐ Architecture Notes: See Discovery Architecture for details on single-process vs. distributed deployment patterns.
- Mesh API - Simple, intuitive interface for agent management
- Multi-framework support - CrewAI, AutoGen, LangGraph, A2A, custom
- Semantic discovery - Natural language capability queries
- Trust management - 5-level automatic trust scoring
- Storage backends - InMemory, SQLite (FTS5), Redis
- Capability schema - Rich metadata, versioning, constraints
- A2A compatibility - Convert any agent to A2A protocol
- Fixed
@mesh.agent()decorator - Immediate registration, no wrapper overhead, works perfectly with InMemory - Comprehensive test suite - 420+ tests, ~95% coverage
- Complete docs - Examples, guides, API reference
โ
420+ tests passing (comprehensive coverage)
โ
~95% test coverage across all modules
โ
@mesh.agent() decorator with immediate registration (InMemory)
โ
Manual registration with Redis (production-ready)
โ
6 comprehensive examples
โ
SQLite with FTS5 full-text search
โ
Redis distributed storage (tested with local instance)
โ
Trust tracking with execution history
โ
Semantic search with keyword embeddings
โ
Framework integration (CrewAI, AutoGen, LangGraph, A2A)
โ
All exception handling and error scenarios
โ
Concurrency and edge cases
โ
LocalEmbedder and OpenAIEmbedder supportNew in Latest Release:
- โ All 18 exception classes fully tested
- โ LocalEmbedder (sentence-transformers) - 15+ tests
- โ OpenAIEmbedder (OpenAI API) - 25+ tests
- โ AutoGen integration - 45+ tests
- โ LangGraph integration - 40+ tests
- โ A2A client - 50+ tests
- โ Enhanced Mesh tests - 39+ additional edge cases
- โ Redis storage - Comprehensive local testing
- โ Error handling and concurrency scenarios
Test Files:
- Unit tests: 12 files (core, storage, embeddings, trust, mesh, exceptions)
- Integration tests: 4 files (CrewAI, AutoGen, LangGraph, A2A)
- Total: 420+ test cases covering all functionality
- v1.0.0-beta.1:
- Enhanced embeddings (sentence-transformers, OpenAI)
- Performance optimizations
- Additional framework integrations
- v1.0.0: Stable release with production hardening
- v1.1.0: P2P discovery (mDNS, Gossip, DHT)
- v1.2.0: Advanced negotiation protocols
- v2.0.0: Web dashboard and monitoring
- Examples Guide - 6 comprehensive examples
- Discovery Architecture - How discovery works across processes
- Roadmap - Future plans and vision
examples/01_basic_usage.py- Get started in 5 minutesexamples/02_storage_backends.py- InMemory, SQLite, Redisexamples/03_trust_management.py- Trust scoring and filteringexamples/04_semantic_search.py- Natural language discoveryexamples/05_advanced_capabilities.py- Rich capability schemasexamples/06_multi_agent_workflow.py- Complex workflows
Run any example:
python examples/01_basic_usage.pyBuild agent teams mixing frameworks in a single process:
# Single process - all frameworks work together
mesh = Mesh()
team = {
"researcher": CrewAI_Agent, # Best for research
"coder": AutoGen_Agent, # Best for coding
"orchestrator": LangGraph_Agent, # Best for workflows
"api": A2A_Service, # Best for services (also works distributed)
}
# All discoverable and coordinated via CapabilityMesh!๐ก For distributed deployments: Use A2A adapters for HTTP-based agents or see Discovery Architecture for patterns.
Build marketplaces where agents advertise capabilities:
# Agents register
marketplace.register(translator, capabilities=["translation"])
marketplace.register(analyzer, capabilities=["analysis"])
# Clients discover and hire
agent = marketplace.discover("translate and analyze")[0]
result = await mesh.execute(agent.id, task_data)Gradually migrate between frameworks:
# Phase 1: All CrewAI
# Phase 2: Mix CrewAI + AutoGen (CapabilityMesh handles discovery)
# Phase 3: All AutoGen
# No disruption - agents discoverable throughout!Choose optimal framework per agent:
- CrewAI โ Role-based collaboration
- AutoGen โ Conversational workflows
- LangGraph โ Complex state machines
- A2A โ Production microservices
- All coordinated seamlessly!
- Install:
pip install capabilitymesh - Import:
from capabilitymesh import Mesh - Initialize:
mesh = Mesh() - Register:
@mesh.agent(capabilities=["task"]) - Discover:
agents = await mesh.discover("task") - Execute:
result = await mesh.execute(agent.id, data)
Time to working discovery: < 5 minutes โก
Apache License 2.0 - see LICENSE file for details.
Key Benefits:
- โ Free for commercial and personal use
- โ Explicit patent grant protects users and contributors
- โ Clear attribution requirements
- โ Enterprise-friendly legal framework
Sai Kumar Yava (@scionoftech)
Building the future of multi-agent systems. ๐
CapabilityMesh builds upon research in:
- Multi-agent systems and coordination
- Decentralized discovery protocols
- Semantic web and knowledge graphs
- Trust and reputation systems
Special thanks to:
- A2A protocol contributors (Google/Linux Foundation)
- Framework maintainers (CrewAI, AutoGen, LangGraph)
- The Pydantic and FastAPI communities
- Multi-agent systems research community
- Documentation: Complete Guide
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Version: 1.0.0-alpha.2
- Tests: 420+ passing (~95% coverage)
- Test Files: 16 test files (12 unit, 4 integration)
- Coverage: ~95% across all modules
- Frameworks: 4 supported (CrewAI, AutoGen, LangGraph, A2A)
- Storage: 3 backends (InMemory, SQLite, Redis) - all tested
- Trust: 5-level automatic system
- Embeddings: 3 types (Keyword, Local, OpenAI)
- Status: โ Production-ready with comprehensive testing
If CapabilityMesh helps your project, star โญ the repo to show your support!
# Install and try it now!
pip install capabilitymesh
# Your feedback shapes the future of multi-agent systems!Making agents from any framework work together seamlessly
CapabilityMesh is the first comprehensive solution designed specifically for universal capability discovery and trust management across multiple Python agent frameworks (CrewAI, AutoGen, LangGraph, A2A, and custom implementations)
