AI Transport

4 min read Original article ↗

AI Transport is a durable session layer for AI applications. Your agent publishes its response into a durable session on Ably.

AI Transport helps you build AI applications that are resilient, resumable, mutli-user and multi-device. Agents and clients connect to a durable session on Ably, which outlives the connection that started it. This allows for multi-device access, and automatic reconnection, resume, and recovery from network drops.

AI Transport is the delivery infrastructure. You keep your model provider, whether that is OpenAI, Anthropic, Google, or a model you host, and your prompts, orchestration, and hosting stay where they are. AI Transport ships a drop-in transport for the Vercel AI SDK and a codec for the OpenAI Responses API. The Core SDK composes with other frameworks, including Vercel WDK and Temporal.

Two-panel architecture diagram. On the left, traditional HTTP streaming: one device sends a prompt and reads the streamed response back over the same request. On the right, with AI Transport: the response is returned as a conversation id, and multiple devices subscribe to the AI Transport session the agent publishes into

What you gain over HTTP streaming

Most AI frameworks send one HTTP request per turn and stream the AI model's response back over the HTTP response. This ties the AI model's response to the HTTP request, other clients cannot read the response, and if the HTTP connection drops the response is lost.

A dropped connection loses a response whether the application has one user or a million.

Solving these individually means building a buffer so a stream can resume, a database for conversation state, and a queue or a second WebSocket for the client to signal on. It also means a reconciliation step that merges stored state with the live stream whenever a client joins. None of it is specific to the AI product, and HTTP streaming and AI goes through each limitation and the workaround code it requires.

What the session adds beyond delivery

A session runs on an Ably channel, with a conversation model on top of it. The rest of Ably's channel features work on that channel, and the SDK builds a conversation tree from its message log, which is what makes branching and editing possible.

Each of the following is part of the session:

Each of these needs a second transport alongside the stream if you build it on direct HTTP streaming.

Keep the stack you have

In the agent, pipe the stream you already build into a run on the session instead of returning it as the HTTP response body:

The route returns the run's identifiers. The client reads the answer from the session. Where an answer takes longer than your function's timeout, durable execution moves the run into a workflow engine and the route returns before it finishes.

In the browser, a client attaches to that same session by name:

Prompts, tool definitions, model calls, and rendering are untouched. AI Transport implements Vercel AI SDK's ChatTransport interface, so useChat accepts it as its transport.

Two one-time setup steps apply. Browser clients connect with token authentication rather than an API key, and the namespace your conversations live on needs one channel rule enabled, because AI Transport streams tokens by appending to a message.

The SDK is JavaScript and TypeScript, with React hooks for the client. The roadmap covers other languages.

Limits and dependencies

These apply to every application built on AI Transport:

Going to production covers limits, retention, monitoring, auth hardening, and pricing.

How a session is built

Every session is backed by an Ably channel: a durable, ordered, append-only log that any client or agent attaches to by name. Messages outlive the connection, device, or process that published them, and they have a total order. A client that drops reattaches and resumes without gaps or duplicates.

Any client or agent publishes, which puts cancel and steering on the same path as tokens. The SDK layers a conversation on top of that log:

When you do not need a durable session

A single-turn chatbot does not need a durable session. If a user asks one question and never returns to the conversation, direct HTTP streaming is enough.

Platform guarantees

Ordering, persistence, replication, and regional failover are guarantees of the Ably platform, which is designed for 99.999% global service availability. 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.

Start building

Choose where to go next: