Pi Durable tutorial: local models and crash recovery
Learn how Pi Durable stores agent checkpoints, then follow a llama.cpp demo with Qwen3.5-0.8B and SQLite restart recovery.
Player not loading? Watch on YouTube
Pi Durable is a TypeScript harness for building an always-on AI agent. The tutorial explains its place alongside Pi Coding Agent: developers build their own application around Durable, with their own interface and user handling. It uses Pi AI for model access.
The speaker contrasts ordinary coding-agent session history with persistent tasks and checkpoints. An interrupted email task illustrates why a record of a tool call may be insufficient to recover partially completed work. Durable can resume from stored state, but safe tool replay and restarting the host process remain application responsibilities.
The setup follows six steps: configure models, open a tools registry, initialize storage, open the harness, create or retrieve a conversation, and submit queries. SQLite and JSONL provide persistent storage; the memory option loses its state when the application closes. Developers explicitly supply conversation instructions and resources rather than relying on automatic loading from .pi or AGENTS.md.
For the local LLM demo, the presenter connects to llama.cpp running Qwen3.5-0.8B and asks the agent to read a phrase from a README. A second script resumes interrupted work from SQLite after a manual restart. The APIs are experimental and may change; the examples illustrate the harness rather than a complete application.