AI Assistant for PostgreSQL
Ask your database in natural language. Get answers, charts, and insights.
pgai is an AI-powered interface for PostgreSQL databases. Instead of writing SQL, describe what you want in plain language — pgai generates the query, runs it, and presents results with beautiful visualizations.
- Natural Language → SQL — "Show me top 10 customers by revenue" → instant results
- Auto-Correction — If a query fails, pgai automatically fixes and retries
- Self-Learning — Remembers successful queries and improves over time
- Beautiful Charts — Bar, line, pie, scatter, heatmap — auto-selected based on data
- Schema Awareness — Understands your tables, columns, relationships, and data types
- Safe Mode — Read-only by default, never modifies your data without explicit permission
- Export — CSV, JSON, PDF export of any result
# Connect to your database
pgai --host localhost --db myapp --user postgres
# Ask questions
> show revenue by month for 2024
> which products have declining sales?
> compare user signups this quarter vs last- PostgreSQL 12+
- Compatible with: Supabase, Neon, AWS RDS, Azure Database, self-hosted
pgai — Talk to your database 🇰🇿