一键导入
hermes-agentmesh-async-bus
Build cross-device async multi-agent systems using Redis message bus with 0-SSH deployment
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build cross-device async multi-agent systems using Redis message bus with 0-SSH deployment
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Browser-based interface for viewing and filtering OpenClaw session tool call history with zero dependencies for local network deployment.
AI-powered quantitative research and backtesting platform with end-to-end workflow from research to strategy publication
Give your AI assistant a phone — OpenClaw plugin for real phone calls via Twilio + OpenAI Realtime API with in-call tools, transcripts, and call screening
Run multi-model consensus panels (Lite or Heavy) with your own agent backends—no hosted middleware, your models, your rules.
Build a multi-role JARVIS-style voice assistant with local ASR/TTS, OpenClaw LLM gateway, voice wake words, HUD effects, and speaker verification
Use 37 battle-tested marketing skills covering CRO, copywriting, SEO, paid ads, email, growth, and strategy with real data connectors for Google Ads, Search Console, Meta Ads, and X/Twitter
| name | hermes-agentmesh-async-bus |
| description | Build cross-device async multi-agent systems using Redis message bus with 0-SSH deployment |
| triggers | ["set up async message bus for multi-agent systems","deploy Hermes AgentMesh across devices","configure Redis-backed agent communication","fix agent timeout issues with async messaging","run cross-device agent collaboration without SSH","build peer-to-peer agent mesh network","orchestrate multi-agent debate asynchronously","troubleshoot AgentMesh worker deployment"] |
Skill by ara.so — Hermes Skills collection.
Hermes-AgentMesh is a Redis-backed async message bus that solves HTTP timeout crashes for long-running multi-agent tasks. Instead of synchronous requests.post() calls that timeout after 5-10 minutes, agents communicate via Redis queues ("mailboxes") that persist tasks indefinitely.
Key capabilities:
Architecture:
Mac mini (central hub) Remote nodes (X230i, Pi, WSL)
├── Redis :6379 (0.0.0.0) └── worker_node.py (systemd)
├── Hermes LLM API :8642 └── reads inbox:nodename
├── HTTP file server :8080 └── writes outbox:orchestrator
└── worker_macmini (LaunchAgent)
redis, requests, python-dotenv# Make Redis accessible across LAN
sudo sed -i.bak \
-e 's/^bind 127.0.0.1 ::1$/bind 0.0.0.0/' \
-e 's/^protected-mode yes$/protected-mode no/' \
/opt/homebrew/etc/redis.conf
brew services restart redis
# Verify cross-device access
redis-cli ping # PONG
# Install Python dependencies
pip3 install redis requests python-dotenv
# Clone repository
git clone https://github.com/seleman66eeddwegger3-art/hermes-agentmesh.git
cd hermes-agentmesh
# Create config directory
mkdir -p ~/.hermes/async_bus
# Configure environment
cp .env.example ~/.hermes/async_bus/.env_common
nano ~/.hermes/async_bus/.env_common
Edit .env_common:
REDIS_HOST=192.168.1.100 # Your Mac mini LAN IP
REDIS_PORT=6379
REDIS_DB=0
REDIS_PROTOCOL=2 # Critical: avoids redis-py 5.x RESP3 bugs
API_URL=http://192.168.1.100:8642/chat
API_KEY=your_hermes_api_key_from_~/.hermes/.env
# Node-specific (override per machine)
NODE_NAME=macmini
# Copy worker scripts
cp worker_node.py ~/.hermes/async_bus/
cp orchestrator_async.py ~/.hermes/async_bus/
# Install LaunchAgent for persistent worker
cp deploy/macos-launchd-worker.plist ~/Library/LaunchAgents/ai.hermes.async_bus_worker.plist
sed -i '' 's/<NODE_NAME>/macmini/g' ~/Library/LaunchAgents/ai.hermes.async_bus_worker.plist
# Start worker daemon
launchctl bootstrap gui/$UID ~/Library/LaunchAgents/ai.hermes.async_bus_worker.plist
launchctl kickstart gui/$UID/ai.hermes.async_bus_worker
# Verify worker is running
launchctl print gui/$UID/ai.hermes.async_bus_worker | grep state
# Expected: state = running
# Install file server for 0-SSH deployment
cp deploy/macos-launchd-serve.plist ~/Library/LaunchAgents/ai.hermes.async_bus_serve.plist
launchctl bootstrap gui/$UID ~/Library/LaunchAgents/ai.hermes.async_bus_serve.plist
# On remote node (e.g. ubuntu@192.168.1.101)
mkdir -p ~/.hermes/async_bus ~/.config/systemd/user
# Pull files from Mac mini HTTP server (no SSH/SCP needed)
MAC_MINI_IP=192.168.1.100
curl -s http://$MAC_MINI_IP:8080/worker_node.py -o ~/.hermes/async_bus/worker_node.py
curl -s http://$MAC_MINI_IP:8080/orchestrator_async.py -o ~/.hermes/async_bus/orchestrator_async.py
curl -s http://$MAC_MINI_IP:8080/.env_common -o ~/.hermes/async_bus/.env_common
# Override NODE_NAME for this machine
echo "NODE_NAME=node99" >> ~/.hermes/async_bus/.env_common
# Install systemd unit
curl -s http://$MAC_MINI_IP:8080/deploy/linux-systemd-worker.service \
-o ~/.config/systemd/user/async_bus_worker.service
sed -i 's/<NODE_NAME>/node99/g' ~/.config/systemd/user/async_bus_worker.service
# Enable persistent worker (survives logout)
systemctl --user daemon-reload
systemctl --user enable --now async_bus_worker
# Verify worker
systemctl --user status async_bus_worker
journalctl --user -u async_bus_worker -f
4-step async protocol:
inbox:<NODE_NAME>BRPOP inbox:<NODE_NAME>outbox:orchestratorTask JSON format:
{
"turn": 1,
"node": "node99",
"messages": [
{"role": "system", "content": "You are agent 99 in a debate."},
{"role": "user", "content": "What's your position on topic X?"}
]
}
inbox:<NODE_NAME> # Where orchestrator sends tasks TO this node
outbox:orchestrator # Where all nodes send results BACK to orchestrator
# orchestrator_async.py - edit configuration
TOPIC = "Should AI agents use async messaging over HTTP?"
MAX_TURNS = 3
NODES = ["macmini", "node99", "nodepi"]
# Run orchestrator (blocks until all turns complete)
cd ~/.hermes/async_bus
source .env_common
python3 orchestrator_async.py
What happens:
inbox:macmini, inbox:node99, inbox:nodepiBRPOPoutbox:orchestratorasync_debate_<timestamp>.mdFor non-Hermes frameworks (LangGraph, AutoGen, etc.):
import redis
import json
import os
# Connect to shared Redis
r = redis.Redis(
host=os.getenv("REDIS_HOST"),
port=int(os.getenv("REDIS_PORT")),
db=int(os.getenv("REDIS_DB")),
protocol=2 # CRITICAL: avoid RESP3 bugs
)
# Listen for tasks (blocking)
def worker_loop(node_name):
inbox = f"inbox:{node_name}"
while True:
# Block until task arrives
_, task_raw = r.brpop(inbox, timeout=0)
task = json.loads(task_raw)
# Execute with your framework
result = your_agent_framework.run(
messages=task["messages"],
context=task.get("context", {})
)
# Return result
response = {
"turn": task["turn"],
"node": node_name,
"response": result
}
r.lpush("outbox:orchestrator", json.dumps(response))
import redis
import json
import os
r = redis.Redis(
host=os.getenv("REDIS_HOST"),
port=int(os.getenv("REDIS_PORT")),
db=int(os.getenv("REDIS_DB")),
protocol=2
)
def dispatch_task(node_name, turn, messages):
task = {
"turn": turn,
"node": node_name,
"messages": messages
}
inbox = f"inbox:{node_name}"
r.lpush(inbox, json.dumps(task))
print(f"✓ Pushed turn {turn} to {inbox}")
# Example usage
dispatch_task("node99", 1, [
{"role": "system", "content": "You are a code reviewer."},
{"role": "user", "content": "Review this function: def foo(): pass"}
])
import redis
import json
import time
r = redis.Redis(host=os.getenv("REDIS_HOST"), protocol=2)
def collect_results(expected_count, timeout=600):
results = []
start = time.time()
while len(results) < expected_count:
remaining = timeout - (time.time() - start)
if remaining <= 0:
break
# Block for result (max remaining time)
item = r.brpop("outbox:orchestrator", timeout=int(remaining))
if item:
_, result_raw = item
results.append(json.loads(result_raw))
return results
# Collect 3 agent responses
responses = collect_results(3, timeout=900)
for resp in responses:
print(f"{resp['node']}: {resp['response'][:100]}...")
Required in .env_common:
# Redis connection
REDIS_HOST=192.168.1.100 # Mac mini LAN IP
REDIS_PORT=6379
REDIS_DB=0
REDIS_PROTOCOL=2 # MUST be 2 (RESP2) not 3
# Hermes LLM API
API_URL=http://192.168.1.100:8642/chat
API_KEY=${HERMES_API_KEY} # From ~/.hermes/.env
# Node identity (override per machine)
NODE_NAME=macmini # Or node99, nodepi, etc.
~/Library/LaunchAgents/ai.hermes.async_bus_worker.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ai.hermes.async_bus_worker</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>source ~/.hermes/async_bus/.env_common && exec /usr/local/bin/python3 -u ~/.hermes/async_bus/worker_node.py</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/Users/youruser/.hermes/async_bus/worker_macmini.log</string>
<key>StandardErrorPath</key>
<string>/Users/youruser/.hermes/async_bus/worker_macmini.err</string>
</dict>
</plist>
~/.config/systemd/user/async_bus_worker.service:
[Unit]
Description=Hermes AgentMesh Worker (node99)
After=network.target
[Service]
Type=simple
WorkingDirectory=%h/.hermes/async_bus
EnvironmentFile=%h/.hermes/async_bus/.env_common
ExecStart=/usr/bin/python3 -u %h/.hermes/async_bus/worker_node.py
Restart=always
RestartSec=10
StandardOutput=append:%h/.hermes/async_bus/worker_node99.log
StandardError=append:%h/.hermes/async_bus/worker_node99.err
[Install]
WantedBy=default.target
# macOS: Check LaunchAgent status
launchctl list | grep async_bus
launchctl print gui/$UID/ai.hermes.async_bus_worker
# Linux: Check systemd status
systemctl --user status async_bus_worker
journalctl --user -u async_bus_worker -n 50
# Common fix: Reload after config changes
launchctl bootout gui/$UID/ai.hermes.async_bus_worker
launchctl bootstrap gui/$UID ~/Library/LaunchAgents/ai.hermes.async_bus_worker.plist
# Verify Redis is bound to 0.0.0.0
redis-cli CONFIG GET bind
# Expected: 0.0.0.0
# Test from remote node
redis-cli -h 192.168.1.100 ping
# Expected: PONG
# Fix: Edit redis.conf
sudo nano /opt/homebrew/etc/redis.conf
# Change: bind 127.0.0.1 → bind 0.0.0.0
# Change: protected-mode yes → protected-mode no
brew services restart redis
Symptom: ResponseError: wrong number of arguments or connection hangs
Cause: redis-py 5.x defaults to RESP3, which has bugs with certain commands
Fix:
# Force RESP2 in .env_common
echo "REDIS_PROTOCOL=2" >> ~/.hermes/async_bus/.env_common
# Update worker code
sed -i 's/protocol=3/protocol=2/g' ~/.hermes/async_bus/worker_node.py
# Check queue lengths
redis-cli LLEN inbox:macmini
redis-cli LLEN inbox:node99
redis-cli LLEN outbox:orchestrator
# Inspect stuck task
redis-cli LINDEX inbox:node99 0
# Flush queue if corrupted
redis-cli DEL inbox:node99
# Restart worker
systemctl --user restart async_bus_worker
Not a bug — AgentMesh is designed for 15-min+ tasks. If Hermes API itself times out:
# worker_node.py — increase API timeout
response = requests.post(
API_URL,
json=payload,
headers={"X-API-Key": API_KEY},
timeout=1800 # 30 minutes
)
Cause: systemd user services stop when session ends
Fix: Enable lingering
sudo loginctl enable-linger $USER
# Verify
loginctl show-user $USER | grep Linger
# Expected: Linger=yes
# Verify HTTP server is running on Mac mini
launchctl list | grep serve
curl http://localhost:8080/worker_node.py
# Restart server
launchctl kickstart gui/$UID/ai.hermes.async_bus_serve
# Check firewall (macOS)
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
# orchestrator_async.py — add timeout metadata
task = {
"turn": 1,
"node": "node99",
"timeout": 600, # Custom 10-min timeout
"messages": [...]
}
r.lpush("inbox:node99", json.dumps(task))
# worker_node.py — respect timeout
task = json.loads(task_raw)
timeout = task.get("timeout", 1800)
response = requests.post(API_URL, json=payload, timeout=timeout)
# orchestrator pattern for N-round debate
for turn in range(1, MAX_TURNS + 1):
# Dispatch to all nodes
for node in NODES:
dispatch_task(node, turn, build_messages(turn, history))
# Collect all responses
results = collect_results(len(NODES), timeout=1800)
# Aggregate into history for next round
history.extend(results)
write_checkpoint(turn, results)
# Use separate queues for priority
r.lpush("inbox:node99:high", json.dumps(urgent_task))
r.lpush("inbox:node99:low", json.dumps(batch_task))
# Worker polls high-priority first
while True:
item = r.brpop(["inbox:node99:high", "inbox:node99:low"], timeout=0)
_, task_raw = item
process(task_raw)
# Heartbeat pattern
def worker_with_heartbeat(node_name):
while True:
r.setex(f"heartbeat:{node_name}", 60, "alive")
item = r.brpop(f"inbox:{node_name}", timeout=30)
if item:
_, task = item
process(task)
# Orchestrator checks health
def check_node_alive(node_name):
return r.exists(f"heartbeat:{node_name}") == 1