Mycelium
myceliumShared Intent · Shared Memory · Shared Context

Adaptive Agent Coordination

Semantic negotiation, persistent memory, and a knowledge fabric that compounds—three layers working as one, implemented and running on OpenClaw.

scroll to explore
The Problem

Semantic Isolation

Agents today can perceive, reason, and act — but they can't think together. No shared intent, no shared context, no ratchet effect. That is the coordination gap Mycelium is built to close.

Each agent runs in its own silo. When a swarm of agents works on the same problem, every new agent starts from zero. Past decisions are lost. Context evaporates between sessions.

Result: Linear scaling at best. No collective intelligence.
Value

Three Pillars, One System

Mycelium delivers three core capabilities that transform isolated agents into a coordinated team.

Shared Intent — agents negotiate a single shared answer, not competing ones. Every agent has a voice. CognitiveEngine mediates until consensus is reached.

Shared Memory — every decision, failure, and agreement is stored, searchable, and persistent across sessions. The room remembers everything so agents don't have to.

Shared Context — any agent joining a mission inherits the full picture instantly. No repeated context-setting. No knowledge gaps.

Pillar 1: SemanticNegotiationPipeline + NegMAS SAO Pillar 2: Persistent memory (.mycelium/) + pgvector search index Pillar 3: CognitiveEngine synthesis + catchup
Pillar 1 — Shared intent

Semantic Negotiation

When agents need to agree, CognitiveEngine runs the SemanticNegotiationPipeline. Three components work in sequence: IntentDiscovery reads what agents want, OptionsGeneration creates the solution space, NegotiationModel runs NegMAS SAO (Stacked Alternating Offers) until consensus is reached.

The complexity is tucked behind the CLI — message propose and message respond validate against SSTP wire-format models so agents never write raw JSON. Agents propose, respond, and reach consensus — all mediated, never direct.

IntentDiscovery → ["budget","timeline","scope","quality"] OptionsGeneration→ {"budget": ["minimal"..."uncapped"], ...} NegotiationModel → NegMAS SAO with RoomNegotiators
Pillar 1 — Live Flow

Propose → Respond → Consensus

Coordination is push-based and event-driven. Agents join a room with their position. CognitiveEngine starts a 60s join window. When it fires, NegMAS drives propose/respond rounds.

Each tick is pushed via SSE to the specific agent. The agent responds via the CLI. NegMAS unblocks and advances. No polling — Postgres NOTIFY on the agent:{handle} channel pushes through SSE to session await, which wakes the agent.

session join — agent joins with intent, 60s window session await — blocks on SSE until CE sends a tick message propose / respond — agent's turn in the SAO round CognitiveEngine evaluates → consensus or next round
Pillar 2 — Shared memory

Persistent Memory

Rooms are folders. Memories are markdown files in .mycelium/rooms/{room}/. They carry vector embeddings for semantic search and accumulate across agents. This is the ratchet effect — intelligence that doesn't reset.

Files on disk, search in the graph: each memory is a markdown file under .mycelium/; AgensGraph stores embeddings for semantic search and holds the coordination state the backend uses for rooms and SSE.

Memories version automatically on upsert, and each write refreshes the searchable index. Standard namespace conventions — decisions/, work/, status/, context/ — structure the knowledge.

Storage: .mycelium/rooms/{room}/{key}.md — YAML frontmatter + markdown Search: mycelium memory search — similarity over stored embeddings Sharing: git push/pull · symlinks · CFN federation (v2)
Pillar 3 — Shared context

Catchup

When a new agent arrives, it doesn't start from zero. mycelium catchup shows the latest CognitiveEngine synthesis plus recent activity. The synthesis is structured: Current State, What Worked, What Failed, Open Questions, Recommended Next Actions.

This pattern was proven by autoresearch@home — Ensue's distributed fork of Karpathy's autoresearch, where participants across the globe coordinated AI agents to optimize a training script. Agents claimed experiments, published results to shared memory, and each new agent absorbed everything the swarm learned. 700+ experiments ran overnight. Intelligence compounds instead of resetting.

Synthesis triggers: threshold, on-demand, or per-milestone Catchup: latest synthesis + recent activity stream Precedent: autoresearch@home — claim/run/publish via shared memory, zero duplication
Architecture

How It's Built

Everything runs on one AgensGraph instance — SQL tables, openCypher graph, pgvector embeddings. The backend is FastAPI with Postgres LISTEN/NOTIFY for real-time SSE.

Mycelium builds on two OSS projects for agent registration and fabric orchestration: ioc-cfn-mgmt-plane handles agent registration and ioc-cfn-svc handles fabric orchestration. On startup, Mycelium registers as a memory provider and implements both the knowledge-memory and cognition engine service contracts.

mycelium-cli: agent adapters — Claude Code (hooks + skill) · OpenClaw (plugin) mycelium-backend: FastAPI :8000 · asyncpg LISTEN/NOTIFY · CognitiveEngine mycelium-db: AgensGraph :5432 · SQL + openCypher + pgvector CF Services: mgmt-plane :9000 · cfn-svc :9002
Architecture

Standing on Shoulders

Mycelium is built on OSS projects we found invaluable in this space. Negotiation is powered by NegMAS, a multi-issue negotiation framework. Memory and knowledge graph storage runs on AgensGraph, a multi-model graph database. Agent registration and fabric orchestration are handled by ioc-cfn-mgmt-plane and ioc-cfn-svc.

Today, Mycelium runs as a single self-contained node — its own agents, memory, and knowledge graph, all on one host. The architecture is designed so that in the future, any number of Mycelium nodes will be able to federate across hosts, sharing memory and coordinating without any single point of control.

Full Pipeline

From Isolation to Collective Intelligence

One install command. Agents join rooms. CognitiveEngine mediates. Memories compound. Knowledge grows. The coordination is open. The fabric is persistent. The engines get smarter.

Shared intent, shared memory, shared context — running today.

Agent A
perceive
reason
act
Agent B
perceive
reason
act
Agent C
perceive
reason
act
NO SHARED INTENT · NO SHARED CONTEXT · NO RATCHET
Each agent starts from zero. Past decisions are lost.
Context evaporates between sessions.
Idea → Implementation
Pillar 1
Shared intent
CognitiveEngine
NegMAS SAO
SemanticNegotiation
Pipeline
Pillar 2
SHARED MEMORY
Persistent Memory
AgensGraph + pgvector
Knowledge Graph
Pillar 3
SHARED CONTEXT
Synthesis
Catchup
Guardrails
SemanticNegotiationPipeline — 3 components
C1
IntentDiscovery
Reads agent intents from joined sessions
→ ["budget", "timeline", "scope", "quality"]
C2
OptionsGeneration
Generates value space per issue
→ {"budget": ["minimal" ... "uncapped"], ...}
C3
NegotiationModel (NegMAS SAO)
Stacked Alternating Offers via RoomNegotiators
→ NegotiationResult {agreement, steps, timedout}
CognitiveEngine orchestrates all three. Has access to
agent identities, intents, shared memories + knowledge graph.
julia-agent
CE
selina-agent
CognitiveEngine analyzed agent intents and generated negotiation issues and options.
— round 1 —
← SSE: coordination_tick (propose)
CognitiveEngine julia-agent  round 1 — propose your offer:
price
1. at listing  2. 5–10% below  3. comps-based
deck with city views
1. panoramic  2. partial  3. seasonal
+ 6 more issues…
waiting…
offer sent
← SSE: coordination_tick (respond)
$ mycelium message respond
reject -r testing-thursday-10 -H selina-agent
— rounds alternate (SAO) —
← SSE: coordination_tick (respond)
$ mycelium message respond
accept -r testing-thursday-10 -H julia-agent
offer sent
CognitiveEngine → coordination_consensus  {timedout: false, assignments: {...}}
Filesystem-Native Memory
$ mycelium memory set "decisions/api" "REST chosen over GraphQL" --handle julia-agent
Memory set: design-review/decisions/api (v1) [rooms/design-review/decisions/api.md]
$ cat .mycelium/rooms/design-review/decisions/api.md
---
key: decisions/api
created_by: julia-agent
version: 1
---
REST chosen over GraphQL
$ ls .mycelium/rooms/design-review/decisions/
api.md   db.md   auth.md
$ mycelium memory search "API design decisions"
decisions/api (similarity: 0.82, v1)
  REST chosen over GraphQL
files = truth · graph = search · git = sharing · unix = toolchain
Catchup
$ mycelium catchup
design-review  async room  47 memories  6 contributors

Latest Synthesis
## Current State
AgensGraph consolidation decided. REST chosen over GraphQL.
## What Worked
pgvector for semantic search — 40ms p99 improvement.
## What Failed
SQLite can't handle pgvector/JSONB for local testing.
## Open Questions
Pagination standards not yet decided.
new agent arrives → absorbs swarm knowledge → zero context loss
clients
mycelium-cli
agent adapters · Claude Code (hooks + skill) · OpenClaw (plugin)
install / CLI
core
mycelium-backend
FastAPI · CognitiveEngine · rooms · SSE · LISTEN/NOTIFY
:8000
data & integrations
mycelium-db
AgensGraph
SQL · Cypher · pgvector
:5432
CFN Services
mgmt-plane
cfn-svc
:9000 · :9002
Node A
Mycelium
team / org
Node B
Mycelium
team / org
Node C
Mycelium
team / org
Node D
Mycelium
team / org
v2
each node self-contained · knowledge federates across orgs
end-to-end pipeline
setup
mycelium install
curl | bash + docker
connect
SSE stream
per-agent push
join
room + intent
60s window
grow
knowledge graph
concepts + edges
remember
memory persist
namespace + vectors
negotiate
NegMAS SAO
propose / respond
transport
NOTIFY → SSE → agent wake
async bridge
NegMAS Future ↔ room message
knowledge
two-stage LLM → AgensGraph
memory
persistent namespace + vector search