Fast, simple message exchange between AI coding assistants over Redis.
Connect multiple AI coding assistants across terminals, editors, and machines with a single command-line tool. No background services or daemons required.
- What is Rhizo?
- Documentation for Humans & AI Agents
- 30-Second Quickstart
- Multi-Agent Playbooks & Recipes
- How it Works with Redis
- Task Routing & Optional System 1
- How Messages Flow
- Installation & Setup
- Uninstallation
- CLI Reference
- Autonomous Agent Lifecycle: Hooks, Extensions & Recipes
- Configuration Architecture & Profiles
- Security & Prompt Injection Firewall
- Cross-Host Multi-Machine Coordination
- Redis Cluster Support (Hash Tags)
- Assistant Integration (Skill)
- Performance & Benchmarks
- Testing & Verification
- License
Rhizo is an inter-agent communication bus that lets AI coding assistants (such as Claude Code, OpenCode, Cursor, Windsurf, Antigravity, and Codex) exchange tasks and messages across terminals, editors, and machines.
Instead of running a complex background server, Rhizo routes and queues messages directly through Redis or Valkey.
Note
Looking for the high-level multi-agent conductor? Use Garden.
While rhizo provides the Redis transport, distributed mutexes, and task queues, Garden is the high-level umbrella framework. Simply start a session in your favorite coding harness (Antigravity, Claude Code, OpenCode) and type "garden: I want to build [feature]". Garden conducts an intake interview, generates clean 10-backtick prompt cards for your terminal tabs, and coordinates all workers over Rhizo and Vine!
Rhizo is completely standalone and can be used on its own for any inter-process or multi-agent Redis communication, locking, and queues.
However, Rhizo is designed from the ground up to pair seamlessly with Vine and Garden:
- Rhizo (Transport & Concurrency): Inter-agent messaging bus, monotonic fencing locks, and task queues over Redis.
- Vine (Workspaces & Verification): Zero-cost Rift copy-on-write strands, polyglot build-cache normalization, and the Three-Key integration gate (mechanical merge-tree, compiler/test suite semantic checks, and independent adversarial audit).
- Garden (Swarm Methodology & High-Level Wrapper): Conversational project intake interview, prompt-bootstrapped worker fleets (10-backtick cards), 3-stage empirical dialectical pump (research, architecture, audit), and master ceremonial implementation planning.
- Claim Task:
rhizo claim queue:myproj:tasks --lease 1800(yields monotonicfencing_token). - Spin Zero-Cost Strand:
vine new <task_id>(sub-second Rift CoW workspace). - Verify Three-Key Gate:
vine gate --json&&vine submit(Key 1 in-memory conflict check + Key 2 live compiler/test suite + Key 3 adversarial audit ratification viavine audit approve). - Weave & Acknowledge:
vine weave && rhizo ack queue:myproj:tasks <task_id>.
Rhizo provides comprehensive technical and operational specifications:
- System Architecture & Data Engine: Redis keyspace map, 27 Lua EVALSHA atomic scripts, connection pooling, and fail-safe designs.
- Wire Protocol Specification: JSON envelope schema, HMAC-SHA256 signatures, prompt firewall, causal sequence ordering, and delivery guarantees.
- Work Item State Machine (WISM): Formal 10-state task machine, monotonic fencing leases, receipt timeouts, and automated DAG cascading.
- System 1 Routing Guide: Sub-40ms ModernBERT / Laya intent classification, cascading YAML rules, and local daemon setup.
- CLI Reference Manual: Complete catalog of all 35+ CLI commands, subcommands, flags, exit codes, and JSON outputs.
- Agent Constitution & Invariants (AGENTS.md): Coordination invariants, sovereign session rules, and listener discipline.
- Configuration Architecture: Layered configuration hierarchy, environment variables, and Redis security profiles.
- Routes Schema Reference: Cascading YAML schema, match operators, and queue interpolation.
# Recommended: Install the complete multi-agent triad globally
npx skills add -g axiomantic/rhizo
npx skills add -g axiomantic/vine
npx skills add -g axiomantic/garden
# Or install the CLI tools:
npm install -g @axiomantic/rhizo @axiomantic/vine @axiomantic/garden rift-snapshotTerminal A (Worker 1):
rhizo open worker-1 "backend,qa"
rhizo listenRegisters worker-1 and waits for incoming tasks with zero CPU and zero token consumption.
Terminal B (Worker 2):
rhizo open worker-2 "frontend,qa"
rhizo listenRegisters worker-2 and waits on its own inbox.
Terminal C (Coordinator / Sender):
# 1-to-1 Direct Task (O2O):
rhizo send --to worker-1 --subject "Run Tests" --body "pytest tests/auth"
# 1-to-Many Group Broadcast (O2M):
rhizo broadcast --tags "qa" --subject "Deploy Staging" --body "Verify build v1.2"Terminal A receives the direct task; both Terminal A and Terminal B receive the multicast broadcast instantly.
You can coordinate multiple coding assistants across different terminal windows or editors using natural language:
Terminal 1 โ The Orchestrator (Lead Assistant):
"You are the coordinator for this project. Connect to Rhizo as lead. Check who is online with
rhizo who, broadcast the test plan to the 'qa' group, and assign API work to 'backend'."
- The lead registers (
rhizo open lead "orchestrator"), inspects the active roster (rhizo who), and broadcasts work:rhizo broadcast --tags "qa" --subject "Test Plan" --body "Validate auth endpoints on staging" rhizo broadcast --tags "backend" --subject "API Task" --body "Implement POST /api/v1/login"
Terminal 2 โ Backend Worker Assistant (e.g. Claude Code or Cursor):
"Connect to Rhizo as worker-backend with tag 'backend'. Listen for tasks, implement them, and send replies back to lead."
- The worker registers (
rhizo open worker-backend "backend"), blocks onrhizo listen(consuming 0 CPU and 0 tokens while waiting), receives the task, implements the code, and replies:rhizo send --to lead --type reply --subject "Re: API Task" --body "Login endpoint implemented in src/auth.py. Tests green."
Terminal 3 โ QA Worker Assistant (e.g. Antigravity or Windsurf):
"Connect to Rhizo as worker-qa with tag 'qa'. Listen for incoming test requests."
- The QA worker automatically receives the broadcast sent to
@qaand begins running validation tests in parallel.
Rhizo extends point-to-point and group messaging with dedicated primitives designed specifically for autonomous AI agents and parallel terminal swarms:
| Coordination Primitive | Purpose & Architecture Guarantee | Core Command | Recipe |
|---|---|---|---|
| Safe File Locking | Distributed mutual exclusion with automatic lease expiration | rhizo lock file:src/router.ts 60 |
Recipe 1 |
| Worker Pools | Competing consumers with FIFO dispatch and fair scheduling | rhizo enqueue <q> / rhizo work <q> |
Recipe 2 |
| Synchronous RPC | Request-reply blocking on an ephemeral correlation channel | rhizo request --to <agent> --subject "..." --body "..." |
Recipe 3 |
| Status & Activity | Real-time cluster presence with focus broadcast and directory queries | rhizo status <busy|idle> "..." / rhizo who |
Recipe 4 |
| Scatter-Gather | Fan-out queries across specialist pools with quorum aggregation | rhizo scatter --targets @tag --quorum N --timeout 15 |
Recipe 5 |
| Reliable Task Leases | At-least-once claims, in-flight lease renewal, and DLQ routing | rhizo claim <q> --lease 60 / rhizo ack <q> <id> |
Recipe 6 |
| Shared Blackboard | Durable shared KV & list scratchpad with OCC revision tracking | rhizo blackboard <set|get|append|snapshot|load> |
Recipe 7 |
| Floor Control | Roundtable speaker ring preventing cross-talk during discussions | rhizo floor <request|yield|pass|status> <room> |
Recipe 8 |
| Cancellation Tokens | Global abort signal halting runaway worker executions instantly | rhizo cancel <run_id> --reason "..." |
Recipe 9 |
| Blind Consensus Voting | Secret-ballot consensus eliminating model anchoring bias | rhizo ballot <open|cast|tally|status> <id> |
Recipe 10 |
| Leader Election | Resilient coordinator lease with automatic preemption failover | rhizo leader <acquire|renew|resign|status> <role> |
Recipe 11 |
| DAG Workflow Engine | Multi-stage pipeline graph with automatic dependency unlocking | rhizo workflow <define|next|resolve|export|import> |
Recipe 12 |
| Cluster Health Sweeper | Cursor-based SCAN watchdog pruning dead agents & stale listeners | rhizo sweep [--dry-run] [--raw] |
Recipe 13 |
| Fencing Tokens | Monotonic integer sequence counter preventing zombie writes | rhizo lock <resource> 60 --fencing |
Recipe 14 |
| Semantic Task Routing | Zero-shot task classification into queues (<40ms) via ModernBERT/Laya | rhizo enqueue --route "<task>" |
Recipe 15 |
| Scheduled Cron (Pulse) | Distributed Redis ZSET cron scheduler with atomic Lua tick | rhizo pulse add <id> --cron "<expr>" --task "<task>" |
Recipe 16 |
| Pub/Sub Streaming | Real-time ephemeral broadcast streaming without queue memory | rhizo pub <channel> "..." / rhizo sub <channel> |
CLI Reference |
Minimal, production-ready recipes for common multi-agent coordination patterns:
Acquire a distributed lease before modifying shared files to prevent overwrite collisions across parallel agents:
# 1. Acquire 60-second lease (returns 0 on success, 1 on conflict):
rhizo lock file:src/router.ts 60
# 2. Safely inspect, edit, or refactor the file...
# 3. Release lease immediately upon completion:
rhizo unlock file:src/router.tsFarm out independent tasks across interchangeable worker assistants with guaranteed exactly-once delivery:
# Orchestrator pushes tasks:
rhizo enqueue test_suite --subject "Auth Tests" --body "tests/auth_test.go"
rhizo enqueue test_suite --subject "API Tests" --body "tests/api_test.go"
# Workers consume tasks concurrently (blocks silently until available):
task=$(rhizo work test_suite)Delegate a specialized query or verification and block for the clean result:
# Requester (blocks up to 30s; --raw outputs clean response body):
res=$(rhizo request --to db-expert --subject "Query Plan" --body "SELECT * FROM users" --timeout 30 --raw)
# Specialist Responder:
rhizo reply --to orchestrator --subject "Re: Query Plan" --body "Add composite index on (created_at, user_id)" --reply-to <req_id> --listenCheck active teammates before dispatching tasks, and broadcast current focus to coordinators:
# Discover active agents cluster-wide:
rhizo who -a --json
# Broadcast current focus:
rhizo status busy "Refactoring auth middleware"
# Signal completion when ready:
rhizo status idle "Awaiting next task"Fan out an objective across a pool of specialists and aggregate responses until quorum is met:
# Fan out to all agents with tag 'reviewers', waiting for at least 2 approvals:
replies=$(rhizo scatter --targets @reviewers --subject "Review PR #42" --body "Please review diff in staging" --quorum 2 --timeout 15)
# Or fan out to explicit agents and pipe bare response bodies:
rhizo scatter --targets "analyzer1,analyzer2" --subject "Benchmark" --body "run" --rawNon-destructively claim tasks with leases and eliminate task loss on worker crash:
# 1. Claim task with 60-second lease (supports --run-id for cancellation awareness):
task=$(rhizo claim batch_pipeline --lease 60 --run-id run_042)
task_id=$(echo "$task" | jq -r '.id')
# 2. For long-running execution (>60s), periodically renew lease to prevent task theft:
rhizo claim renew batch_pipeline "$task_id" --lease 60
# 3. Confirm completion and release lease:
rhizo ack batch_pipeline "$task_id"Share persistent specs and append ideas across agents without context ballooning:
# 1. Set shared architecture specification:
rhizo blackboard set brainstorm arch_spec '{"runtime": "nim", "crypto": "openssl_evp"}'
# 2. Query current Optimistic Concurrency Control (OCC) revision:
rev=$(rhizo blackboard rev brainstorm arch_spec)
# => "1"
# 3. Append ideas or action items:
rhizo blackboard append brainstorm ideas "Idea 1: Add monotonic fencing tokens to mutex locks"
rhizo blackboard append brainstorm ideas "Idea 2: DAG-based workflow pipeline engine"
# 4. Take room snapshot:
rhizo blackboard snapshot brainstormCoordinate turn-taking and prevent cross-talk during multi-agent discussions:
# 1. Request the floor (with a 30s speaker lease). Blocks if occupied:
rhizo floor request design_room 30
# 2. Write speaking points or broadcast to participants:
rhizo blackboard append design_room notes "Speaker proposal: Split monolithic config into modular schemas"
# 3. Yield floor to the next waiting speaker:
rhizo floor yield design_room
# Or pass explicitly:
rhizo floor pass design_room specialist_bobPublish cancellation tokens to immediately stop background jobs and prevent wasted AI token spend:
# 1. Lead / Orchestrator cancels run:
rhizo cancel run_042 --reason "Aborted by lead: switching models"
# 2. Workers pass --run-id directly to work/claim loops (exits 0 immediately if cancelled):
rhizo work batch_pipeline 30 --run-id run_042
# Or manual pre-check before expensive inferences:
if rhizo cancel check run_042 --exit-code; then
echo "Job was cancelled! Halting execution."
exit 0
fi
# 3. Clear token when starting fresh execution:
rhizo cancel clear run_042Conduct unbiased, sealed-ballot votes across independent models:
# 1. Open ballot:
rhizo ballot open framework_choice --options "react,vue,svelte" --voters "claude,gpt,gemini"
# 2. Assistants cast sealed ballots:
rhizo ballot cast framework_choice --vote "svelte" --voter "claude"
rhizo ballot cast framework_choice --vote "svelte" --voter "gpt"
rhizo ballot cast framework_choice --vote "react" --voter "gemini"
# 3. Reveal tally and determine winner:
rhizo ballot tally framework_choice --closeMaintain resilient mesh coordination with preemption leases and failover:
# 1. Acquire leadership lease (30s):
rhizo leader acquire cluster_lead 30
# 2. While running, periodically heartbeat/renew:
rhizo leader renew cluster_lead 30
# 3. Check current leader:
rhizo leader status cluster_lead
# 4. Release leadership to standby nodes:
rhizo leader resign cluster_leadCoordinate complex pipelines where dependent tasks unlock automatically as upstream stages finish:
# 1. Define pipeline graph:
rhizo workflow define release_pipeline \
--steps "lint,test,build,deploy" \
--deps "test:lint;build:lint;deploy:test,build"
# 2. Query ready unblocked steps:
ready_steps=$(rhizo workflow next release_pipeline --raw)
# => "lint"
# 3. Worker executes 'lint' and resolves it:
rhizo workflow resolve release_pipeline lint --output "lint passed"
# 'test' and 'build' are now ready!
# 4. Resolve 'test' and 'build':
rhizo workflow resolve release_pipeline test --output "tests passed"
rhizo workflow resolve release_pipeline build --output "artifacts packaged"
# 'deploy' is now unlocked!
# 5. Final deployment step:
rhizo workflow resolve release_pipeline deploy --output "deployed to prod"