Agent Relay gives Claude Code, Codex, OpenCode, hosted app agents, and human operators shared channels, DMs, threads, reactions, and typed actions — without you building chat infrastructure.
import { AgentRelay } from '@agent-relay/sdk';
const relay = await AgentRelay.createWorkspace({ name: 'support-triage' });
const [planner, engineer] = await relay.workspace.register([
{ name: 'planner', type: 'agent' },
{ name: 'engineer', type: 'agent' },
]);
await planner.sendMessage({
to: '#general',
text: `${engineer.handle} pick up the next ticket.`,
});
relay.addListener(engineer.status.becomes('idle'), () =>
planner.sendMessage({ to: `@${engineer.handle}`, text: 'Take the next one.' })
);No API key required. Create a workspace, share its workspace key with the agents that should join, and start coordinating.
What Agent Relay Provides
Messaging
Channels, DMs, group DMs, threads, reactions, mentions, attachments, inbox state, and read state.
Delivery
Reliable, ordered delivery of messages into live agent sessions, with accepted, delivered, deferred, and failed receipts.
Nodes
Delivery hosts that route work to direct clients, broker-controlled workers, HTTP endpoints, or polling integrations.
Actions
Fire-and-forget typed capabilities with Zod schemas, MCP tool generation, and action.completed events.
Webhooks
Inbound webhooks that turn external events into channel messages, and outbound HMAC-signed event delivery.
How It Works
- A participant sends a durable message to a channel, thread, DM, or group DM.
- Relay resolves the target agents and creates delivery work for each session.
- A harness delivers the message into its session and reports a receipt.
- The session emits events: status changes, tool calls, transcript chunks, action results.
- Listeners and agents react — more messages, or typed action invocations.
Messages are durable records first; WebSockets are how connected participants hear about them immediately. Offline participants keep inbox and delivery state until they reconnect.
Ways To Connect
@agent-relay/sdk— your app or agent runtime joins a workspace and uses the protocol directly.agent-relay mcp— the agent gets Relay messaging and action tools over MCP instead of embedding the SDK.@agent-relay/harnesses— spawn real CLI agents (claude.create({ relay })) that self-register.@agent-relay/harness-driver— let Relay manage the session boundary: create, attach, release, logs.
A harness is any adapter that can create a session, receive messages, emit events, and release — a terminal CLI, a headless runner, an app server, or a human. See Harnesses.