AI agents are powerful individually, but they can't think together. When multiple agents work on the same problem, there's no shared memory, no way to negotiate trade-offs, and no context that persists across sessions. Every conversation starts from zero.
Mycelium gives agents rooms to coordinate in, persistent memory that compounds across sessions, and a CognitiveEngine that mediates negotiation so agents never have to talk directly to each other.
# Agent 1 shares context in a persistent room
mycelium memory set "position/julia" "I think we should use REST, not GraphQL" --handle julia-agent
# Agent 2 (hours later, different session) reads and adds their perspective
mycelium memory search "API design decisions"
mycelium memory set "position/selina" "Agree on REST, but we need pagination standards" --handle selina-agent
# CognitiveEngine synthesizes when enough context accumulates
mycelium room synthesizeWhen agents need to agree on something in real time, they spawn a session within a room and CognitiveEngine runs structured negotiation:
mycelium session join --handle julia-agent -m "budget=high, scope=full"
# CognitiveEngine drives propose/respond rounds until consensusThree pillars from the Internet of Cognition architecture:
1. Coordination Protocol (Shared Intent) — Sessions (spawned within rooms) with a state machine (idle → waiting → negotiating → complete). CognitiveEngine orchestrates multi-issue negotiation via NegMAS. Agents respond to structured proposals; they never address each other directly.
2. Persistent Memory (Shared Context) — Namespaced key-value store with semantic vector search. Memories persist across sessions, accumulate across agents, and are searchable by meaning, not just keywords. Backed by AgensGraph + pgvector.
3. Knowledge Graph (Collective Innovation) — Two-stage LLM extraction turns agent conversations into structured concepts and relationships in an openCypher graph. CognitiveEngine queries this to inform future negotiations.
# Install
pip install mycelium-cli
mycelium install
# Create a room and start sharing context
mycelium room create my-project
mycelium room use my-project
mycelium memory set "context/goal" "Build a REST API for the new service"
mycelium memory set "decision/db" "PostgreSQL with pgvector for embeddings"
# Search what's been shared
mycelium memory search "database decisions"
# See everything in the room
mycelium memory lsEverything runs on a single AgensGraph instance (PostgreSQL 16 fork):
- SQL tables for rooms, sessions, messages, memories
- openCypher for the knowledge graph
- pgvector for semantic memory search
- LISTEN/NOTIFY for real-time SSE streaming
No external message broker, no separate vector DB, no Redis. One database.
mycelium-cli/ CLI + adapters (OpenClaw, Claude Code)
fastapi-backend/ FastAPI coordination engine
mycelium-client/ Generated typed OpenAPI client
Mycelium integrates with AI coding agents via adapters:
Claude Code — Lifecycle hooks capture tool use and context automatically. The mycelium skill provides memory and coordination commands.
mycelium adapter add claude-codeOpenClaw — Plugin + hooks for the OpenClaw agent runtime. Same coordination protocol, same memory API.
mycelium adapter add openclawcd fastapi-backend
uv sync --group dev
uv run pytest tests/ # unit tests (SQLite)
DATABASE_URL=... uv run pytest tests/ # integration tests (AgensGraph)Interactive API docs at http://localhost:8000/docs when the backend is running.
- Internet of Cognition — Outshift by Cisco
- NegMAS — Multi-issue negotiation
- AgensGraph — Multi-model graph database
- FastAPI + pgvector + sentence-transformers
