About
pgen is a full Postgres client for Mac, with the AI assistant built in. The editor, query plans, connections, and history you'd expect from a serious client are all there. When you open a table or a function, the assistant already knows what you're looking at. The assistant writes SQL in the editor, and nothing reaches the database until you run it.
pgen reads your live schema from the database catalog and sends the relevant slice directly to the model you choose, whether that's Anthropic, OpenAI, Google, Ollama, or an OpenAI-compatible endpoint. You don't paste your schema into a chat window, and there is no pgen server in between. API keys are stored in your system keychain.
The assistant's SQL gets the same treatment as yours. Read-only mode is available, and a production guard holds statements on production-tagged connections until you approve them. Results are row-capped, and running queries can be cancelled. pgen works with Postgres 12 and later, including many hosted providers. It is free, has no account requirement, and you can run it against a local model without an API key.
What's new
All release notesHomebrew cask pgen 1.20.0 (sha256 883055d3bf784cd7a1ff879ad2bb18236d81e970966ec9bb7391a922c544a32a).