https://www.youtube.com/watch?v=BLRReTwV8Fc
TLDR Pi Durable is a JavaScript library for building long-running agents that save their state, recover from crashes, and resume safely without repeating risky actions. It works across platforms and model providers, lets agents decide their next steps, and can automate workflows like diagnosing bugs, fixing and testing code, and opening pull requests.
For agents that may run for hours or days, choose infrastructure that saves their state as they work. Pi Durable records conversation history, tool calls, pending approvals, and other progress, allowing a restarted process to resume where it left off. This reduces the need to rebuild fragile recovery logic yourself. It can run in JavaScript environments ranging from browsers to Node.js and supported cloud platforms.
A restarted agent may need to revisit a tool call, so define which tools are safe to run again. For actions with external effects—such as sending an email or creating a pull request—use safeguards to prevent duplicates or unintended repetition. Persist pending approvals so the agent can wait for authorization rather than silently proceeding. These practices help recovery avoid turning an interruption into a costly mistake.
A practical agent workflow can start from an event, such as a Sentry alert or webhook, then investigate the issue, propose a fix, run tests, and open a pull request. Add explicit checks so the agent does not act on untracked issues or create duplicate pull requests. Keep consequential changes subject to human review and merge approval. This makes automation useful while preserving control over production changes.
Durable agents can preserve a run’s full history so you can stop work and return later without losing context. You can inspect what the agent did, discuss its reasoning, and revise the fix from another client. This is especially useful when debugging takes longer than one session or requires collaboration. Shared access can also make it easier to fork work or delegate tasks to sub-agents.
Pi Durable can connect to models from OpenAI or local providers and run on JavaScript-capable systems, including platforms such as Cloudflare Durable Objects or Deno Cell. This flexibility helps avoid tying an agent system to a single model vendor or runtime. Choose hosting based on your needs for persistence, deployment, and data location. Test the setup in the environment where the agent will actually run.
Before writing a large custom agent harness, review Pi Durable’s examples for features such as restarting, tool overrides, compaction, and child tasks. Adapt a small example to one real workflow, then test interruptions and retries to verify that state is restored correctly. The speaker reports replacing roughly 8,000 lines of brittle custom code with Pi Durable, illustrating the potential to simplify maintenance. Use measured results from your own prototype to decide whether it fits your project.
Pi Durable is a JavaScript library for building agents that can keep working through crashes, interruptions, and long runtimes. It saves conversation history, tool calls, pending approvals, and other state so an agent can resume where it left off.
Tools can declare whether they are safe to run again. This lets a restarted agent resume without repeating unsafe actions, such as sending an email.
Rather than prescribing every step in a fixed workflow, Pi Durable lets the agent decide what to do next.
It runs wherever JavaScript runs, including browsers, Node.js systems, Android phones, and platforms such as Cloudflare Durable Objects or Deno’s Cell. It can connect to OpenAI models or local providers, helping avoid vendor lock-in.
A Sentry report triggers an agent to triage a bug, investigate its root cause, fix and test the code, and create a GitHub pull request. After the change is reviewed and merged, the agent marks the issue resolved in the internal system and Sentry.
The cart total tried to read a discount percentage from full-price items, where the discount value was undefined.
Agents can be accessed and steered from different clients, and the example setup prevents the agent from handling untracked issues or creating duplicate pull requests. A run can also be stopped and resumed with its full history available for discussion or revision.
The speaker recommends exploring Pi Durable’s examples, which demonstrate features such as restarting, tool overrides, compaction, and child tasks, and says durable agents are worth investigating for anyone building agents.