A SQL database per agent,
per app, per PR.
Spin up an isolated SQLite in milliseconds. Pay only for queries and storage.
Works with Claude, ChatGPT, Cursor, LangGraph, Mastra, and any MCP client.
// One DB per agent run. Free until queried.
import { PerSQL } from "@persql/sdk";
const persql = new PerSQL({ token: process.env.PERSQL_TOKEN! });
const db = persql.database("acme/orders");
// Step 1 — agent learns the schema (one round-trip).
const schema = await db.describe();
// Step 2 — runs SQL, gets cost back on every response.
const { data, meta } = await db.query<{ id: number; email: string }>(
"SELECT id, email FROM customers WHERE id = ?", [42]
);
console.log(meta?.costUsd); // self-throttle on the way out // Sub-agent delegation — single-use, scoped, expires.
const { token } = await db.branches.pin("pr-42", {
role: "write",
ttlSec: 900, // 15 min
});
// Hand to a sub-agent — it never sees the parent token.
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 a branch off prod — for every Claude/GPT/Cursor task.
Per app
Microservices, prototypes, internal tools — each gets its own database instead of crowding into one Postgres.
Per PR
PUT /branches/:ref is idempotent — call it on every push. expiresAt cleans up.
Built in, not gated
Cost on every response
/v1/query and /v1/batch return meta.costUsd. Your client decides when to stop — no polling a usage endpoint mid-loop.
Auto-snapshot before destructive ops
DROP, TRUNCATE, REPLACE, unbounded DELETE — automatically labeled into the 30-day PITR history. Restore is one call.
Schema discoverability
describe() returns the whole graph + docs in one call. search() finds tables by intent. doctor() lints for LLM-hostile patterns.
MCP server included
Plug PerSQL into Claude Desktop, Cursor, or any MCP client. ~40 tools covering query, schema, branches, snapshots, endpoints.
Drop-in for Drizzle / Kysely
db.driver() returns the sqlite-proxy callback Drizzle expects. persql-codegen emits a typed Drizzle schema from a live DB.
Edge-native
Each database is a Cloudflare Durable Object — embedded SQLite, migrates to the caller, sub-5ms reads from the right region.
Reach for the surface that fits
Pricing — only what you use
No seat fees, no per-database fees, no plan-tier feature gates.
Per query
Every read or write across /v1 and the SDK is
metered identically, regardless of which database or
branch it hits.
Per stored GB
Storage rolls up across all your databases and branches. An empty branch costs nothing.
Everything else: $0
Branches, forks, snapshots, vectors, blobs, custom domains, MCP, public endpoints — all included. Plan tiers only change rate-limit headroom and support level.