Skip to content

Recipes

Six patterns that show what PerSQL is for. Each is ≤20 lines of code and works against new PerSQL({ local: ":memory:" }) or a real psql_live_… token.

RecipeWhen you reach for it
Per-agent sandboxEvery agent run gets a fresh DB or branch. Idempotent, auto-deletes.
Agent memoryDurable, queryable memory in plain SQL — facts, working scratch, episodes. Keyword recall, no vector DB.
Sub-agent handoffDelegate a scoped, single-use token to a sub-agent.
Cost-aware loopSelf-throttle on meta.costUsd instead of a usage endpoint.
PR-preview DBIdempotent branch per pull request, auto-clean.
MCP quickstartAdd PerSQL to Claude Desktop / Cursor in 30 seconds.

Each recipe ends with a one-line “next step” — usually db.describe(), db.search(), or db.doctor() — so you can keep building without leaving the agent loop.