An AI database client for Postgres.

It writes the SQL. You decide what runs.

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
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 introspects the live catalog - tables, foreign keys, functions, custom types, extensions, server version - and sends it with your question, trimmed to fit whichever model you chose.

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)
types: order_status enum
excluded by you: public.pii_vault, public.audit_log
Live schema context

Schema context, sent with every question.

Add a column this morning and it knows about it. Rename a table and the context follows. You control the scope: exclude individual objects, or turn schema context off entirely.

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 · you approved
DROP TABLE customers
refused·read-only lock
ALTER TABLE orders ADD COLUMN …
held·awaiting your approval
Between the model and pgen

Limits on what the model can do.

Confirmation gate
any tool with side effects asks first - allow once, allow for the conversation, or deny
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

Limits on what any query can do.

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
Real cancellation
pg_cancel_backend from a sibling connection stops the statement server-side
Keys stay put
credentials and API keys live in the OS keychain
03In 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.

Ask about anything, with no setup

Bring up a table you've never mentioned and the assistant goes and finds it. You won't have to describe your own database to it before asking a question.

Answers you don't have to double-check

The assistant can safely try a query before it gives it to you, so what lands in your editor is something it has already confirmed returns what you asked for.

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.

04The client

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

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

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
⌘⇧Frefund AND product24 hits
3 d agoSELECT count(*) FROM refunds WHERE created…
1 w agoWITH bad_products AS (SELECT p.id, p.name…
2 w agoSELECT p.name, count(r.*)::numeric FROM…
3 w agoUPDATE invoices SET sent_at = now() WHERE…
Connections · history

Switch databases in a keystroke.

Tag connections as prod, staging, or local and filter by environment. ⌘P switches between them. Every query you've run stays searchable.

.csv.json.parquet.sql.gz.xlsx.tsv.ndjson
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. Move a Parquet dump through Postgres and out to CSV without reaching for a shell.

Keyboard
K
Command palette
Run selection
T
New query tab
P
Switch connection
1
Data browser
2
SQL editor
/
Comment line
F
Search history
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
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 → 17·pgvector·postgis·timescaledb·every extension·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. PRO arrives later for teams that need cloud sync and managed inference.