Pipal

Self-hosted AI chat workspace

A minimal, durable AI harness.

Pipal is a chat workspace you run yourself: one Node.js process and one SQLite file. Close the tab and the reply still finishes. Restart the server and unfinished work resumes.

Built on Pi Durable, with Hono, Svelte, and SQLite.

LeavesThe Svelte workspace
TrunkOne Node.js process
RootsPi Durable and one SQLite file
sacred figSmall above ground, deep belowThe leaves represent the Svelte workspace. The trunk is one Node.js process. The roots are Pi Durable and one SQLite file.
Durable by default

Your conversation outlives the tab and the process.

Pipal writes your message to disk before it replies. The message, the work to answer it, and its deadline go into SQLite in one commit. After that, the browser can leave and the server can stop.

One message through a restart
  1. Send

    You press Send. The browser posts your message.

  2. Commit

    Pipal saves the message, the work to answer it, and a deadline in one write. Then it returns the receipt.

  3. Stream

    The reply reaches your tab as server-sent events.

  4. Close the tab

    The stream ends. The run belongs to the server, so it keeps going.

  5. Kill the process

    The server dies mid-reply. The message and its task are still in SQLite.

  6. Restart

    Pi Durable finds the unfinished task. If the run has time and retries left, it sends the model request again.

  7. Come back

    Open the chat. A fresh snapshot shows the finished answer.

Pipal's test suite kills the host during model calls and tool calls to check this.

Durable by default, in the book
Branches

The core is the trunk. Everything else is a branch.

Pipal's core stays small. What the assistant can do comes from profiles, tools, and extensions you turn on.

Also included: web search, image and PDF attachments, passkey sign-in, chat search, and a cost report for each chat.

Ground

Run it on your own machine.

You need Node.js 26 and pnpm.

Terminal
git clone https://github.com/PipalAI/pipal.git
cd pipal
pnpm install --frozen-lockfile
pnpm dev

Open http://127.0.0.1:8080 and unlock the workspace with the token in data/access-token. To try it with no model account, choose Local echo. To use your ChatGPT plan, choose Connect ChatGPT in Settings.

  • One user
  • Listens on loopback only
  • Token or passkey sign-in
  • MIT license

For a server, the book covers Caddy and systemd on Linux.

Deploying Pipal, in the book
Roots

Built on Pi Durable.

Pipal is a Pi pal. Its base is Pi Durable, the durable agent harness from the Pi project.

Pi Durable commits conversations, model turns, and tool calls to storage before anything is shown. If the process dies mid-turn, reopening the storage picks the work up where it stopped. Pi AI calls the model.

Pi runs the conversation. Pipal makes it a workspace.

AreaPi givesPipal adds
ConversationsTranscripts, tasks, checkpoints, and recoveryAdmission, retry checks, and run deadlines
ModelsOne interface for model providers, with streamingMarkdown profiles, a model picker, and ChatGPT sign-in
ToolsTool calls, extensions, and hooksGrants checked at every call, and routing to the project's location
WaitingParking, wake-ups, and signalsApprovals, delegation, routines, and workers
AccessA watch on each conversationThe HTTP API, the event stream, sign-in, and the Svelte workspace