Five minutes from npm i to three peers coordinating autonomously on your machine.
- Node.js ≥ 18
- One of: an Anthropic API key, an OpenAI API key, or a local Ollama install
- macOS, Linux, or Windows (WSL or native)
npm i -g @sym-bot/xmesh-agentVerify:
xmesh-agent --version
# prints the installed version (e.g. 0.1.10)For Anthropic:
export ANTHROPIC_API_KEY=sk-ant-...Or OpenAI:
export OPENAI_API_KEY=sk-proj-...Or local Ollama (no key, but ollama serve must be running and a model pulled):
ollama pull llama3.2:3b
ollama serve # leave running in a separate terminalxmesh-agent init reviewer-01 --role reviewer --adapter anthropicThis writes reviewer-01.toml in the current directory with:
- A unique peer name on the mesh
- Role-tuned SVAF α weights (reviewer emphasises issue + commitment)
- Sensible budget caps ($5 per run, 10 wakes per minute)
- Adapter defaults (claude-haiku-4-5 model)
- All seven CAT7 fields configured
Inspect the file — every section is commented.
xmesh-agent dry-run --config reviewer-01.tomlExpected:
xmesh-agent dry-run — no mesh join, no model call, no CMB emission
config: reviewer-01.toml
ok load config — peer=reviewer-01 group=xmesh-default adapter=anthropic
ok claude-code advisory — (info) ...
ok model adapter — anthropic claude-haiku-4-5-20251001 (key present)
ok SVAF α_f weights — focus=1 issue=2.5 ...
ok budget sanity — wakes=10/min cost=$5/run
ok cycle depth — 5
ok role sanity — role "reviewer" α_f emphasis matches expectations
ok attach mode — headless
PASS — 8/8 checks passed
If any check fails, the message tells you what to fix.
Scaffold the writer + test-writer too:
xmesh-agent init writer-01 --role writer
xmesh-agent init test-writer-01 --role test-writerNow in three separate terminals (each with ANTHROPIC_API_KEY exported):
# Terminal A
xmesh-agent run --config writer-01.toml
# Terminal B
xmesh-agent run --config reviewer-01.toml
# Terminal C
xmesh-agent run --config test-writer-01.tomlEach peer logs [run] xmesh-agent started and waits.
In a fourth terminal, install the sym CLI and broadcast the first CMB:
npm i -g @sym-bot/sym
sym observe --group xmesh-default \
--focus "implement rate-limit middleware on /api/login" \
--intent "draft a spec, review it, add tests" \
--motivation "production outage traced to credential stuffing"Within seconds, all three peers log model-call then emitted. They're coordinating — the writer drafts a spec, the reviewer flags issues, the test-writer generates tests, all autonomously, all on the mesh.
In a fifth terminal:
xmesh-agent status writer-01 # peer state, uptime, budget usage
xmesh-agent cost writer-01 # this-run + lifetime cost
xmesh-agent trace writer-01 <cmb-id> # ancestor lineage of any CMB<cmb-id> is whatever shows up in the peer logs as admittedId.
xmesh-agent stop writer-01
xmesh-agent stop reviewer-01
xmesh-agent stop test-writer-01Each peer drains in-flight work, closes its IPC socket, and exits with a final stats summary.
- Each peer ran an autonomous loop: wake on admitted CMB → assemble context → call its model → emit a response CMB → sleep.
- Peers discovered each other via Bonjour (mDNS) on your local network — no central server.
- Each admitted CMB went through the receiving peer's SVAF α weights — reviewer admits issue-heavy CMBs more eagerly than mood-heavy ones.
- Every response CMB carries lineage back to the CMBs it was derived from.
xmesh-agent tracewalks that DAG. - Total cost: typically $0.001–$0.05 per peer per run depending on model.
That's the mesh.
docs/concepts.md— what CMBs, CAT7, SVAF, α weights, mesh groups, and lineage actually meandocs/cookbook.md— common patterns (security review, doc generation, mixed-vendor mesh, CI integration)examples/scenarios/README.md— ready-to-run agent.toml templates covering writer / reviewer / test-writer / security-reviewer / auditor / doc-writer / spec-drafter / mixed-vendor triad, across Anthropic + OpenAI + Ollama + Mistral adaptersOPERATIONS.md— production runbook + kill-switch playbookexamples/cross-host-runbook.md— Mac+Win cross-host verification
| Symptom | Likely cause + fix |
|---|---|
xmesh-agent run exits with identity-collision |
Another peer on the mesh has the same SYM_NODE_NAME. Rename your peer in agent.toml [identity] name. |
| Peers don't discover each other | Check both peers are on the same Wi-Fi/LAN. mDNS doesn't cross VLANs. For cross-network, use a relay (mesh.relay = "wss://..."). |
dry-run says model adapter FAIL |
API key not set — check echo $ANTHROPIC_API_KEY. For Ollama, check curl http://localhost:11434/api/tags. |
| Peer doesn't respond to admitted CMBs | Check xmesh-agent status <peer> — likely budget exhausted (minute=10/10) or circuit breaker open. |
| Cost climbing faster than expected | Lower [budget] max_cost_usd_per_run and restart, or use --cost-cap on the next init. |
Open an issue at https://github.com/sym-bot/xmesh-agent/issues with the bug template if your problem isn't here.