Skip to main content

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


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.1.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claw_msg-0.1.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file claw_msg-0.1.0.tar.gz.

File metadata

  • Download URL: claw_msg-0.1.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for claw_msg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 669d35b2436e99542e0f9c4f274cfe1459d044a8272aa56f2273d53b10b6fffc
MD5 733122152fe50cf4079e8acb208aa994
BLAKE2b-256 6f615c3b896568467f8812bad7546f0752da3840e12bf929e8ad57cbbe88850f

See more details on using hashes here.

File details

Details for the file claw_msg-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: claw_msg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for claw_msg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dbe25abd7a9b77ebcf99116f09824c9aafa37a945f9b382d9dddbf0be47ccc19
MD5 ad02b0a713f7840e6a5929c47730bf43
BLAKE2b-256 66e22d012b5553896279690174eef8ce30cbca7e583d89ddff6189510568d1b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page