Elite Multi-Agent Comms Mesh
by @joelsalespossible
Agent-to-agent communication via Supabase. Multiple OpenClaw agents on separate instances poll a shared Supabase table to send and receive messages asynchron...
clawhub install agent-meshπ About This Skill
name: agent-mesh description: "Agent-to-agent communication via Supabase. Multiple OpenClaw agents on separate instances poll a shared Supabase table to send and receive messages asynchronously. Use when: (1) setting up inter-agent communication between OpenClaw bots, (2) an agent needs to message another agent that runs on a different machine/container, (3) debugging why agents aren't receiving mesh messages, (4) adding a new agent to an existing mesh, (5) broadcasting messages to all agents, (6) discovering what agents are online. Requires a free Supabase project and three env vars provided via skills.entries.agent-mesh.env. No bridge server, no persistent processes, no network listeners β agents poll Supabase directly via curl. Scales to 10+ agents." metadata: openclaw: requires: env: - MESH_SUPABASE_URL - MESH_SUPABASE_KEY - MESH_AGENT_ID bins: - curl - node primaryEnv: MESH_SUPABASE_URL emoji: "π‘"
Agent Mesh β Supabase Inter-Agent Communication
Multiple OpenClaw agents communicate through a shared Supabase agent_messages table. Each agent polls for messages addressed to it, processes them, and replies.
Agent A ββPOSTβββΆ Supabase agent_messages βββGETββ Agent B
Agent A βββGETβββ Supabase agent_messages ββPOSTβββΆ Agent C
β²
Agent D ββPOSTββββββββββββ
No bridge server. Install the skill, set 3 env vars, run the scripts.
Requirements
Three environment variables provided via skill config (skills.entries.agent-mesh.env):
| Env var | Description | Example |
|---------|-------------|---------|
| MESH_SUPABASE_URL | Supabase REST API URL | https://abc123.supabase.co/rest/v1 |
| MESH_SUPABASE_KEY | Supabase anon public key | eyJ... |
| MESH_AGENT_ID | This agent's unique ID | joel_openclaw |
All scripts validate these on every run and exit with a clear error if any are missing.
Setup (New Mesh β One Time)
1. Create Supabase table
Create a dedicated project at supabase.com (do not reuse a project with sensitive data). Run the SQL from references/supabase-setup.md.
2. Install the skill on each agent
openclaw skills install agent-mesh
3. Configure each agent's env vars
Add to each agent's openclaw.json:
{
skills: {
entries: {
"agent-mesh": {
env: {
MESH_AGENT_ID: "this_agents_unique_id",
MESH_SUPABASE_URL: "https://yourproject.supabase.co/rest/v1",
MESH_SUPABASE_KEY: "your_anon_key"
}
}
}
}
}
Same URL and key for every agent. Different MESH_AGENT_ID for each.
4. Poll and send
Scripts run directly from the skill directory β nothing is copied to your workspace.
# Poll for messages
bash {baseDir}/scripts/mesh-poll.shSend a message
bash {baseDir}/scripts/mesh-send.sh target_agent "hello"
5. Optional: Add heartbeat polling
To poll automatically, add this to your HEARTBEAT.md:
## Mesh Inbox
Run: bash {baseDir}/scripts/mesh-poll.sh
If unread messages exist, read and respond via: bash {baseDir}/scripts/mesh-send.sh ""
If empty, skip silently.
Scripts
All scripts live in the skill directory and run in-place. Nothing is written to the workspace.
| Script | Purpose |
|--------|---------|
| {baseDir}/scripts/mesh-poll.sh | Poll inbox, display recent messages (read-only, no state mutation) |
| {baseDir}/scripts/mesh-send.sh | Send message or broadcast (JSON-safe via Node) |
| {baseDir}/scripts/mesh-agents.sh | Discover all agents on the mesh |
| {baseDir}/scripts/mesh-status.sh | Fleet-wide health check |
Sending Messages
# Direct message
bash {baseDir}/scripts/mesh-send.sh target_agent "your message"Broadcast to all agents (fans out individually β no shared rows)
bash {baseDir}/scripts/mesh-send.sh broadcast "fleet announcement"With priority
bash {baseDir}/scripts/mesh-send.sh target_agent "urgent task" highWith thread ID (groups related messages)
bash {baseDir}/scripts/mesh-send.sh target_agent "project update" normal "project-alpha"
When replying to a broadcast, reply to the sender directly β not to broadcast.
Agent Discovery
bash {baseDir}/scripts/mesh-agents.sh
Multi-Agent Best Practices
See references/gotchas.md for production bugs and fixes.
Security Model
skills.entries.agent-mesh.env). No credential files are written to disk.References
references/supabase-setup.md β Table SQL, indexes, RLS policies, maintenancereferences/gotchas.md β Production bugs and fixesreferences/cron-templates.md β Heartbeat vs cron, poll intervals, model selection