Skip to content
Sign in
  • Browse all toolsFilter by category and pricing
  • Browse categoriesWriting, code, image, audio and more
  • Compare toolsPut up to three side by side
  • Read the blogGuides and comparisons

PiDurableKit

Swift APIs for durable AI agents on Apple platforms, with persistent conversations and crash recovery.

PiDurableKit is a Swift library for durable AI agents on Apple platforms, running pi-durable in JavaScriptCore. PiDurableKit persists conversations, tool calls, and state so interrupted work can resume. Designed for Swift application developers, PiDurableKit is available as an open-source GitHub project under the CC0-1.0 license.

Updated 9 Nov 20266 sections

PiDurableKit website screenshot

What is PiDurableKit?

PiDurableKit is an open-source Swift library for building durable AI agents on Apple platforms. PiDurableKit runs pi-durable in JavaScriptCore and provides a Swift API for applications on iPhone, iPad, Mac, and Vision Pro. The project focuses on preserving agent work across interruptions: conversations, model turns, tool calls, and application state are committed to storage before anything is shown.

What PiDurableKit can do

PiDurableKit combines persistent agent execution with Swift-defined tools and streaming interfaces. Developers can define prompt sections, hooks, and wraps as closures, coordinate subagents and durable tasks, and inspect conversation state. Provider support includes Anthropic, OpenAI, Google, OpenRouter, Groq, xAI, and Mistral, along with OpenAI-compatible or Anthropic-compatible servers.

  • PiDurableKit stores conversations using SQLite, JSONL, or in-memory storage.
  • PiDurableKit supports subagents, child tasks, and atomic transactions.
  • PiDurableKit streams conversation views through AsyncSequence for SwiftUI.
  • PiDurableKit provides sandboxed read, write, and edit tools.
  • PiDurableKit supports steering, follow-ups, abort, reset, compaction, and forks.
  • PiDurableKit includes a scripted faux provider for tests and SwiftUI previews.

How PiDurableKit works

PiDurableKit is added as a package dependency and included in a target's dependencies. The example initializes model credentials using the Keychain, sets an Anthropic API key, and opens a harness backed by SQLite. Application code then creates a root conversation with a selected model, submits a prompt, waits for completion, and retrieves the assistant entry.

PiDurableKit mirrors the pi-durable API while using Swift concurrency in place of Chord contexts. Cancelling a Swift task cancels a wait without cancelling the underlying work. OAuth sign-in is available for Claude Pro/Max, ChatGPT, GitHub Copilot, and OpenRouter, with tokens stored in the Keychain and refreshed automatically.

Who PiDurableKit is for

PiDurableKit serves developers integrating AI agents into Apple applications rather than users seeking a standalone chat application. The Swift API, SwiftUI conversation streams, tool closures, and testing provider support application development workflows. Persistent storage is particularly relevant when an application may be terminated during a model turn and needs to resume the agent's work afterward.

  • Swift developers can build assistants with custom tools and prompt sections.
  • SwiftUI developers can display streaming conversation views.
  • Application developers can recover interrupted agent work from persistent storage.

PiDurableKit licensing and access

PiDurableKit is available as an open-source GitHub repository under the CC0-1.0 license. The installation instructions show a package declaration and direct developers to add PiDurableKit to their target dependencies. The repository provides source code, tests, a README, and a license file; the supplied page does not describe commercial plans or subscription pricing.

PiDurableKit strengths and limitations

PiDurableKit combines crash recovery, multiple model providers, Swift-native customization, and streaming conversation access in a developer library. SQLite and JSONL offer persistent storage choices, while in-memory storage and the scripted faux provider support other development workflows. Adoption requires integration into a Swift application, and the documented operating-system requirements limit which Apple devices and application targets can use the project.

  • PiDurableKit requires iOS 17, macOS 14, tvOS 17, or visionOS 1.
  • PiDurableKit requires adding a package and target dependency.
  • PiDurableKit requires application code to configure models, storage, and conversations.

PiDurableKit FAQ

What is PiDurableKit?

PiDurableKit is an open-source Swift library for durable AI agents on Apple platforms. PiDurableKit runs pi-durable in JavaScriptCore and commits conversations, model turns, tool calls, and application state to storage before displaying results.

Is PiDurableKit free?

PiDurableKit is available as an open-source GitHub project under the CC0-1.0 license. The repository includes package installation instructions, but the supplied page does not list paid plans or subscription prices.

Which Apple operating systems does PiDurableKit support?

PiDurableKit requires iOS 17, macOS 14, tvOS 17, or visionOS 1. The project describes durable AI agents for iPhone, iPad, Mac, and Vision Pro through a Swift API backed by JavaScriptCore.

Can PiDurableKit resume work after an app is terminated?

PiDurableKit can resume interrupted work when persistent storage is reopened after iOS terminates an application mid-turn. PiDurableKit commits conversations, model turns, tool calls, and application state before showing results, and supports SQLite or JSONL persistence with crash recovery.

Which AI providers does PiDurableKit support?

PiDurableKit supports pi-ai providers including Anthropic, OpenAI, Google, OpenRouter, Groq, xAI, and Mistral, plus OpenAI-compatible or Anthropic-compatible servers. PiDurableKit also documents OAuth sign-in for Claude Pro/Max, ChatGPT, GitHub Copilot, and OpenRouter.

From the community

No reviews yet

Be the first to review this tool. What you write helps the next person choose.

More tools like PiDurableKit

Rivet

www.github.com

Open-source orchestration for durable AI agents, stateful applications, and replayable workflows.

Free

Swiftlet

www.github.com

Run Qwen Mixture-of-Experts models locally on Macs and iPhones by streaming expert weights from storage.

Free

TurboFieldfare

www.github.com

Run Gemma 4 26B-A4B locally on Apple Silicon Macs using about 2 GB of RAM.

Free

Leviathan

www.github.com

Open-source full-text search and persistent memory for agents working with large datasets.

Free