AI product Open source

PiDurableKit

PiDurableKit is a Swift package for running durable AI agents on iPhone, iPad, Mac, and Vision Pro. It embeds the pi-durable, pi-ai, and chord JavaScript libraries in JavaScriptCore and exposes them through a native Swift concurrency API. Conversations, model turns, tool calls, tasks, and application state are committed to persistent storage before being exposed to the app, allowing unfinished work to resume after a crash or an iOS process termination.

View repository Mentioned in 1 video ↓

Overview

The package supports SQLite, JSONL, or in-memory storage; Swift and JavaScript extensions; tools, hooks, prompt sections, subagents, durable checkpointed tasks, transactions, typed documents and entries, streaming conversation views, and coding tools in a sandboxed directory. It supports pi-ai providers including Anthropic, OpenAI, Google, OpenRouter, Groq, xAI, and Mistral, as well as compatible servers and OAuth sign-in with credentials stored in the Keychain.

It requires iOS 17, macOS 14, tvOS 17, or visionOS 1. PiDurableKit's own code is dedicated to the public domain under CC0 1.0; its bundled dependencies use the licenses listed by the project and require their notices to be shipped with applications.

What PiDurableKit is used for

1 use taken from transcripts — each links to the moment in the video.

  • Lets an iPhone or Mac app run AI agents that survive being killed. It wraps the PI durable agent library in JavaScript Core behind a native Swift API, writing every conversation, model turn and tool call to storage so the agent carries on after iOS kills the app mid-turn.

Videos mentioning PiDurableKit

1 in the library.