Agent Link

Custom integration. Agent Link is not a public, self-serve feature yet. Mirako sets it up with you directly. If your deployment cannot accept inbound connections and this shape fits, contact the Mirako team to talk it through.

A custom agent normally exposes an HTTPS endpoint and Mirako calls it once per turn. Agent Link turns that around. Your adapter dials Mirako, holds one WebSocket open, and Mirako sends each turn down that connection. Your agent answers on the same socket. Your side runs no listener and opens no inbound ports, which suits deployments where only outbound connections are allowed.

Your adapter ─── dials and holds a WebSocket ───▶ Mirako Interactive
                                                      │
Visitor speaks ──▶ Mirako sends a turn frame ─────────┤
                                                      ▼
Avatar speaks  ◀── your agent streams reply frames back

The protocol underneath

Agent Link reuses the Vercel AI SDK's WebSocketChatTransport protocol, the WebSocket sibling of the UI message stream a custom agent already returns over HTTP. The roles run in reverse: your adapter holds the client side of the socket and Mirako sends the request frames.

  • One send frame per turn carries the session id, the new user message, and the turn metadata, in the same shape as the HTTP request body.
  • Your agent replies with chunk frames carrying the same AI SDK UI message stream parts as the HTTP route: streamed text, data-image, data-video, and data-webapp visuals, and the farewell plus data-end-interaction ending. Sequence numbers keep the frames of one turn in order, and an end frame closes the turn.
  • An abort frame cancels a turn, for example when the visitor speaks over the agent. A turn that cannot start comes back as an error frame; a turn that fails partway through reports an error part in its stream, as on the HTTP route.
  • Authentication happens once, at the WebSocket handshake, with a link token Mirako provisions for the integration.

A turn means the same thing on both transports. Mirako sends one new message per turn, your agent keeps its conversation history keyed by session, the synthetic greeting turn arrives first, and end-user metadata rides in metadata on every turn. Everything on the custom agent page about turns, visuals, greetings, and endings applies; only the container changes.

Reconnects and resends

A held socket eventually drops. When it does, a turn in flight ends unfinished on both sides. After your adapter reconnects, Mirako may resend that turn as a fresh frame with a new request id and the same message id, but only when no part of the reply reached Mirako. Your agent treats a repeated message id as the same turn again: it answers, without adding the message to its history twice and without repeating actions, such as a booking or a payment, that the first attempt already completed. Mirako never asks an adapter to replay a stream.

Who this is for

Talk to us about Agent Link if your agent runs somewhere Mirako cannot call into: a private network with outbound-only access, a customer environment with strict inbound rules, or an existing system that already holds outbound connections to your other services. Setup, link provisioning, and networking are worked out per integration today.

Going Next

Dive Deeper