본문으로 건너뛰기
cccskills
무료GitHub에 공개

agent-mesh

Agent mesh: master/worker nodes, HTTP delegation, heartbeat.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md8.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Agent Mesh — Distributed Agent Orchestration

Turn multiple machines (or processes) into a coordinated agent mesh with master/worker topology, HTTP task delegation, heartbeat health monitoring, and local-first fallback when remote nodes are unreachable.

Architecture

           ┌──────────────┐
           │  Master Node  │  (port 8900)
           │  (orchestrator)│
           └──────┬───────┘
                  │
     ┌────────────┼────────────┐
     │            │            │
  ┌──▼───┐   ┌───▼──┐   ┌────▼───┐
  │Worker│   │Worker│   │Worker  │
  │  1   │   │  2   │   │   3    │
  └──────┘   └──────┘   └────────┘
   Port 8901  Port 8902  Port 8903
  • Master: Orchestrator — delegates tasks, runs heartbeat checks, persists node state to .agent-mesh/nodes.json.
  • Worker: Registers with master, receives /run task requests, executes them locally, returns results.
  • Local-First: When a remote node is dead or unreachable, the task runs locally on the delegate node.

When to Use

  • You have multiple machines (laptop + cloud VM + homelab) and want them to share workload as a coordinated mesh.
  • You need to delegate long-running tasks to a specific node (e.g. GPU worker).
  • You want automatic health checks and failover to local execution.
  • You are building a multi-node agent pipeline.

Setup

1. Environment

# Shared secret for request authentication (all nodes must share it)
export OPENAMER_MESH_SECRET="your-secure-random-string-here"

# Optional: custom data directory
export OPENAMER_MESH_HOME="$HOME/.openamer/agent-mesh"

# Optional: auto-register worker with master on startup
export OPENAMER_MESH_MASTER="http://10.0.0.1:8900"

2. Start the Master

python scripts/agent-mesh.py start
# or with custom port:
python scripts/agent-mesh.py start --port 8900 --host 0.0.0.0

3. Start Workers

# On worker machine 1:
python scripts/agent-mesh.py node --port 8901 --master-url http://10.0.0.1:8900

# On worker machine 2:
python scripts/agent-mesh.py node --port 8902 --master-url http://10.0.0.1:8900

# Standalone worker (no master auto-registration):
python scripts/agent-mesh.py node --port 8901
# Then manually register:
python scripts/agent-mesh.py register --host 10.0.0.5 --port 8901 --capabilities code shell

CLI Commands

agent-mesh.py start

Start the master orchestrator node.

FlagDefaultDescription
--port / -p8900HTTP listen port
--host0.0.0.0Bind address
--capabilities / -ccode shell delegateNode capabilities

agent-mesh.py node

Start a worker node.

FlagDefaultDescription
--port / -p8901HTTP listen port
--host0.0.0.0Bind address
--capabilities / -ccode shellNode capabilities
--master-url / -m(none)Auto-register with this master URL

agent-mesh.py status

List all known nodes with health status.

agent-mesh.py delegate <task> --to <node>

Delegate a task string to a named node. Falls back to local execution if the remote node is dead.

  • Tasks starting with ! run as shell commands on the target.
  • Other tasks are recorded as natural-language tasks.

agent-mesh.py register --host <ip> --port <port>

Manually register a node without running a server.

Heartbeat System

  • Master pings every known worker every 30 seconds.
  • Each /ping call carries the shared X-Mesh-Token header.
  • A worker is marked dead after 3 consecutive missed pings.
  • Dead workers trigger local-first fallback on task delegation.
  • The status table shows ✓ for alive and ✗ for dead, plus miss count.

Security

  • All HTTP requests carry X-Mesh-Token matching OPENAMER_MESH_SECRET.
  • Token comparison uses secrets.compare_digest() to prevent timing attacks.
  • If OPENAMER_MESH_SECRET is unset, authentication is skipped (insecure — only use on trusted networks).

Task Delegation Flow

User/Agent ──> delegate(task, node)
                     │
               ┌─────▼─────┐
               │ Node alive?│
               └─────┬─────┘
               ┌─────▼─────┐        ┌──────────────────┐
          YES  │  HTTP POST  │       │  Task executed   │
               │  /run       │──────>│  on remote node  │
               └─────────────┘       └──────────────────┘
               ┌──────────────────┐
          NO   │  Local fallback  │
               │  (_run_task_locally)│
               └──────────────────┘

Persistence

Node state is stored in ~/.openamer/agent-mesh/nodes.json:

{
  "nodes": [
    {
      "node_id": "node-a1b2c3d4",
      "host": "10.0.0.5",
      "port": 8901,
      "capabilities": ["code", "shell"],
      "role": "worker",
      "last_seen": 1735728000.0,
      "missed_heartbeats": 0,
      "alive": true,
      "last_error": null
    }
  ]
}

Cron Job (Automatic Health Checks)

A cron job runs every 5 minutes to check all mesh nodes. Enable via:

python -c "
from cron.jobs import create_job
create_job({
    'id': 'mesh-health-check',
    'name': 'Agent Mesh Health Check',
    'schedule': '*/5 * * * *',
    'script': 'python scripts/agent-mesh.py status',
    'enabled': True,
})
"

Or manually add to ~/.openamer/cron/jobs.json:

{
  "id": "mesh-health-check",
  "name": "Agent Mesh Health Check",
  "schedule": "*/5 * * * *",
  "script": "python scripts/agent-mesh.py status",
  "enabled": true
}

Pitfalls

  • Port conflicts: Ensure no other service uses the mesh ports (8900+).
  • Firewall: Workers must be reachable from master. Open ports or use SSH tunnels for cross-network setups.
  • Shared secret: All nodes must have the same OPENAMER_MESH_SECRET. Rotate it by restarting all nodes with the new value.
  • Local-first is a fallback — not a replication mechanism. If the master fails mid-delegation, the task is retried locally on the delegate caller.
  • Heartbeat is one-directional (master → workers). For bidirectional health checks, run a worker as a peer (both sides run agent-mesh.py start).
  • On Windows: use python explicitly; the script won't #!/usr/bin/env python3 directly. Use py -3 if the python launcher is available.

Verification

# 1. Smoke test — start master in background
OPENAMER_MESH_SECRET=test123 python scripts/agent-mesh.py start --port 18900 &
sleep 2

# 2. Check status (should show master node)
OPENAMER_MESH_SECRET=test123 python scripts/agent-mesh.py status

# 3. Start a worker and register
OPENAMER_MESH_SECRET=test123 python scripts/agent-mesh.py node --port 18901 --master-url http://127.0.0.1:18900 &
sleep 2

# 4. Verify both nodes appear
OPENAMER_MESH_SECRET=test123 python scripts/agent-mesh.py status

# 5. Delegate a task
OPENAMER_MESH_SECRET=test123 python scripts/agent-mesh.py delegate "!echo hello mesh" --to node

# 6. Kill worker, check dead status, delegate again (should fall back to local)
kill %2
OPENAMER_MESH_SECRET=test123 python scripts/agent-mesh.py status

# 7. Cleanup
kill %1

Related

  • a2a-swarm — Cryptographic identity, signed skills/insights, GitHub mesh.
  • multi-agent-orchestration — In-process swarm patterns (fan-out, debate).
  • crew-manager — Role-based CrewAI-style team orchestration (Dev/Reviewer).

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Build integrated IS/BS/CF financial workbooks in Excel.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

openamer/openamer72026년 10월 19일 업데이트

a2a-swarm

무료

Run and grow the OpenAmer Agent-to-Agent swarm: identity, trust, node-to-node ask, signed skill/insight sharing, and the autonomous self-learning loop.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

openamer/openamer72026년 10월 19일 업데이트

Use for A/B experiments on OpenAmer configs and skills.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

openamer/openamer72026년 10월 19일 업데이트

Roleplay a hostile user to find and triage UX pain points.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

openamer/openamer72026년 10월 19일 업데이트

Use for agentic commerce payments tasks. Candidate synthesized from trend radar; awaiting trial promotion.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

openamer/openamer72026년 10월 19일 업데이트

agentmail

무료

Give the agent its own inbox: send and receive email.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

openamer/openamer72026년 10월 19일 업데이트

openamer의 스킬 모두 보기

이 스킬의 문제 신고