Pi Durable is a lightweight, malleable harness for building long-running, durable agentic applications that complements Pi the coding agent rather than replacing it. It bundles storage backends (memory, SQLite, JSONL) with a small, portable storage interface that can run across JavaScript runtimes (Node, Bun, Cloudflare Durable Objects) and execution environments (Node local files or remote VMs). The codebase is intentionally compact - about 15,000 lines - and keeps only the active working set in memory: active transcripts, live tasks, and pending submissions, while compacting older messages so conversations with tens of thousands of messages remain bounded by model context windows.
Durability and concurrency are core: every step is a checkpointed task so runs survive crashes, restarts, and migrations; a requestId ensures submissions are exactly-once. One harness runs many concurrent conversations and forks (think a Slack channel and threads), each with its own agent configuration and working directory. Extensible bundles provide system prompt sections, tools, hooks and durable tasks; prompt sections are rebuilt per request and recorded in transcripts so restarts/forks see the same view. Tools declare replay semantics (safe to rerun or not), enabling safe automatic retries for read-only actions and explicit handling for side-effectful operations like deploys.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.