Pi Durable agent resumes after redeploying itself with SQLite memory
Raunak demonstrates a Pi Durable agent that resumes after redeploying itself. Its Durable Object setup stores memory and chat history in SQLite, preserving both across deployments.

TL;DR
- An agent resumes after editing and redeploying its own code, according to raunakdoesdev.
- Memory and chat history share a SQLite-backed layer, as the builder explained in one reply and a follow-up.
- File reads and edits run through code mode, where the agent produces creative editing strategies beyond standard edit calls.
- A separate phone-hosted app adds multiplayer, live edits and artifacts, demonstrated in the Android demo.
Pi Durable retains cut-off model responses as aborted transcript entries in its official recovery examples. Victor Taelin, author of OptMem, built a manager agent whose only tool is spawn; a phone-hosted Pi experiment applies server updates by killing and respawning its workers.
Self-redeployment
Raunak says his Durable Object-hosted agent can modify its own code, redeploy itself and resume durably. Self-redeployment is a satisfyingly literal test of an agent harness.
His central agent session orchestrates his other agents. Model calls for this project went through OpenRouter.
SQLite memory
The memory layer also serves as chat history, he explained. SQLite preserves that state across deployments.
Pi Durable's SQLite backend keeps only its working set in memory:
- Active transcripts.
- Live tasks.
- Pending submissions.
Other data stays on disk until needed. Compaction bounds active transcripts by the model's context window.
Checkpoints and replay
Mario Zechner, Pi's creator, shared code examples for the experimental package released alongside Pi 1.0 on October 1.
Each task saves a checkpoint before advancing. A new process opens the same storage, finds unfinished tasks and follows the documented recovery rules:
- Interrupted model request: resend it; retain the partial response marked aborted.
- Replay-safe tool: rerun it after recovery.
- Other tool: report the interruption and saved output to the model, without automatically repeating the call.
- Retried submission: use
requestIdto return the original submission instead of submitting twice. - Subagent: resume its own conversation; a replay-safe parent tool can find the existing child and wait for its answer.
The official deployment-tool example deliberately omits replay permission. An interrupted deployment is reported to the model, never automatically repeated.
Cloudflare's PiHarness integration stores sessions in Durable Object SQLite and wakes them after eviction. The integration is beta.
Code mode
Raunak pairs code mode with Rhys Sullivan's executor and routes even file reads and edits through code. He also expresses uncertainty about a persistent REPL.
He praised the agent's editing strategies for finding creative ways to change files beyond ordinary edit calls.
Hot reload
Zechner's phone-hosted agent edits the application it runs in, with two reload paths:
- Web UI: hot module replacement.
- Server and session workers: kill and respawn; Pi Durable handles recovery.
Server-code changes also broke the live demo during the experiment.
Android execution
Zechner built his personal phone demo directly on Android, including subagents. He explicitly described it as an experiment, not an official Earendil product.
The first Pi Durable phone experiment
His argument for phone-hosted agents puts four components on the handset:
- Agent loop.
- Files.
- Service connections.
- Execution environment.
On-device LLM inference appears in that proposal as an eventual goal.
By day two, he reported a native Android app that no longer needed Termux. He was also adding a remote Hetzner execution environment accessible from the phone.
Multiplayer and artifacts
- Other people can join a session, with optional co-steering.
- Zechner added artifacts to the phone-hosted app.
- Live editing and provider/model selection work in the same application.
Slack and iMessage
Raunak also announced an open-source headless Slack client that streams live Slack state to a Cloudflare Durable Object so agents can triage unread messages.