Monitoring, health checks, and root cause analysis — built for humans and AI agents
Battle-tested in PostgresAI team's work with companies like GitLab, Miro, Chewy, Suno, Supabase, Gadget, and more — now packaged for easy use by humans and AI agents.
Traditional monitoring tools give you dashboards. postgresai gives AI agents the context they need to actually fix problems.
- Structured for AI — Reports and metrics designed for LLM consumption
- Issues workflow — Track problems from detection to resolution
- 45+ health checks — Bloat, indexes, queries, settings, security
- Active Session History — Postgres's answer to Oracle ASH
- Expert dashboards — Four Golden Signals methodology
Part of Self-Driving Postgres — PostgresAI's open-source initiative to make Postgres autonomous.
Create a free account at postgres.ai
npx postgresai authThis opens your browser to log in and saves your API key locally.
PGPASSWORD=secret npx postgresai checkup postgresql://user@host:5432/dbnameOpen console.postgres.ai to see:
- Detailed reports with suggested fixes
- Issues workflow to track remediation
- Historical data across all your projects
Offline mode: Add
--no-uploadto run locally without an account.
Run specific checks or work offline:
# Run a specific check
npx postgresai checkup --check-id H002 postgresql://...
# Local JSON output only (no upload)
npx postgresai checkup --no-upload --check-id H002 postgresql://...Tips:
npx pgai checkupalso works.bunx postgresaiif you prefer Bun.
For continuous monitoring with dashboards, install the full stack on a Linux machine with Docker:
# Quick demo with sample data
npx postgresai mon local-install --demo
# → Open http://localhost:3000
# Production setup (Linux + Docker required)
npx postgresai prepare-db postgresql://admin@host:5432/dbname # Create monitoring role with minimal permissions
npx postgresai mon local-install --api-key=YOUR_TOKEN --db-url="postgresql://..."Get your API key at console.postgres.ai — or use the fully managed version there.
All diagnostic queries are carefully designed to avoid the observer effect — they use timeouts, row limits, and non-blocking approaches. Battle-tested on production databases with dozens of TiB of data, hundreds of kTPS, and millions of DB objects.
Preview the setup SQL before running:
npx postgresai prepare-db --print-sql postgresql://... # Review what will be createdThe prepare-db step creates a read-only postgres_ai_mon user with minimal permissions, enables pg_stat_statements, and creates postgres_ai schema with a few helper views.
| Component | Purpose |
|---|---|
| Express checkup | Instant health checks — no setup needed |
| Grafana dashboards | 13+ expert views: Node Overview, Query Analysis, Wait Events, Indexes, Tables, Replication, and more |
| Scheduled reports | 45+ metrics collected continuously via pgwatch |
| Metrics collection | pgwatch v3 + Victoria Metrics |
| AI-ready output | Structured JSON for Claude, GPT, and other agents |
| Claude Code plugin | Slash commands for health checks in your IDE |
| MCP server | Work with Issues from console.postgres.ai in AI coding tools |
postgresai is designed to feed AI agents with structured PostgreSQL diagnostics.
Install from the marketplace:
claude plugin marketplace add postgres-ai/postgresai
claude plugin install pgai@postgresaiWork with Issues from console.postgres.ai:
/pgai:issues
# Install MCP server for your AI coding tool
npx postgresai mcp installThis enables AI agents to work with Issues and Action Items from console.postgres.ai directly within your IDE.
# Pipe checkup output to any LLM
npx postgresai checkup --json postgresql://... | llm -s "analyze this Postgres health report"
# Or use with Claude directly
npx postgresai checkup --json postgresql://... | claude -p "find issues and suggest fixes"- AI agent detects slow query from application logs
- Runs
postgresai checkup --check-id H002→ finds unused indexes - Gets structured JSON with analysis
- Suggests
DROP INDEXor creates PR
For checkup (express mode):
- Node.js 18+ (includes npm/npx)
- Network access to PostgreSQL 14-18
For full monitoring stack:
- Linux machine with Docker
pg_stat_statementsextension enabled
- Short alias:
npx pgai checkupworks too - Can I use it without registration on console.postgres.ai? Yes, both express checkup and full-fledged monitoring are open-source and can be used without any connection to console.postgres.ai. In instructions above, just skip
npx postgresai authand:- Express checkup: use
--no-upload - Full monitoring: omit --api-key`
- Express checkup: use
- Managed version: Express checkup finds problems. The managed version at console.postgres.ai also explains how to fix them and provides an Issues workflow to track fixes
| Demo | demo.postgres.ai (login: demo / demo) |
| Docs | postgres.ai/docs |
| Issues | GitLab |
| Community | Postgres.FM · Postgres.TV |
PostgresAI — Self-Driving Postgres
Apache 2.0 · Contributing




