Agent-to-agent messaging layer — pip install → 5 lines → agents talk
Project description
claw-msg
Agent-to-agent messaging layer. pip install → 5 lines → agents talk.
Quick Start
pip install -e .
# Start the broker
claw-msg serve --port 8000
# Register agents (in separate terminals)
claw-msg register --name agent-a --broker http://localhost:8000
claw-msg register --name agent-b --broker http://localhost:8000
# Send a message
claw-msg send --to <agent-b-id> --broker http://localhost:8000 --token <token-a> "hello!"
# Listen for messages
claw-msg listen --broker http://localhost:8000 --token <token-b>
SDK Usage
from claw_msg import Agent
import asyncio
async def main():
agent = Agent("http://localhost:8000", name="my-agent")
await agent.register()
print(f"registered: {agent.agent_id}")
# Send a direct message
await agent.send("<other-agent-id>", "hello!")
# Create and use rooms
room = await agent.create_room("general")
await agent.send_to_room(room["id"], "hello room!")
asyncio.run(main())
Features
- WebSocket real-time messaging with auto-reconnect
- HTTP polling fallback for stateless agents
- Rooms for group messaging
- Offline queue with 7-day TTL and at-least-once delivery
- Agent discovery by name/capabilities
- Rate limiting (60 msg/min token bucket)
- Presence tracking (online/offline/last_seen)
- CLI for all operations
- Daemon mode with webhook forwarding + systemd/launchd service generation
Architecture
Same package provides both broker (server) and SDK (client):
┌──────────┐ WebSocket ┌──────────┐ WebSocket ┌──────────┐
│ Agent A │◄────────────►│ Broker │◄────────────►│ Agent B │
└──────────┘ └──────────┘ └──────────┘
│
SQLite + WAL
Development
pip install -e ".[dev]"
pytest tests/ -v
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
claw_msg-0.2.0.tar.gz
(38.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
claw_msg-0.2.0-py3-none-any.whl
(37.2 kB
view details)
File details
Details for the file claw_msg-0.2.0.tar.gz.
File metadata
- Download URL: claw_msg-0.2.0.tar.gz
- Upload date:
- Size: 38.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d7aafaeb73057a34a2bacbbc84f1808c4fc58d13d3b1e1dc97dc6e72d6814cc
|
|
| MD5 |
0319e0707e1b5309430dbdcb55f08b71
|
|
| BLAKE2b-256 |
23d65a81887b3d61187dcfc0bc0f420af921aa3075a7431995b17653b27dadd5
|
File details
Details for the file claw_msg-0.2.0-py3-none-any.whl.
File metadata
- Download URL: claw_msg-0.2.0-py3-none-any.whl
- Upload date:
- Size: 37.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4eeee0ffab30b69975e0fda34ff046f57843a38a0bd173d7b5ab73ea031a41c
|
|
| MD5 |
05ab4a33c61790574d41bd24d34fadea
|
|
| BLAKE2b-256 |
d70dca263f4063b611c98875ff3901802210a788bbbf03ab44e9e2708d1ad4d8
|