Ably AI Transport x Vercel AI SDK

Every dropped connection, device switch, or handoff breaks the AI experience.

Vercel AI SDK handles the interface. AI Transport handles the session. Drop it into your existing Next.js app - no rewrites, no new infrastructure - and your sessions survive everything your users throw at them.

Better Together

What Vercel AI SDK was built to do - and where AI Transport steps in

HTTP streaming is the right default for most early builds. But as session requirements grow, the stateless model starts to fail. The ChatTransport interface exists for exactly this moment: swap the transport layer to Ably AI Transport without touching your application code.

Capability
useChat hooksVercel + HTTP streaming

Yes

  • Unchanged
Vercel + Ably AI Transport

Yes

  • Unchanged
streamText callsVercel + HTTP streaming

Yes

  • Unchanged
Vercel + Ably AI Transport

Yes

  • Unchanged
Tool callingVercel + HTTP streaming

Yes

  • Unchanged
Vercel + Ably AI Transport

Yes

  • Unchanged
Streaming protocolVercel + HTTP streaming

SSE over HTTP

Vercel + Ably AI Transport

Yes

  • WebSocket > SSE > long-poll fallback
Enterprise proxiesVercel + HTTP streaming

No

  • SSE blocked by corporate proxies
Vercel + Ably AI Transport

Yes

  • Automatic fallback - works everywhere
Tab switch/reconnectVercel + HTTP streaming

No

  • Stream lost
Vercel + Ably AI Transport

Yes

  • Automatic recovery - zero data loss
Retry behaviorVercel + HTTP streaming

No

  • Replays from start, corrupts UI
Vercel + Ably AI Transport

Yes

  • Idempotent - clean UI every time
Multi-deviceVercel + HTTP streaming

No

  • One connection, one tab
Vercel + Ably AI Transport

Yes

  • Pub/sub fan-out to all devices
Mobile / React nativeVercel + HTTP streaming

No

  • SSE breaks in background
Vercel + Ably AI Transport

Yes

  • Native SDK + push when offline
Message persistenceVercel + HTTP streaming

No

  • Developer-managed
Vercel + Ably AI Transport

Yes

  • Session history built in
Barge-in/cancelVercel + HTTP streaming

No

  • AbortController only
Vercel + Ably AI Transport

Yes

  • Explicit cancel, redirect, steer signals
Agent healthVercel + HTTP streaming

No

  • No signal - agents fail silently
Vercel + Ably AI Transport

Yes

  • Presence events - thinking/stalled/crashed
Human takeover from agent Vercel + HTTP streaming

No

  • User-side gates only
Vercel + Ably AI Transport

Yes

  • Warm & cold transfer - context intact
ObservabilityVercel + HTTP streaming

No

  • No session diagnostics
Vercel + Ably AI Transport

Yes

  • Session diagnostics + audit trail
CertificationsVercel + HTTP streaming

Vercel platform - varies by plan

Vercel + Ably AI Transport

Yes

  • SOC 2 Type II + HIPAA compliance

AI UX Capabilities

The session layer your AI app needs in production

Add Ably AI Transport to your Vercel AI SDK stack and these capabilities become available in production across every device, connection type, and session length.

Multi-device sessions

Multi-device sessions

useChat() ties the conversation to the tab. AI Transport makes it follow the user instead — same session, any device, instantly.

Reconnection and recovery

Reconnection and recovery

SSE drops the stream when the connection breaks. AI Transport resumes from the exact token, with nothing lost.

Interruption and barge-in

Interruption and barge-in

streamText() locks input until it's done. AI Transport gives users the controls: redirect mid-stream, context intact, no restart.

Agent presence and visibility

Agent presence and visibility

Tool calls run server-side, out of sight. AI Transport makes every step visible - streamed to the client as it happens.

Multi-agent coordination

Multi-agent coordination

streamText() has no concept of other agents. AI Transport adds the coordination layer — agents see each other's presence, handoffs carry full context, and no two agents step on the same response.

Human handover

Human handover

The agent's context lives in the stream. AI Transport makes it persistent. The operator joins with full history, mid-stream if needed. No cold start.

Integration

Three lines. That's the integration.

Vercel AI SDK's ChatTransport interface was designed for exactly this. AI Transport implements it. Swap the transport, the rest of your application code stays the same.

JavaScript

1

2

3

4

5

6

7

// Before: default HTTP transport
const { messages } = useChat()

// After: Ably transport (everything else stays the same)
const transport = useClientTransport({ channelName: chatId })
const chatTransport = useChatTransport(transport)
const { messages } = useChat({ transport: chatTransport })

Architecture

Where Ably sits in your stack

Two layers. One stack. No overlap.
  • Vercel AI SDK: implements ChatTransport directly. One line to wire up
  • LLM-agnostic: OpenAI, Anthropic, Google, local models
  • Also works with: LangGraph, ag-ui
  • Languages: TypeScript, JavaScript, React
  • Future-proof: Switch models without touching your UX layer
  • Drop-in: Works alongside your existing Vercel APIs and tools
Where Ably sits in your stack image
Trusted by brands serious about realtime
View customer stories

Ably makes realtime just work. When we needed to get Breeze (our AI assistant) working in production, Ably was an obvious choice for us. It's reliable, efficient and our collaboration with the Ably team helps the engineering team build that much faster.

Whitney Sorenson

Chief Architect, HubSpot Next

Performance

Performance isn’t an aspiration. It’s engineered into every layer of our platform, from protocol optimizations to global edge acceleration.

<6.5ms

message delivery latency

30B+

connections opened monthly

Integrity

Ably guarantees data integrity, so you don’t have to reinvent resilience in your own code. Your data arrives exactly how and when it should.

5+ years

since last outage

99.999999%

message survivability

Reliability

Service interruptions cost money and trust. That’s why Ably is fault-tolerant at every level - regionally and globally.


2B+

connected devices per month

2T+

API operations per month

Availability

Ably elastically scales with demand. Our platform is globally distributed and designed to maintain high availability under peak loads.

700+

points of presence

11

globally distributed regions

Start building with Ably today

Light style