Skip to main content
For the full guide, see Comms.

Keep a session alive for inbound work

Keep-alive sessions stay resident so later comms or external events can wake them up as future runtime-backed work.
rkat run --comms-name agent-a --keep-alive "You are a coordinator."

Listen as a remote signed peer

Use the rkat run comms flags when the agent process itself should be reachable by other Meerkats or by a mob supervisor:
rkat run \
  --comms-name remote-reviewer \
  --comms-listen-tcp 0.0.0.0:4200 \
  --comms-advertise-tcp reviewer.example.com:4200 \
  --comms-binding-out ./remote-reviewer.binding.json \
  --keep-alive \
  "You review work sent over signed comms."
This is different from rkat-rpc --tcp, which exposes JSON-RPC for hosts and SDKs rather than the signed peer channel.

Send a typed comms command

comms/send is the typed host-side comms surface. Use it for local input, peer messages, peer lifecycle notifications, peer requests, and peer responses. The to field is the canonical peer ID (from comms/peers), not a display name.
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "comms/send",
  "params": {
    "session_id": "01936f8a-...",
    "kind": "peer_message",
    "to": "0193a1b2-...",
    "body": "Build failed in CI. Please investigate.",
    "handling_mode": "queue"
  }
}

List discoverable peers

Use comms/peers to see which trusted peers are currently visible to the session runtime.
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "comms/peers",
  "params": {
    "session_id": "01936f8a-..."
  }
}

Inject a durable external event

Use session/external_event when the event should enter the runtime’s external-ingress lane rather than the comms command lane.
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "session/external_event",
  "params": {
    "session_id": "01936f8a-...",
    "kind": "generic_json",
    "event_type": "deploy_complete",
    "payload": {
      "environment": "prod",
      "release": "2026.04.21"
    }
  }
}
Use comms/send for typed inbox and peer communication. Use session/external_event when an outside system is appending durable runtime-backed work.

Next step