An AI database client for Postgres.

It writes the SQL. You decide what runs.

Free · macOS 11+ · Apple Silicon & Intel

ask·sql·approve·run
pgen
prod.us-east-1
db.prod.internal:5432
Filter objects...
public
Tables12
customers1.2M
orders8.4M
iduuid
customer_iduuid →
total_centsint8
created_atts
line_items42M
Views4
Functions6
churn_score(uuid)
analytics
audit
ask anything about your database…
-- the editor is yours; pgen writes here
⌘↵ to run - nothing reaches the database until you do
no rows - nothing has run
01The assistant

It reads your live schema.

No pasting your schema into a chat window. pgen reads the live catalog itself and sends the right slice with every question.

context sent with your question
Database: shop_prod (PostgreSQL 16.2)
Extensions: pgvector v0.7.0, postgis v3.4.2
schema public
customers (1.2M rows)
id uuid pk
email varchar
orders (8.4M rows)
customer_id uuid → customers.id
total_cents int8
functions: churn_score(uuid)
procedures: recalc_totals(date)
types: order_status enum
Live schema context

Always current, never stale.

Add a column this morning and it knows about it. Rename a table and the context follows.

providers
Anthropicyour key
OpenAIyour key
Googleyour key
Ollamalocal · no key
Any OpenAI-compatible endpointyour URL

There is no pgen server in the path.

Your schema and your question go straight from your machine to the provider you picked - we never see either. Point it at Ollama and nothing leaves the machine at all.

Providers

Bring your own model.

Anthropic, OpenAI, Google, a local Ollama, or any OpenAI-compatible endpoint you host yourself. Keys are stored in the operating system keychain, not in a config file, and never sent anywhere except the provider they belong to.

02Guardrails

Limits the model can’t turn off.

The safety layer was built before the assistant was. It applies to SQL the model wrote the same way it applies to SQL you wrote, and none of it can be disabled from a prompt.

the model asked forwhat pgen did
SELECT c.id, c.name, sum(o.total_cents) …
ran·capped at 1000 rows
UPDATE invoices SET sent_at = now() …
held·production guard · needs your approval
DROP TABLE customers
refused·read-only lock
ALTER TABLE orders ADD COLUMN …
held·production guard · awaiting your approval
Between the model and pgen

What the model is allowed to do.

Approvals are scoped
approving your own UPDATE is not approval for one the model wrote - model-proposed SQL re-prompts on guarded connections
Token budget
50,000 tokens per conversation, then it stops
Rate limit
10 messages a minute - and reconnecting doesn't reset it
Context trimmer
schema is trimmed to fit the model you picked, never truncated mid-object
No execute path
the only thing the model can do to your database is write SQL you haven't run
Between pgen and Postgres

How the database stays protected.

Read-only mode
SET default_transaction_read_only = on, enforced by the server - not a checkbox in our UI
Production guard
mutations on a tagged connection need approval, and approvals die on disconnect
Row cap
a bare SELECT wraps in LIMIT 1000 so a missing predicate can't pull a million rows
Transactional edits
every inline edit commits as a single transaction - partial writes can't happen
Real cancellation
pg_cancel_backend from a sibling connection stops the statement server-side
03The client

Turn the assistant off and it’s still a full client.

The editor, query plans, connections, searchable history, import and export - the parts you'd use every day even if the AI didn't exist.

orders.sqlrevenue.sql
SELECT o.id, o.status, o.total
FROM ord
orderstable
order_itemstable
orders · rows 1-50 of 1,2041 cell edited
idstatustotal
1041shipped129.00
1042refunded84.50
1043pending212.40

tabs and unsaved text survive a restart

SQL editor · data browser

An editor that knows your schema.

Autocomplete drawn from the live catalog - your tables, your columns, your joins - not a keyword list. Browse table data in a grid that pages as you scroll, and edit cells in place - every change committed in a single transaction.

Hash Joincost · 412Index Scancustomers · cost 88Seq Scan · orderscost 287 · 8.4M rowsFilter · quarterAdd an index on orders.created_at to drop this scan.THE HOT PATH
Query plans

Query plans you can read.

Every node with its cost and time, the expensive branch marked red, and a plain sentence telling you which index would fix it - instead of a plan you have to decode yourself.

prod.us-east-1pg-16.2
staging.eu-westpg-16.2
analytics.warehousepg-15.6
local.dockerpg-17.1
legacy-reportspg-13.8
⌘⇧Frefund12 hits
3 d agoSELECT count(*) FROM refunds WHERE created…
1 w agoSELECT reason, count(*) FROM refunds GROUP…
2 w agoWITH refund_totals AS (SELECT order_id, su…
3 w agoUPDATE refunds SET status = 'settled' WHER…
Connections · history

Every connection and every query, one keystroke away.

Tag connections as Production, Staging, or Development and filter by environment. Your last 500 queries stay searchable - kept per connection, on your machine.

.csv.tsv.json.jsonl.sql.xlsx
sourcetypetarget
user_idint8users.id
created_attimestampusers.created
email_addressvarcharusers.email
Import · export

Import and export without leaving the app.

Column mapping with type inference and conflict resolution on insert. Export as CSV, JSON, SQL, or Excel - filtered by a WHERE clause when you don't need the whole table.

Keyboard
K
Command palette
Run script
Run selection
T
New query tab
1
Explorer
2
SQL editor
3
Stats
4
Schema
/
Comment line
I
AI assistant
04In development

Coming to the assistant.

Today the assistant writes SQL and you decide what runs. Here's what's coming next - all of it arriving behind the same approvals you already control.

It goes and looks things up

Bring up a table that didn't make it into the context and the assistant looks it up in the live catalog on its own - mid-conversation, before it answers.

Answers it already tested

The assistant can safely try a query before it gives it to you, so what lands in your editor is something it has already run - read-only, row-capped - and seen come back clean.

Find out why something is slow

Point it at a query that's dragging and get a straight answer about what's holding it up - without having to read a query plan yourself.

Know which index to add

Get a specific recommendation with the reasoning behind it, instead of guessing which column to index and hoping it helps.

05Compatibility

Everywhere Postgres lives.

If it speaks the wire protocol, pgen connects. Cloud, container, or laptop - paste the URL and you're in.

Supabase
db.*.supabase.co
Neon
*.neon.tech
Railway
*.railway.app
Render
*.render.com
AWS RDS
*.rds.amazonaws.com
Google Cloud SQL
cloud sql · iam proxy
Azure Database
*.postgres.database.azure.com
Timescale Cloud
*.tsdb.cloud.timescale.com
Crunchy Bridge
*.crunchybridge.com
DigitalOcean
*.db.ondigitalocean.com
Self-hosted
localhost · docker · k8s
postgres 12+·pgvector·postgis·timescaledb·extensions live in the server - if yours runs it, pgen speaks it·ssl · ssh tunnel · iam auth
Get started

Download pgen and connect.

Free, every feature, no account. Add your own API key when you want the assistant on, or run it against a local model and skip the key entirely.