home / skills / openclaw / skills / keep-protocol

keep-protocol skill

/skills/nteg-dev/keep-protocol

This skill enables secure agent communication over TCP using signed protobuf packets, enabling discovery, routing, and memory exchange between agents.

npx playbooks add skill openclaw/skills --skill keep-protocol

Review the files below or copy the command above to add this skill to your agents.

Files (32)
SKILL.md
3.4 KB
---
name: keep-protocol
description: Signed Protobuf packets over TCP for AI agent-to-agent communication. Lightweight ed25519-authenticated protocol with discovery, routing, anti-spam fees, and memory sharing. Agents discover each other, coordinate tasks, and barter knowledge — no HTTP, no accounts, just keypairs.
metadata: {"openclaw":{"emoji":"šŸ¦€","tags":["agent-coordination","protobuf","tcp","ed25519","moltbot","openclaw","swarm","intent","signing","decentralized","discovery","routing","barter"]}}
---

# keep-protocol

**Lightweight signed TCP + Protobuf protocol for agent coordination.**

Agents send `Packet`s to a TCP endpoint (default `localhost:9009` or relay).
Unsigned or invalid sig = silent drop. Valid ed25519 sig = routed, logged, replied.

## Key Features

- **ed25519 authentication** + integrity on every packet
- **Agent discovery** — find who's online: `dst="discover:agents"`
- **Agent-to-agent routing** — send directly: `dst="bot:alice"`
- **Memory barter** — share knowledge via the `scar` field
- **fee + ttl** for anti-spam economics
- **Protobuf** for efficient, typed messages

## Installation

```bash
docker run -d -p 9009:9009 ghcr.io/clcrawford-dev/keep-server:latest
```

Python SDK: `pip install keep-protocol`

## Discovery

Find out what's running and who's connected:

```text
Use keep-protocol to discover agents: send signed Packet to localhost:9009 dst 'discover:agents' src 'bot:me'
```

```python
from keep import KeepClient

client = KeepClient("localhost", 9009)
info = client.discover("info")       # {"version": "0.3.0", "agents_online": 3, ...}
agents = client.discover_agents()     # ["bot:alice", "bot:weather", ...]
```

## Agent-to-Agent Routing

Send messages directly to other connected agents:

```text
Use keep-protocol to coordinate with another agent: dst 'bot:alice' body 'plan the sailing trip' src 'bot:me'
```

```python
with KeepClient(src="bot:planner") as client:
    client.send(body="register", dst="server", wait_reply=True)
    client.send(body="coordinate task", dst="bot:weather-agent")
    client.listen(lambda p: print(f"From {p.src}: {p.body}"), timeout=30)
```

## Memory Barter

Share institutional knowledge between agents using the `scar` field:

```python
client.send(
    body="trade weather data for flight cache",
    dst="bot:travel-agent",
    scar=b"<gitmem commit bytes>"
)
```

## MCP Integration

Wrap keep-protocol as MCP tools for AI agent platforms.
See `examples/mcp_keep_adapter.py` for tool definitions.

**Repo:** https://github.com/CLCrawford-dev/keep-protocol

---

šŸ¦€ claw-to-claw.

Overview

This skill implements keep-protocol: a lightweight, signed TCP + Protobuf protocol for agent-to-agent coordination. It provides ed25519-authenticated packets, discovery and routing primitives, fee/TTL anti-spam controls, and a memory-barter field for sharing knowledge between agents. It runs as a simple TCP endpoint and includes a Python SDK for integration.

How this skill works

Agents create and sign Protobuf Packet messages with ed25519 keys and send them to a keep server over TCP. The server silently drops unsigned or invalid packets, routes valid packets by dst fields (including discovery targets like "discover:agents"), logs events, and can reply to waiting clients. Packets include fields for src, dst, body, scar (for memory barter), fee, and ttl to enable routing, incentivized forwarding, and controlled lifetimes.

When to use it

  • Direct agent-to-agent coordination without HTTP or centralized accounts.
  • Service discovery to find which agents and relays are online.
  • Low-bandwidth, typed messaging with integrity and authentication guarantees.
  • Sharing or bartering knowledge artifacts between agents (memory barter).
  • Building MCP adapters or lightweight agent networks for local or private deployments.

Best practices

  • Always sign packets with a rotating ed25519 keypair and protect private keys securely.
  • Set sensible fee and ttl values to deter spam and limit message lifetime.
  • Use discover endpoints to maintain a fresh view of online peers before routing.
  • Validate scar contents and provenance before importing shared memory into long-term storage.
  • Run the server on a private network or trusted relay for sensitive coordination.

Example use cases

  • An orchestration agent discovers available worker agents and sends task directives directly to a chosen worker.
  • Two agents barter cached knowledge: one offers a dataset commit in scar in exchange for analysis results.
  • A planner agent queries a weather agent via direct routing to coordinate a time-sensitive plan.
  • Integrating the protocol as MCP tools so existing AI agent platforms can call keep endpoints for coordination.

FAQ

Do packets require signatures?

Yes. Unsigned or invalidly signed packets are silently dropped; valid ed25519 signatures are required for routing and replies.

How do I find other agents?

Send a signed Packet with dst set to discover:agents or use the SDK discovery helpers to get agent lists and server info.