AI Transport
AI Transport helps you build AI applications that are resilient, resumable, multi-user and multi-device. Stream agent output over Ably channels, and keep the conversation in your own store or read it back from the channel.
AI Transport helps you build AI applications that are resilient, resumable, multi-user and multi-device. Agents and clients attach to an Ably channel that outlives any single connection, so the conversation survives a network drop and reaches all of the user's devices.
Streaming delivers your agent's responses to every subscribed client, in realtime. A client that disconnects reconnects and receives what it missed, and a client that reloads replays the channel from the point your own store reached. You own the message format between the agent and the client, and you choose whether the conversation history lives in your own database or is read back from the channel.
The AI Transport SDKs and the Ably channel provide the message delivery infrastructure. Your model provider, prompts, orchestration, and hosting remain the same. AI Transport ships codecs for the Vercel AI SDK, the OpenAI Responses API and AG-UI. For a provider with no bundled codec, you write a custom codec.
What streaming fixes
Most AI frameworks send one HTTP request per turn and return the model's output on that request's response body. This ties the response to the HTTP request, so other clients do not receive the response, and if the HTTP connection drops then the response is lost.
| Scenario | Direct HTTP streaming | With AI Transport |
|---|---|---|
| The connection drops mid-response | The response is lost, the model keeps producing output that is discarded, and the user sees an error and starts again. | The agent keeps publishing to the channel. The client reconnects and resumes from where it left off. |
| The user opens the conversation on a second device | The response belongs to the device that opened the request, so a second device cannot read it. | Every device subscribes to the same channel and reads the response as it streams. |
| The user reloads the page mid-response | The reload discards the request and the partial response with it. | The client loads the conversation from your store and replays the channel from there, so it receives the in-flight response, a single message that grows as the model produces it, and then the rest live. |
| The user presses stop | Closing the connection is the only signal available, and the agent cannot tell it apart from a network drop. | The client cancels its request to the agent, which stops the agent's pipe, and every subscribed client receives the end of the response. The channel stays open. |
| A second message arrives before the first response finishes | A second request opens a second stream, and the client interleaves two responses or drops one. | Each prompt and its response carry their own requestId header on the same channel, so every client keeps the two responses apart. |
| The agent process restarts mid-response | The outbound stream ends with the process, and the client is left displaying a truncated response. | With durable execution, the workflow engine retries the agent's work, and the retry publishes to the same channel. |
To solve these yourself, you need a buffer so a stream can resume, a store for conversation state, and a queue or a second WebSocket for the client to signal on. HTTP streaming and AI goes through each limitation and the workaround code it requires.
How AI Transport is built
The Ably channel
Every conversation is one Ably channel: a durable, append-only log that any client or agent attaches to by name. Messages outlive the connection, device, or process that published them, and they are stored in order for the period configured by your retention window. A client that drops can resubscribe and read the rest of the conversation without gaps or duplicate messages. Message order is guaranteed from a single publisher to a single region, and message ordering covers what order means when publishing in different regions.
AI Transport operates on a standard Ably channel, so you can make use of other Ably channel features. Agent presence can be used to report if an agent is thinking, streaming, idle, or offline, and lets an agent stop work when no client is connected to read the response. LiveObjects state gives the client and the agent one shared store to read and write. Push notifications reach a user whose client is not connected.
The streaming layer
Streaming delivers the agent's output to every subscribed client. The agent and the client each create a transport for the conversation's channel. The agent pipes the model's output to it, and the client sends the user's messages and subscribes to everything on the channel. A codec maps your framework's event types onto channel messages, and the model's output streams by appending to a single message, so a client that subscribes late reads the response so far in one delivery instead of each token individually. A client that holds part of the conversation subscribes with a history replay, and receives the rest in channel order before live messages.
Keep the stack you have
In the agent, you pipe the stream you already build to the channel rather than returning it as the HTTP response body. Prompts, tool definitions, model calls, and rendering are untouched.
Streaming shows a client and an agent in full.
Limits and dependencies
These apply to every application built on AI Transport:
| Limit or dependency | Detail |
|---|---|
| Your retention period bounds what the channel holds | The channel holds the conversation for the retention period you set per channel rule, so the channel is always the live-recovery window. Keep your own store of completed responses for history beyond that period, and database hydration joins the stored history to the live conversation. |
| Channel content is visible to subscribed clients | Every message reaches every subscribed client whose token capability allows it, tool inputs and outputs included. Scope capabilities to channel name prefixes so a token only grants access to the conversations that client should read. |
| A network hop and a third-party dependency | Conversations go through Ably rather than your own infrastructure, so every publish makes a round trip. Append rollup batches the model's output, so that round trip happens once per batch. |
Going to production covers limits, retention windows, monitoring, auth hardening, and pricing.
Platform guarantees
Ordering, persistence, replication, and regional failover are guarantees of the Ably platform, which is designed for 99.999% global service availability, delivers at low latency across regions, and scales elastically. They apply to AI Transport in the same way as to every other Ably product.
Ably is SOC 2 Type II certified and HIPAA compliant, and operates a bug bounty program.
Pick where to start
Streaming
Stream your agent's responses to every subscribed client, and replay what a client missed.
Durable execution
Keep an agent turn safe across a process restart, alongside streaming.
Going to production
The checklist to work through before you ship.
Read next
- HTTP streaming and AI: each limitation of direct HTTP streaming, and the workaround code it requires.
- Get started with streaming: a working chat app whose conversation stays in your own store.