Stop hardcoding tool selection. Scale your AI product from 5 to 5,000 tools without rewriting your orchestration logic.
As AI products grow, they transition from single-prompt wrappers to complex multi-tool systems. Developers today rely on hardcoded if/else logic, expensive LLM-based routing, or keyword matching that breaks when a user's intent doesn't exactly match a function name.
Mycelium provides a drop-in semantic discovery layer. It allows your AI system to dynamically find and route requests to the right internal tool or agent based on meaning, not just exact keywords.
We refuse to trade accuracy for speed. In our latest fair-benchmark against traditional Information Retrieval (IR) methods on a corpus of 100,000 agents:
- 70.7% Family-Level Top-1 Accuracy (A +30 percentage point advantage over the strongest lexical baseline, BM25).
- <11ms Cold Discovery Latency (Running 20x faster than BM25 on commodity hardware).
- Zero-Cost Local Infrastructure (Embedding runs locally via
all-MiniLM-L6-v2; no OpenAI API bills for routing).
See the full reproduction steps and methodology in our Benchmarks Ledger.
- May 2024: โ v0.2.0 Live! Added Semantic Discovery & 100k agent benchmark.
- May 2024: ๐ CrewAI Integration Bridge released. See Example
- Next Up: ๐ ๏ธ Authentication Layer & JS SDK (Working on it...)
AI agents are everywhere. But they're all isolated.
Your Coding Agent โโโโ cannot talk to โโโโ Research Agent
Your Email Agent โโโโ cannot find โโโโ Translation Agent
Your Data Agent โโโโ cannot hire โโโโ Visualization Agent
There are thousands of AI agents being built. None of them can discover, communicate with, or collaborate with each other.
It's like having millions of phones with no telephone network.
Mycelium is the networking protocol that connects AI agents.
Your Agent โโ [MYCELIUM NETWORK] โโ Any Agent, Anywhere
Any agent can:
- ๐ Discover other agents by natural language
- ๐จ Communicate using a standard protocol
- ๐ค Collaborate in multi-agent chains
- โญ Build trust through successful interactions
pip install mycelium-agentsfrom mycelium import Agent
agent = Agent(name="MyAgent", description="Does amazing things")
@agent.on("greet")
def handle_greet(name: str):
return {"message": f"Hello, {name}! ๐"}
agent.serve()from mycelium import Network
network = Network()
agents = network.discover("I need a translator")
result = network.request(agents[0].agent_id, "translate",
{"text": "Hello", "to": "hindi"})
# โ {"translated": "เคจเคฎเคธเฅเคคเฅ"}That's it. Your agent is now part of the global network. ๐
Mycelium automatically handles secure tunneling. No AWS, no Docker, no Port Forwarding.
from mycelium import portal
@portal.share(name="MyGlobalAgent", description="I'm public!")
def handle_task(query: str):
return f"Processed: {query}"
if __name__ == "__main__":
handle_task.serve() # Instantly live on the global registry via secure tunnelAgents are now found by MEANING, not just keywords.
# Before (v0.1 โ keyword only)
network.discover("weather")
# Only finds agents with "weather" in name
# Now (v0.2 โ semantic)
network.discover("I need temperature data for my city")
# Automatically finds WeatherAgent โ
network.discover("Speak Hindi please")
# Automatically finds TranslatorAgent โ
network.discover("What is the value of digital currency?")
# Automatically finds CryptoAgent โ
Powered by ChromaDB + sentence-transformers. Runs locally. No API key needed.
Mycelium is stress-tested for production-scale AI swarms.
1. Discovery Accuracy at Scale (100,000 Agents) Semantic search completely outperforms traditional methods at massive scale.
| Method | Top-1 Accuracy | Avg Latency |
|---|---|---|
| Naive Keyword | 75.6% | 136 ms |
| BM25 Lexical | 83.4% | 71 ms |
| Semantic (Mycelium) | 87.4% | 14 ms |
2. Network Load & Cache (100 Concurrent Users) The built-in Query Cache Layer provides a 20x speedup under heavy load.
- 10 Users: 970 Requests/sec | 0% error
- 50 Users: 879 Requests/sec | 0% error
- 100 Users: 753 Requests/sec | 0.1% error (p95 = 122ms)
3. Multi-Agent Workflow Chaining Reliability Routing sequential payloads (Agent A โ Agent B โ Agent C) is flawlessly reliable.
| Chain Depth | Success Rate | Per-Hop Latency |
|---|---|---|
| 2 Agents | 100.0% | 124.27 ms |
| 3 Agents | 100.0% | 90.04 ms |
| 5 Agents | 100.0% | 83.41 ms |
| (Note: Per-hop latency decreases as chain depth grows due to dynamic path caching) |
โ Read the full arXiv Technical Report Draft
โ Reproduce benchmarks
videoplayback.mp4
A visual control center for your Mycelium network. Built with vanilla JS and glassmorphism design.
๐ Live Demo โ mycelium-agents.netlify.app
Watch AI agents orbit the registry core in real-time. Click any agent to inspect capabilities and send requests.
Features:
- ๐ Floating agent pills orbiting the registry core
- โ๏ธ Canvas filament lines showing live connections
- ๐ Real-time network stats (Agents, Latency, Messages)
- ๐ Natural language agent search (Ctrl+K)
- ๐ก Send requests directly from the dashboard
- ๐ฑ๏ธ Right-click context menu on any agent
- ๐ฏ macOS-style dock controls
- ๐ Real-time network logs panel
- โ๏ธ Multi-agent chain builder
- ๐ Dark / Light theme toggle
# Step 1: Start the registry
python -m server.app
# Step 2: Start some agents
python examples/real_agents/real_weather_agent.py
python examples/real_agents/real_crypto_agent.py
# Step 3: Open the dashboard
cd antigrav_dashboard
npm install
npm run devOpen: http://localhost:5173
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MYCELIUM NETWORK โ
โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โ Agent A โโโโโถโ REGISTRY โโโโโโ Agent B โ โ
โ โ (Travel) โ โ โ โ (Payment)โ โ
โ โโโโโโฌโโโโโโ โ โข Discovery โ โโโโโโฌโโโโโโ โ
โ โ โ โข Semantic โ โ โ
โ โ โ โข Trust โ โ โ
โ โ โ โข Relay โ โ โ
โ โ โโโโโโโโโโโโโโโโ โ โ
โ โ โ โ
โ โโโโโโโ DIRECT COMMUNICATION โโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
As AI agents move towards autonomy, security risks like OWASP ASI06 (AI Agent Over-Permissioning) become critical. Mycelium is engineered to mitigate these risks at the protocol level.
Mycelium enforces a Least Privilege Routing (LPR) model:
- Granular Capability Mapping: Agents only register specific atomic capabilities (e.g.,
get_weather), preventing broad system access. - Discovery Sandboxing: The registry only reveals agents that exactly match the semantic intent, preventing unauthorized "agent-to-agent" scanning.
- Encapsulated Payloads: All communication is strictly validated via Pydantic schemas, ensuring no malicious execution code is injected into the routing layer.
- Dependency Guard: Continuous scanning via CodeQL to prevent supply chain vulnerabilities.
- Payload Integrity: (Alpha) Support for signed message envelopes to ensure data hasn't been tampered with during relay.
- Rate Limiting: Built-in protection against "Agent Storms" where recursive agent calls could lead to Denial of Service (DoS).
5 production-ready agents using live APIs:
| Agent | Capability | API Used |
|---|---|---|
| ๐ค๏ธ RealWeather | Live weather for any city | OpenWeatherMap |
| ๐ฐ CryptoTracker | Live Bitcoin & crypto prices | CoinGecko (free) |
| ๐ RealTranslator | Translate to 50+ languages | MyMemory (free) |
| ๐ WikiBrain | Wikipedia knowledge & search | Wikipedia (free) |
| ๐ฑ CurrencyMaster | Live exchange rates (150+) | ExchangeRate API |
python scripts/real_world_demo.pyโ๏ธ CHAIN: Crypto Price Translation
โ CryptoTracker: Bitcoin = $67,432
โ CurrencyMaster: $67,432 = โน56,30,613
โ RealTranslator: 67432.5 เค
เคฎเฅเคฐเคฟเคเฅ เคกเฅเคฒเคฐ = 5630613.75 เคญเคพเคฐเคคเฅเคฏ เคฐเฅเคชเคฏเคพ
โ
3 agents. 3 live APIs. 1 automated chain. (1122ms)
python scripts/system_check.pyโ
Registry Server Health PASS
โ
Agent Registration PASS
โ
Natural Language Discovery PASS
โ
Agent-to-Agent Comms PASS
โ
Multi-Agent Chains PASS
โ
Error Handling PASS
โ
SDK Imports PASS
๐ Pass Rate: 32/32 (100%)
๐ข ALL SYSTEMS OPERATIONAL
| Document | Description |
|---|---|
| Getting Started | First steps with Mycelium |
| Protocol Spec | Full protocol specification |
| Architecture | System design & decisions |
| Technical Report (arXiv) | Official whitepaper draft with full benchmark data |
| Knowledge Base | Complete postmortem |
| API Reference | REST API docs |
| FAQ | Frequently asked questions |
| Example | Description |
|---|---|
| 01 โ First Agent | Create your first agent |
| 02 โ Discover Agents | Find and use agents |
| Weather Agent | Live weather data |
| Translator Agent | 50+ languages |
| Crypto Agent | Live crypto prices |
| Wikipedia Agent | Knowledge base |
| Currency Agent | Exchange rates |
v0.1.1 โ Done
- Core protocol
- Python SDK (
pip install mycelium-agents) - Registry server (FastAPI)
- Agent discovery (keyword-based)
- Agent-to-agent communication
- 5 real-world agents with live APIs
- Multi-agent chain demo
- Spatial dashboard (live on Netlify)
- 32/32 diagnostic tests passing
v0.2.0 โ Done
- Semantic search (ChromaDB + sentence-transformers)
- Agents found by MEANING not keywords
- 8/8 semantic tests passing
- Enterprise Benchmarks (100k agents scale testing)
- Workflow Chain Benchmarks (100% routing reliability)
- arXiv Technical Report draft completed
v0.3.0 ๐ Next
- Authentication (HMAC + API keys)
- CLI tool (
mycelium discover "translator") - JavaScript/TypeScript SDK
- WebSocket support
- Agent Marketplace (web UI)
- LangChain + CrewAI plugins
- Docker deployment
v1.0.0 ๐ 2027
- Stable protocol specification
- Multi-language SDKs
- Hosted registry (SaaS)
- Enterprise features
- Protocol governance council
We love contributions! Mycelium is community-driven.
git clone https://github.com/udaysaai/mycelium.git
cd mycelium
pip install -e ".[dev,server]"
pytest
python -m server.appSee CONTRIBUTING.md for guidelines.
Good first issues:
- Add a new example agent
- Improve documentation
- Write more tests
- Add language translations
MIT โ use it, build on it, make it yours.
Built with โค๏ธ from India ๐ฎ๐ณ
If AI agents are the future, they need a way to find each other.
โญ Star this repo if you believe in open agent infrastructure.
๐จ Live Dashboard โข ๐ฆ PyPI โข ๐ Docs
