pgrundev/pgbot
Postgres intelligence for ai agents
What it solves
pgbot provides instant, read-only diagnostic health reports for PostgreSQL databases without requiring external agents, monitoring services, or write privileges. It helps developers and DBAs quickly identify performance bottlenecks, unused indexes, and configuration issues by analyzing the database's internal statistics.
How it works
It is a single, static binary that connects to your database using a read-only role with pg_monitor permissions. It samples PostgreSQL's internal statistics views to generate a deterministic health report. It can also optionally use an AI model (via API keys) to provide plain-language explanations of the findings it has already calculated. It supports local baselines to track performance regressions over time and offers a machine-readable JSON output for integration into CI/CD pipelines or AI agent workflows.
Who it’s for
Developers and database administrators who need to triage database performance issues quickly, perform ad-hoc health checks, or integrate database observability into automated CI/CD pipelines without the overhead of a full monitoring platform.
Highlights
- Zero-footprint: No agents, no external services, and no write access required.
- Deterministic findings: All diagnostics are computed locally in Go; AI is only used to summarize findings, not generate them.
- CI/CD ready: Supports JSON output, SARIF reports, and exit codes for automated gatekeeping.
- Agent-friendly: Includes an MCP (Model Context Protocol) server to allow AI agents to query database health directly.
- Regression tracking: Compares current state against historical baselines to highlight specific changes in query performance or table usage.
Related
- Project
- Project
- Project
- Project
- Project