Skip to content

Durable Streams

Persistent, addressable, real-time streams. For resilient AI sessions and ultra low-latency.

What are Durable Streams?

Durable Streams provide reliable, resumable data streams for applications that need to survive network interruptions. They're designed for AI agents, collaborative applications, and any system that requires resilient real-time data flow.

Key features:

  • Resumable connections — automatically resume from the last known position after disconnection
  • Durable state — maintain session state across reconnections
  • AI SDK adapters — drop-in transport adapters for popular AI frameworks

Use cases

Durable Streams are ideal for:

  • AI agents that need to maintain context across network interruptions
  • Collaborative applications with multiple users and agents
  • Real-time dashboards that must not lose data
  • Multi-step agentic workflows that span long time periods

How it works

Durable Streams work alongside Postgres Sync and TanStack DB to provide a complete sync solution. While Postgres Sync handles structured data, Durable Streams handle event streams, AI responses, and session state.

Postgres Sync ────────────┐
(structured data)         │
                          ├───→ TanStack DB
Durable Streams ──────────┘     (reactive client DB)
(streams, AI, sessions)

Wrapper protocols

Durable Streams support multiple wrapper protocols for different use cases:

  • Binary streams — efficient binary encoding for high-throughput data
  • JSON mode — human-readable JSON for debugging and interoperability
  • Proxy — transparent proxy mode for existing SSE endpoints
  • Durable state — persisted session state with automatic recovery
  • TanStack AI — integration with TanStack Query for AI responses
  • Vercel AI SDK — drop-in transport adapter for Vercel AI SDK
  • Yjs — CRDT-based collaborative editing with Yjs

More information

See how you can combine Durable Streams with other Electric products to build resilient, collaborative AI apps.