durable-streams/durable-streams

The data primitive for the agent loop.

What it solves

It addresses the fragility of real-time data streaming in client applications. Standard connections like WebSockets or SSE often fail during page refreshes, network flaps, or device switches, leading to lost data or the need for complex custom resume protocols. This is particularly problematic for AI applications where token streaming and agent progress events are critical to the user experience.

How it works

Durable Streams provides a minimal, HTTP-based protocol for creating ordered, replayable data streams. It uses offset-based reads, allowing clients to resume from any specific point in the stream. It supports both long-poll and SSE modes for live tailing and is designed to be CDN-friendly to allow massive fan-out to millions of concurrent viewers without overloading the origin server.

Who it’s for

Developers building collaborative AI apps, agentic systems, real-time database synchronization tools, collaborative editors (using CRDTs), and any application requiring resilient, multi-device state synchronization over the public internet.

Highlights

  • Refresh-safe: Users can pick up exactly where they left off after a refresh or app backgrounding.
  • Resumable: Offset-based reads ensure no data is lost during reconnections.
  • Universal: Works across web browsers, mobile apps, native clients, and edge workers via standard HTTP.
  • Multi-device Sync: Allows a single stream to be viewed across multiple devices or tabs in real-time.
  • Broad Language Support: Provides client libraries for TypeScript, Python, Go, Elixir, .NET, Swift, PHP, Java, Rust, and Ruby.