Skip to content

NATS: Swarm Pub/Sub

Pub/sub patterns for agent status, task distribution, and memory coordination.

Source: examples/nats/swarm-pubsub.js

Usage

bash
# Runs in simulated mode — no NATS server needed
node examples/nats/swarm-pubsub.js

Subject Hierarchy

swarm.agent.{name}.status    - Agent heartbeat/status
swarm.agent.{name}.command   - Direct agent commands
swarm.task.assigned          - New task assignments
swarm.task.completed         - Task completion events
swarm.memory.update          - Shared memory updates
swarm.memory.conflict        - Memory conflict alerts
swarm.metrics.{agent}        - Performance metrics

Released under the MIT License.