A SQL database per agent,
per app, per PR.
Spin up an isolated SQLite database in milliseconds. Pay only for the requests, rows, and storage you use.
Use cases
A database for every unit of work
One call creates a database — made on demand, isolated by default, and you only pay when it's used.
Per agent
Every run gets its own database.
db.asTool()
hands it to the model as a tool — mistakes stay contained.
Per PR
Every pull request gets a branch — your tables, no production rows — that cleans itself up after merge.
Per app
Every microservice and prototype gets its own database instead of a corner of a shared Postgres.
Coding agents
Drop it into your coding agent
Your agent provisions its own database the first time it needs one. Sign in once in the browser — no API key to copy.
# Claude Code
claude mcp add --transport http persql https://mcp.persql.com/mcp
# Codex
codex mcp add persql --url https://mcp.persql.com/mcp Claude Code, Codex, Cursor, OpenCode — any MCP client. Install guide
SDK
Hand your agent a database
TypeScript and Python. One key turns any database into a tool your agent can call. Hand sub-agents their own branch, with a role and an expiry.
import { PerSQL } from "@persql/sdk";
const db = new PerSQL({ token: process.env.PERSQL_TOKEN! })
.database("acme/agent-7af");
// One isolated DB, handed to the model as a tool.
const tools = [db.asTool().anthropic]; // or .openai // Lease a scoped, expiring DB to a sub-agent.
const { token } = await db.branches.pin("pr-42", {
role: "write",
ttlSec: 900,
});
const sub = await PerSQL.fromHandoff(token);
const { namespaceSlug, databaseSlug } = sub.handedOff;
await sub.database(namespaceSlug, databaseSlug)
.query("INSERT INTO leads (email) VALUES (?)", ["a@b.co"]); State for your framework — a LangGraph checkpointer and OpenAI Agents sessions ship as packages.
GitHub
A preview database on every pull request
One step in your workflow. Each PR gets a branch — your tables, no production rows — that cleans itself up.
steps:
- uses: persql/preview-db-action@v1
with:
token: ${{ secrets.PERSQL_TOKEN }}
database: acme/orders
branch: pr-${{ github.event.pull_request.number }}
ttl-seconds: 86400 # one day, then gone Pricing
Only what you use
Prepaid and usage-based. Usage draws down a balance you load, and spending stops at zero. No seats. No per-database fees. New accounts start with $5 in credit.
Per pull request
~$0.01
A preview database on every PR. Copy your tables, run migrations and tests, delete it on merge — about 500 requests and 55,000 rows.
Per agent session
~$0.02
An isolated database per run. 1,000 queries reading 100,000 rows and writing 10,000.
Production app
~$21/mo
10M requests, 1B rows read, 5M rows written, 2 GB stored.
Estimated from the meter rates below.
| Requests | $0.50 | per million |
| Rows read | $0.005 | per million |
| Rows written | $2.00 | per million |
| Storage | $0.40 | per GB / month |
| AI tokens | $1.00 | per million |
All included on every account. Features aren't tiers.
Create your first database
Start with $5 in credit. Provision from the console, the CLI, or an agent.
- npm i @persql/sdk
- pip install persql
- brew install persql/tap/persql
- docker run persql/cli