A SQL database per agent,
per app, per PR.
Spin up an isolated SQLite in milliseconds. Pay only for requests, rows, and storage.
Or watch an agent use it liveWorks with Claude, ChatGPT, Cursor, LangGraph, Mastra, and any MCP client.
import { PerSQL } from "@persql/sdk";
const persql = new PerSQL({ token: process.env.PERSQL_TOKEN! });
const db = persql.database("acme/orders");
const { data, meta } = await db.query<{ id: number; email: string }>(
"SELECT id, email FROM customers WHERE id = ?", [42]
);
console.log(meta.costUsd); // throttle on the way out // One-shot lease for a sub-agent. Scoped, expires.
const { token } = await db.branches.pin("pr-42", {
role: "write",
ttlSec: 900,
});
const sub = await PerSQL.fromHandoff(token);
const subDb = sub.database(sub.handedOff.namespaceSlug, sub.handedOff.databaseSlug);
await subDb.query("INSERT INTO leads (email) VALUES (?)", ["a@b.co"]); One primitive, three shapes
Per agent
A fresh DB or branch for every Claude, GPT, or Cursor task.
Per app
Each microservice or prototype gets its own database — no shared Postgres.
Per PR
A preview DB per pull request, auto-expired when you merge.
Built in, not gated
Cost on every response
Every query response includes the USD it just spent. Your loop decides when to stop.
Auto-snapshot before destructive ops
DROPs, TRUNCATEs, and unbounded DELETEs are labeled into a 30-day point-in-time history. Restore is one call.
MCP server included
Plug PerSQL into Claude Desktop, Cursor, or any MCP client — ~40 tools, no extra setup.
Drop-in for Drizzle / Kysely
db.driver() returns the sqlite-proxy callback. persql-codegen emits typed schemas from a live DB.
Only what you use
No seats. No per-DB fees. New accounts start with $5 in credit.
| Requests | $0.50 | per million |
| Rows read | $0.005 | per million |
| Rows written | $2.00 | per million |
| Storage | $0.40 | per GB-month |
Branches, snapshots, vectors, blobs, custom domains, MCP, and public endpoints are all included.