Skip to main content

The networking protocol for AI agents. Discover, communicate, and collaborate.

Project description

๐Ÿ„ Mycelium Agents

The Semantic Networking Protocol for AI Swarms

CI State PyPI Version Python Version License

Scale Tests Registry

โ–ถ See Live Demo โ€ข Technical Report

Mycelium Semantic Routing Demo

Stop hardcoding tool selection. Scale your AI product from 5 to 5,000 tools without rewriting your orchestration logic.

๐Ÿ“– The "Tool Routing" Bottleneck

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.

๐Ÿ“Š Performance Moat (v0.3.0 Benchmark)

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.

๐Ÿ“ข Latest Updates

  • 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...)

The Problem

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.


The Solution

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

๐Ÿ› ๏ธ Quick Start

Mycelium is language-agnostic and supports both Python and JavaScript ecosystems natively.

For Python Developers (Backend & AI Frameworks)

pip install mycelium-agents

For JavaScript/Web Developers (Node.js & Browsers)

npm install mycelium-js

1. Start the Registry (Server)

import uvicorn
from mycelium.server.app import app

uvicorn.run(app, host="0.0.0.0", port=8000)

2. Discover Semantically

No more hardcoded routing. Just describe what you need.

Python Example:

import httpx
# Query: "I need to change some dollars into euros"
response = httpx.get("http://localhost:8000/api/v1/agents/discover?q=change+dollars+into+euros&semantic=true")

JavaScript Example (mycelium-js):

import { MyceliumClient } from 'mycelium-js';

const client = new MyceliumClient();
// Finds the ForexAgent with 0 keyword overlap in <15ms
const bestTool = await client.discoverTool("I need to change some dollars into euros");

๐Ÿง  v0.2.0 โ€” Semantic Search

Agents 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.


๐Ÿ“Š Enterprise-Grade Benchmarks (v0.2.0)

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

๐ŸŽฌ Watch the Demo

https://github.com/user-attachments/assets/2a228337-80f5-479d-8b03-02597ccdc5ef


๐ŸŽจ Spatial Dashboard

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

Run Locally

# 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 dev

Open: http://localhost:5173


๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  MYCELIUM NETWORK                  โ”‚
โ”‚                                                    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Agent A  โ”‚โ”€โ”€โ”€โ–ถโ”‚   REGISTRY   โ”‚โ—€โ”€โ”€โ”€โ”‚ Agent B โ”‚  โ”‚
โ”‚  โ”‚ (Travel) โ”‚    โ”‚              โ”‚    โ”‚ (Payment)โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚ โ€ข Discovery  โ”‚    โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚       โ”‚          โ”‚ โ€ข Semantic   โ”‚         โ”‚        โ”‚
โ”‚       โ”‚          โ”‚ โ€ข Trust      โ”‚         โ”‚        โ”‚
โ”‚       โ”‚          โ”‚ โ€ข Relay      โ”‚         โ”‚        โ”‚
โ”‚       โ”‚          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”‚        โ”‚
โ”‚       โ”‚                                   โ”‚        โ”‚
โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”€ DIRECT COMMUNICATION โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ”‚
โ”‚                                                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ›ก๏ธ Security & Reliability (OWASP ASI06 Compliance)

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.

๐Ÿ”’ Mitigating AI Agent Over-Permissioning

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.

๐Ÿ› ๏ธ Hardened Infrastructure

  • 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).

๐ŸŒ Real-World Agents (Included)

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

Multi-Agent Chain Demo

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)

๐Ÿงช System Diagnostics

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

๐Ÿ“š Documentation

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

๐ŸŽฏ Examples

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

๐Ÿ—บ๏ธ Roadmap

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

๐Ÿค Contributing

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.app

See CONTRIBUTING.md for guidelines.

Good first issues:

  • Add a new example agent
  • Improve documentation
  • Write more tests
  • Add language translations

๐Ÿ“œ License

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

Project details


Download files

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

Source Distribution

mycelium_agents-0.3.1.tar.gz (31.8 kB view details)

Uploaded Source

Built Distribution

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

mycelium_agents-0.3.1-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file mycelium_agents-0.3.1.tar.gz.

File metadata

  • Download URL: mycelium_agents-0.3.1.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for mycelium_agents-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d75dd7fff35a6a8f402e5b963034b3979765cf2f332149985c1089a3d6b1aa9d
MD5 df719e3d4bfe8114f9bd9a83659a5261
BLAKE2b-256 26659c4555578b11e8a6dc458c343c0de91e52db9349b1fd850121fb3fa1afcd

See more details on using hashes here.

File details

Details for the file mycelium_agents-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mycelium_agents-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd335ffd4475a941beb35279093e7675888771225de0b71b82f3811817b7c61f
MD5 b6a4273c6b7f3ed5e6a369d71aa1c966
BLAKE2b-256 b5d7ba7e07ca54540eaa0e422172ae24f0a982698e1d69e6e459914df5009f8f

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