![]()
Durable Streams are the data primitive for the agent loop.
Persistent, addressable, real‑time streams for building resilient agent sessions and collaborative multi-user, multi-agent systems.
Durable Streams are a flexible data primitive for resilient, collaborative AI apps and agentic systems.
The Durable Streams protocol provides a simple, production-proven protocol for creating and consuming ordered, replayable data streams over HTTP, with support for catch-up reads and live tailing.
Use it to stream data reliably to web browsers, mobile apps, and native clients with low-latency, high-scalability, offset-based resumability and exactly-once message delivery over public Internet.
[!TIP] Read the Announcing Durable Streams and Durable Sessions - the key pattern for collaborative AI posts on the Electric blog.
Modern applications frequently need ordered, durable sequences of data that can be replayed from arbitrary points and tailed in real time. Common patterns include:
While durable streams exist throughout backend infrastructure (database WALs, Kafka topics, event stores), they aren't available as a first-class primitive for client applications. There's no simple, HTTP-based durable stream that sits alongside databases and object storage as a standard cloud primitive.
WebSocket and SSE connections are easy to start, but they're fragile in practice: tabs get suspended, networks flap, devices switch, pages refresh. When that happens, you either lose in-flight data or build a bespoke backend storage and client resume protocol on top.
AI products make this painfully visible. Token streaming is the UI for chat and copilots, and agentic apps stream progress events, tool outputs, and partial results over long-running sessions. When the stream fails, the product fails—even if the model did the right thing.
Durable Streams addresses this gap. It's a minimal HTTP-based protocol for durable, offset-based streaming designed for client applications across all platforms: web browsers, mobile apps, native clients, IoT devices, and edge workers. Based on 1.5 years of production use at Electric for real-time Postgres sync, reliably delivering millions of state changes every day.
What you get:
The protocol is:
| Package | Language | Description |
|---|---|---|
| @durable-streams/client | TypeScript | Reference client with full read/write support |
| client-py | Python | Python client library |
| client-go | Go | Go client library |
| client-elixir | Elixir | Elixir client library |
| client-dotnet | C#/.NET | .NET client library |
| client-swift | Swift | Swift client library |
| client-php | PHP | PHP client library |
| client-java | Java | Java client library |
| client-rust | Rust | Rust client library |
| client-rb | Ruby | Ruby client library |
| Package | Description |
|---|---|
| @durable-streams/server | Node.js reference server (development/testing) |
| caddy-plugin | Production Caddy server plugin |
| @durable-streams/cli | Command-line tool |
| @durable-streams/state | State Protocol (insert/update/delete over streams) |
| Package | Description |
|---|---|
| @durable-streams/server-conformance-tests | Server protocol compliance tests |
| @durable-streams/client-conformance-tests | Client protocol compliance tests |
| @durable-streams/benchmarks | Performance benchmarking suite |
We welcome contributions! This project follows the Contributor Covenant code of conduct.
# Clone and install
git clone https://github.com/durable-streams/durable-streams.git
cd durable-streams
pnpm install
# Build all packages
pnpm build
# Run all conformance tests
pnpm test:run
# Lint and format
pnpm lint:fix
pnpm format
We use changesets for version management. Run pnpm changeset to add a changeset before submitting a PR.
MIT -- see LICENSE
$ claude mcp add durable-streams \
-- python -m otcore.mcp_server <graph>