pgrundev/pgbot
Postgres intelligence for ai agents & apps
What it solves
pgbot is a point-in-time diagnostic tool for PostgreSQL that provides immediate visibility into database health without requiring the deployment of a monitoring agent, a time-series database, or external services. It solves the problem of quickly triaging database performance issues, identifying unused indexes, and detecting regressions in query performance or table bloat without the overhead of a full monitoring platform.
How it works
pgbot is a single static binary that connects to a PostgreSQL instance using a read-only role with pg_monitor privileges. It reads the database's own internal statistics views to compute health scores and findings. To track changes over time, it maintains a local baseline store on the user's machine, allowing it to report what has changed since previous runs. While the core findings are deterministic and computed in Go, it offers an optional AI layer (via OpenAI or Gemini) that can explain these findings in plain language.
Who it’s for
It is designed for database administrators, developers, and AI agents who need a fast, read-only way to inspect the health of a PostgreSQL database, whether it is a local instance, a managed provider like AWS RDS, or a database they do not own.
Highlights
- Zero-Deployment: A single static binary with no collector or external service required.
- Read-Only Guarantee: Uses a dedicated
pg_monitorrole and session-level read-only pinning for safety. - Baseline Tracking: Remembers previous runs to identify performance regressions and changes in database behavior.
- AI-Powered Analysis: Optional
askandexplaincommands that provide plain-language interpretations of deterministic findings. - Agent-Ready: Provides a versioned JSON contract and a Model Context Protocol (MCP) server to expose findings to AI agents.
- Comprehensive Diagnostics: Includes specialized commands for analyzing indexes, queries, vacuum health, and table storage.
Related
- Project
- Project
- Project
- Project
- Project