pg_ai_query v0.1.0 — First stable release with multi-model AI for PostgreSQL

Posted on 2025-12-13 by benodiwal
Related Open Source

Announcing the first stable release of pg_ai_query v0.1.0, a major milestone that expands AI-powered query development directly inside PostgreSQL.

With this release, pg_ai_query becomes more flexible, more portable, and easier to use across different environments.

pg_ai_query now supports:

  • Generating SQL from natural language, e.g. SELECT generate_query('list customers who have not placed an order in the last 90 days');

  • AI-interpreted EXPLAIN ANALYZE for understanding query performance

  • Automated index and rewrite recommendations

  • Schema-aware query intelligence through secure introspection

  • OpenAI, Anthropic, Google Gemini - all currently supported models

  • OpenAI-compatible APIs, including OpenRouter and similar endpoints

  • Local models, such as running through Ollama

  • Linux/Macos support for running the extension natively

  • This release is focused on giving developers more choice of cloud models, compatible APIs, or fully local inference while keeping the workflow entirely inside Postgres.

Documentation and installation instructions: https://benodiwal.github.io/pg_ai_query

Source code: https://github.com/benodiwal/pg_ai_query

pg_ai_query supports PostgreSQL 14+.
Feedback and contributions are very welcome as the project continues to grow.

Best regards,
Sachin Beniwal
benodiwal