Durable Sessions vs Flue Framework: Which Should You Use?
// TL;DR
These solve different problems — use both if needed. Choose the Christensen Durable Sessions framework when your AI chat product suffers from disconnections, lacks multi-device continuity, or needs live agent control (stop buttons, steering). Choose the Flue Harness-First Agent Framework when you need to build and deploy AI agents or automated workflows quickly in TypeScript with sandboxing, skills, and tools. Durable Sessions is an architecture pattern for the delivery layer; Flue is a development framework for the agent layer. They are complementary, not competing.
// HOW DO THEY COMPARE?
| Dimension | Christensen Durable Sessions AI UX Framework | Flue Harness-First AI Agent Framework |
|---|---|---|
| Best for | Fixing broken AI streaming UX — disconnections, multi-device sync, live control | Building and deploying AI agents/workflows fast in TypeScript with sandboxing and tools |
| Problem domain | Real-time delivery and connectivity layer between agents and clients | Agent construction, tool orchestration, and deployment |
| Complexity | High — requires rearchitecting your streaming infrastructure and transport layer | Low to medium — harness-first design eliminates manual wiring; CLI-driven setup |
| Time to apply | Days to weeks — involves auditing existing architecture, introducing a pub/sub session layer, and migrating transports | Hours to days — install runtime and CLI, run `flue init`, define agent, deploy |
| Prerequisites | Existing AI chat or agent product with streaming; understanding of SSE, WebSockets, pub/sub | Node.js or Cloudflare Workers environment; TypeScript knowledge; LLM provider API key |
| Output type | Architecture redesign — a resilient, multi-surface, controllable session layer | Deployable AI agent or workflow — a single server.mjs file or Cloudflare Worker |
| Multi-agent support | Strong — sub-agents write directly to shared sessions, eliminating orchestrator relay bottleneck | Supported via unique instance IDs and Durable Objects, but focused on single-agent harness |
| Transport layer | Prescribes replacing SSE with bidirectional transport (WebSockets) for live control | Supports both HTTP and WebSocket triggering; transport is a deployment concern, not core focus |
| Creator background | Mike Christensen (Ably) — real-time infrastructure specialist | Fred K. Schott / Better Stack — developer tooling and open-source frameworks |
| Framework dependency | Architecture pattern — vendor-agnostic, implementable with any pub/sub system | Specific framework — depends on Flue runtime, CLI, and Pico agent core |
What does the Christensen Durable Sessions AI UX Framework do?
The Durable Sessions framework, introduced by Mike Christensen of Ably, diagnoses and fixes a pervasive problem in AI chat products: the streaming delivery layer breaks under real-world conditions. Most AI products use direct HTTP streaming (typically SSE via the Vercel AI SDK or similar), which couples the health of the AI response to a single client connection. If the user's network drops, switches tabs, or opens the conversation on another device, the stream is lost.
The framework identifies three foundational capabilities that separate a fragile demo from a production-quality AI UX: Resilient Delivery (streams survive disconnections), Continuity Across Surfaces (sessions follow users across tabs and devices), and Live Control (clients can steer, interrupt, or cancel an agent mid-generation). It then prescribes an architectural pattern called a Durable Session — a persistent, shared pub/sub channel between agents and clients — that unlocks all three capabilities simultaneously. The agent writes events to the session; clients subscribe to the session. Neither holds a direct connection to the other.
This framework is especially powerful for multi-agent architectures. It eliminates the orchestrator relay bottleneck by letting each sub-agent write directly to the shared session, so clients see granular progress from all agents without the orchestrator proxying updates.
What does the Flue Harness-First AI Agent Framework do?
Flue is a TypeScript framework for building and deploying AI agents and automated workflows. Its core philosophy is "harness-first": instead of manually wiring sessions, memory, tool loading, and sandboxing, Flue provides all of that infrastructure out of the box. You define an agent with a model and instructions in a few lines of TypeScript, register skills (file-based, described via `skill.md`) or tools (code-defined with Valibot validation), and deploy.
Flue distinguishes between two primitives: Agents (interactive, human-in-the-loop) and Workflows (fully autonomous, triggered programmatically). Every agent runs in an in-memory sandbox powered by just-bash — a TypeScript reimplementation of bash — so you can run thousands of agents at near-zero cost without container overhead. You only opt into a real container when you need full OS capabilities.
Deployment targets include Node.js (producing a single `server.mjs` file) and Cloudflare Workers with Durable Objects for persistent state per agent instance. The CLI handles init, build, connect, and run commands, making the developer experience fast and opinionated.
How do they compare?
These two frameworks operate at completely different layers of the AI product stack and solve fundamentally different problems.
Durable Sessions operates at the delivery layer. It answers: "How do AI-generated events reliably reach the user across connections, devices, and interruptions?" It does not care how your agent is built, what model you use, or how tools are loaded. It cares about what happens after the agent produces output.
Flue operates at the agent construction layer. It answers: "How do I build, configure, and deploy an AI agent with tools, skills, and sandboxing as quickly as possible?" It does not prescribe how streaming events reach the end user's browser or handle multi-device synchronization.
This means they are complementary, not competing. A Flue-built agent could write its output to a Durable Sessions layer instead of directly to an HTTP response. In fact, the Durable Sessions framework explicitly calls out that agent code should never hold a reference to a specific client connection — an architectural inversion that Flue's harness could adopt.
Where they do overlap is in their awareness of WebSockets: Durable Sessions requires bidirectional transport for live control, and Flue supports WebSocket triggering for streaming workflow results. But Durable Sessions goes much deeper on the transport and session resilience problem, while Flue treats transport as a deployment detail.
For multi-agent scenarios, Durable Sessions is clearly stronger. Its pub/sub model lets any number of agents write to a shared session, solving the orchestrator relay problem. Flue focuses on individual agent harnesses and doesn't address cross-agent delivery coordination.
Which should you choose?
Choose Durable Sessions if you already have an AI product with a chat or streaming interface and users are experiencing broken streams, lost context on reconnect, no multi-device sync, or ambiguous stop-button behavior. This is an architecture-level fix that requires rethinking your delivery infrastructure, but it solves problems no amount of agent-level engineering can address.
Choose Flue if you are starting a new AI agent or workflow project and want to go from zero to deployed agent as fast as possible in TypeScript, with sandboxing, skills, and tools handled for you. Flue is the right choice when your bottleneck is agent construction, not delivery resilience.
Choose both if you are building a production AI product that needs both a well-structured agent layer and a resilient, multi-surface delivery layer. Use Flue to build your agents and workflows; use the Durable Sessions pattern to ensure those agents' output reaches users reliably across all conditions. This combination covers the full stack from agent logic to end-user experience.
// FREQUENTLY ASKED QUESTIONS
Can I use Durable Sessions with Flue together?
Yes, and it's a strong combination. Flue handles agent construction, tool orchestration, and deployment. Durable Sessions handles how the agent's output is delivered to users across connections and devices. You would configure your Flue agent to write events to a Durable Sessions pub/sub channel instead of directly to the HTTP response. They solve different layers of the stack.
Do I need Durable Sessions if my AI app is just a simple chatbot?
If your chatbot runs on mobile or unreliable networks, yes. Even simple chatbots suffer from the Single-Connection Trap — a network drop mid-response kills the stream. Durable Sessions ensures the user can reconnect and resume. If your chatbot is desktop-only on stable networks and doesn't need a stop button, you may not need it yet.
Is Flue only for TypeScript developers?
Yes. Flue's runtime, CLI, and configuration are all TypeScript-based. Agents and workflows are written in TypeScript. Tools can wrap external scripts (e.g., Python), but the framework itself requires TypeScript proficiency. If you work in Python, frameworks like LangGraph or CrewAI are closer alternatives.
Does Flue handle multi-device session continuity?
Not directly. Flue provides instance IDs and Durable Objects for per-agent persistent state, but it doesn't solve the problem of multiple client devices subscribing to the same live agent session. That's precisely the problem Durable Sessions addresses. You would need to add a session delivery layer on top of Flue for true multi-surface continuity.
What is the biggest mistake when implementing Durable Sessions?
Building resume logic inside the agent itself. The entire point of Durable Sessions is that the session layer handles replay and reconnection, not the agent. If your agent code manages per-client replay buffers or connection state, you've defeated the purpose and created complexity that scales poorly.
Can Flue agents run without a container or cloud service?
Yes. Flue's default sandbox is just-bash, an in-memory TypeScript reimplementation of bash. It requires no container and runs locally or on any Node.js host. You only need a real container (Daytona, Cloudflare sandbox) when your agent requires full OS-level capabilities like installing packages.
Is Durable Sessions tied to Ably's products?
The framework is an architecture pattern, not a product. Mike Christensen presented it at AI Engineer as a general design principle. You can implement Durable Sessions with any pub/sub infrastructure — Ably, Redis Streams, NATS, or custom WebSocket servers. The pattern is vendor-agnostic, though Ably's platform is a natural fit.
Which framework is harder to implement?
Durable Sessions is significantly harder. It requires rearchitecting your streaming infrastructure, potentially replacing SSE with WebSockets, and introducing a pub/sub session layer. This is a days-to-weeks effort. Flue is designed for fast setup — install, init, define agent, deploy — achievable in hours. The difficulty difference reflects their different scopes: infrastructure redesign vs. agent construction.