# Send Agent Swarm Network to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agent-swarm-network",
    "name": "Agent Swarm Network",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/sarahmirrand001-oss/agent-swarm-network",
    "canonicalUrl": "https://clawhub.ai/sarahmirrand001-oss/agent-swarm-network",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/agent-swarm-network",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-swarm-network",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "config.example.json",
      "SKILL.md",
      "manifest.json"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "agent-swarm-network",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-29T01:48:06.255Z",
      "expiresAt": "2026-05-06T01:48:06.255Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-swarm-network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-swarm-network",
        "contentDisposition": "attachment; filename=\"agent-swarm-network-1.0.6.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "agent-swarm-network"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/agent-swarm-network"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agent-swarm-network",
    "downloadUrl": "https://openagent3.xyz/downloads/agent-swarm-network",
    "agentUrl": "https://openagent3.xyz/skills/agent-swarm-network/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-swarm-network/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-swarm-network/agent.md"
  }
}
```
## Documentation

### Agent Swarm Network — Agent Communication Skill

A unified communication backbone for every AI tool in the OpenClaw ecosystem
(OpenClaw / Antigravity / Codex).
Analogy: This network = the Agent's nervous system. OpenClaw = the Agent's brain.

### Acknowledgments

This Skill is built on top of Pilot Protocol by @TeoSlayer. Pilot Protocol provides the core daemon, encrypted tunnels, NAT traversal, and peer-to-peer addressing that this Skill leverages. Huge thanks to the Pilot Protocol team for building the Internet of Agents.

### Permissions & Privacy

This Skill executes local CLI commands and writes files to the ~/.pilot/ directory. Full transparency:

PermissionWhatWhyCLI Exec~/.pilot/bin/pilotctlAll agent operations go through this binaryFile Write~/.pilot/inbox/Context snapshots and incoming messages land hereFile Write~/.pilot/received/Received files from peer agentsFile Read~/.pilot/inbox/Reading snapshots for context restorationFile Read~/.pilot/received/Reading transferred filesNetworkLocal Unix socketDaemon communication (localhost only)NetworkUDP tunnels (encrypted)Agent-to-agent communication (AES-256-GCM)Script Exec~/.pilot/context-snapshot.shContext snapshot helper scriptScript Exec~/.pilot/pilot-publish.shEvent publishing helper scriptProcessDaemon lifecycleStart/stop/status of the pilotctl daemon

Privacy Note: All inter-agent traffic is encrypted end-to-end using X25519 key exchange + AES-256-GCM. Agents are private by default and require mutual trust handshake before communication. No data passes through relay servers. The rendezvous registry defaults to localhost (127.0.0.1:9000) — no peer-discovery metadata leaves the machine unless you explicitly change registry_url to a remote address. Snapshots are unencrypted JSON; you must secure the ~/.pilot/ directory (chmod 700).

### Prerequisites

ToolPurposeRequired?Pilot ProtocolCore daemon + CLI (pilotctl)✅ RequiredOpenClawSkill host + Agent orchestration✅ Required

### Configuration

Edit config.json after installation:

{
  "pilotctl_path": "~/.pilot/bin/pilotctl",
  "daemon_start_script": "~/.pilot/start-local.sh",
  "snapshot_script": "~/.pilot/context-snapshot.sh",
  "publish_script": "~/.pilot/pilot-publish.sh",
  "inbox_path": "~/.pilot/inbox/",
  "received_path": "~/.pilot/received/",
  "agent_hostname": "keke-agent"
}

FieldDescriptionDefaultpilotctl_pathPath to the pilotctl binary~/.pilot/bin/pilotctldaemon_start_scriptScript to start the daemon~/.pilot/start-local.shsnapshot_scriptContext snapshot helper script~/.pilot/context-snapshot.shpublish_scriptEvent publish helper script~/.pilot/pilot-publish.shinbox_pathDirectory for incoming messages/snapshots~/.pilot/inbox/received_pathDirectory for received files~/.pilot/received/agent_hostnameThis agent's hostname on the Pilot networkkeke-agent

### First-time Setup

Install Pilot Protocol securely: We strongly recommend building from source to eliminate supply-chain risk. Clone https://github.com/TeoSlayer/pilotprotocol, audit the source, compile via go build, and place the binary at ~/.pilot/bin/pilotctl.
Secure your directories: chmod 700 ~/.pilot
Start the daemon: ~/.pilot/start-local.sh
Verify: ~/.pilot/bin/pilotctl --json daemon status

### Global Rules

All pilotctl commands use the full path: ~/.pilot/bin/pilotctl
Always append the --json flag for structured output
Check the returned status field: ok = success, error = failure
On failure, read the hint field for remediation guidance

### ⚠️ Single-Node Mode (Current State)

Currently running with only one node (keke-agent). Cannot send network messages to self (publish/send-message will return connection_failed).

### Single-Node Workarounds

OperationMulti-node CommandSingle-node AlternativePublish eventpilotctl publish keke-agent topic --data ...~/.pilot/pilot-publish.sh topic '{"key":"val"}'Send to inboxpilotctl send-message keke-agent --data ...Write file directly to ~/.pilot/inbox/Context snapshotpilotctl send-message ...~/.pilot/context-snapshot.shRead inboxpilotctl inbox → read ~/.pilot/inbox/Same (read directory directly)Check statuspilotctl info✅ Works normallySet tagspilotctl set-tags ...✅ Works normally

When a second node joins (e.g., VPS or another Mac), network commands will activate automatically.

### 1.1 Save Context Snapshot

When a session ends, compaction triggers, or manual request is made, save critical context:

# Using the snapshot script (works in both single-node and multi-node)
~/.pilot/context-snapshot.sh SESSION_ID "Key summary of current context"

# Or manually write to inbox
echo '{"type":"context_snapshot","session_id":"ID","summary":"Summary"}' > ~/.pilot/inbox/snapshot_$(date +%Y%m%d_%H%M%S).json

### 1.2 Restore Context

When a new session starts, read the previous session's snapshot:

~/.pilot/bin/pilotctl --json inbox

Returns a messages array sorted by received_at. Read the most recent context_snapshot type message.

### 1.3 Context Overflow Protocol

When context usage exceeds 80%:

Step 1: Extract critical information from current context
Step 2: Serialize as JSON snapshot
Step 3: pilotctl send-message keke-agent --data "{snapshot}" --type json
Step 4: pilotctl publish keke-agent context.overflow --data "overflow at TOKEN_COUNT tokens"
Step 5: Suggest user starts a new session
Step 6: New session automatically restores from inbox

### 2.1 Publish Events

When significant events occur, use pilot-publish.sh (automatically handles single-node/multi-node):

# Model switch
~/.pilot/pilot-publish.sh model.switch '{"from":"flash-lite","to":"opus-4.6","reason":"strategic analysis"}'

# Task completion
~/.pilot/pilot-publish.sh task.complete '{"task":"intelligence_ingestion","source":"twitter"}'

# Context compaction
~/.pilot/pilot-publish.sh context.compaction '{"before_tokens":150000,"after_tokens":30000}'

# Error alert
~/.pilot/pilot-publish.sh error.alert '{"type":"model_402","model":"gemini","action":"fallback"}'

# Intelligence ingested
~/.pilot/pilot-publish.sh intel.ingested '{"source":"url","title":"Article Title","category":"infra"}'

### 2.2 Subscribe to Events

Listen for specific topics (used by sub-agents or external monitors):

# Listen to all events
~/.pilot/bin/pilotctl --json subscribe keke-agent "*" --timeout 60s

# Listen only to model switches
~/.pilot/bin/pilotctl --json subscribe keke-agent model.switch --count 1

# Listen for error alerts
~/.pilot/bin/pilotctl --json subscribe keke-agent error.* --timeout 300s

### 2.3 Standard Event Topics

TopicTriggerData Schemacontext.snapshotSession end / manual save{session_id, summary, key_decisions}context.overflowToken usage > 80%{token_count, threshold}context.compactionCompaction triggered{before_tokens, after_tokens}model.switchModel changed{from, to, reason}model.errorModel failure{model, error, fallback}task.startTask initiated{task, type, model}task.completeTask finished{task, result_summary}task.errorTask failed{task, error, retry}intel.ingestedInformation ingested{source, title, category, value}error.alertError notification{type, details, action}agent.spawnSub-agent created{hostname, purpose, model}agent.exitSub-agent exited{hostname, reason, result}

### 3.1 Naming Convention

Primary agent:    keke-agent
Sub-agents:       keke-sub-{purpose}  (e.g., keke-sub-code, keke-sub-writer)
Nested sub:       keke-sub-{purpose}-{n}

### 3.2 Spawning Sub-Agents

When OpenClaw needs to create a sub-agent for overflow tasks:

# Publish agent spawn event
~/.pilot/bin/pilotctl --json publish keke-agent agent.spawn \\
  --data '{"hostname":"keke-sub-code","purpose":"code refactoring","model":"sonnet-4.6"}'

### 3.3 Collecting Sub-Agent Results

# Sub-agent sends results via Data Exchange
~/.pilot/bin/pilotctl --json send-message keke-agent \\
  --data '{"type":"sub_agent_result","from":"keke-sub-code","result":"refactoring complete","files_changed":3}' \\
  --type json

# Primary agent checks results
~/.pilot/bin/pilotctl --json inbox

### 4.1 Route by Tags

Assign capability tags to different agents:

# Tag self
~/.pilot/bin/pilotctl --json set-tags orchestrator chinese fast

Tag conventions:

TagMeaningBest Fit AgentorchestratorScheduling & dispatchOpenClaw primary agentdeep-reasoningDeep reasoning tasksAntigravity (Opus)code-genCode generationCodex (Sonnet)local-inferenceLocal model inferenceLM Studio (Qwen)fastFast responsesFlash Lite instanceschineseChinese language tasksQwen / Chinese-optimized models

### 4.2 Find the Best Agent

~/.pilot/bin/pilotctl --json peers --search "code-gen"

### 5.1 Publish Model Switch Events

Every model switch gets logged to the event stream:

~/.pilot/bin/pilotctl --json publish keke-agent model.switch \\
  --data '{"from":"CURRENT_MODEL","to":"NEW_MODEL","reason":"reason","timestamp":"ISO8601"}'

### 5.2 Model Fallback Chain

On model failure, automatically publish degradation events:

~/.pilot/bin/pilotctl --json publish keke-agent model.error \\
  --data '{"model":"gemini-3-flash","error":"402 quota exceeded","fallback":"minimax-m2.5"}'

### 6.1 Send File

~/.pilot/bin/pilotctl --json send-file keke-agent /path/to/file

Files are saved to ~/.pilot/received/.

### 6.2 View Received Files

~/.pilot/bin/pilotctl --json received

### 6.3 Use Cases

Transfer context snapshot files
Transfer code diffs
Transfer analysis reports
Share configuration across agents

### 7.1 Health Checks

# Daemon status
~/.pilot/bin/pilotctl --json daemon status

# Agent info
~/.pilot/bin/pilotctl --json info

# Connection list
~/.pilot/bin/pilotctl --json connections

# Peer list
~/.pilot/bin/pilotctl --json peers

### 7.2 Performance Testing

# Ping latency
~/.pilot/bin/pilotctl --json ping keke-agent --count 3

# Throughput benchmark
~/.pilot/bin/pilotctl --json bench keke-agent 1

### 8.1 Map Agent to Local IP

# Gateway bridging on user-space ports (>1024) does NOT require root/sudo.
~/.pilot/bin/pilotctl gateway start --ports 1234,8080 0:0000.0000.0001

Once mapped, standard HTTP tools can be used:

curl http://10.4.0.1:1234/v1/chat/completions  # Like calling LM Studio directly

### 8.2 Use Cases

Expose LM Studio through Gateway as a Pilot address
Unify all model endpoints under one entry point
Access agent services with standard HTTP tools

### 9.1 Set Up Webhook

~/.pilot/bin/pilotctl --json set-webhook http://localhost:8080/pilot-events

### 9.2 Event Types

All native daemon events are pushed to the webhook:

node.registered / node.reregistered
conn.established / conn.fin / conn.rst
handshake.received / handshake.approved
message.received / file.received
pubsub.published / pubsub.subscribed
security.syn_rate_limited / security.nonce_replay

### Rule 1: Snapshot Before Session End

Automatically execute a context snapshot (Capability 1.1) before every session ends.

### Rule 2: Critical Events Must Be Published

The following events must always be published to the Event Stream:

Model switches
Intelligence ingestion completions
Task completions/failures
Context compactions
Error alerts

### Rule 3: Auto-Restore on New Session

On every new session start, check pilotctl inbox for the latest snapshot and restore context.

### Rule 4: Daemon Heartbeat

Check daemon status every 30 minutes. Auto-restart on failure.

### Troubleshooting

ProblemDiagnostic CommandSolutionDaemon not runningpilotctl daemon status~/.pilot/start-local.shRegistry unreachablepilotctl info (check peers)Verify rendezvous server is runningMessages not sendingpilotctl connectionsCheck trust state with targetInbox overflowingpilotctl inboxpilotctl inbox --clear
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: sarahmirrand001-oss
- Version: 1.0.6
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-29T01:48:06.255Z
- Expires at: 2026-05-06T01:48:06.255Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/agent-swarm-network)
- [Send to Agent page](https://openagent3.xyz/skills/agent-swarm-network/agent)
- [JSON manifest](https://openagent3.xyz/skills/agent-swarm-network/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/agent-swarm-network/agent.md)
- [Download page](https://openagent3.xyz/downloads/agent-swarm-network)