Skip to content

pgEdge/ai-dba-workbench

Repository files navigation

pgEdge AI DBA Workbench

CI - Alerter CI - Client CI - Collector CI - Docker CI - Docs CI - Server

The pgEdge AI DBA Workbench is a unified environment for monitoring and management of any PostgreSQL v14+ instance, including Supabase and Amazon RDS, with an optional AI agent.  It watches every instance, catches anomalies before they become outages and walks through a diagnosis and resolution step by step.

The Workbench combines a Model Context Protocol (MCP) Server with a web-based user interface and data collector. Users can query, analyze, and manage distributed clusters using natural language and intelligent automation. The Workbench exposes pgEdge tools and data sources such as Spock replication status, cluster configuration, and operational metrics to language models.

The architecture supports switching between cloud-connected LLMs like Claude and locally hosted models from Ollama. This design ensures similar levels of functionality in air-gapped or secure environments. The pgEdge AI Workbench bridges database administration and AI reasoning; it offers an extensible foundation for observability, troubleshooting, and intelligent workflow creation across the pgEdge ecosystem.

Table of Contents

Components

The pgEdge AI DBA Workbench consists of four main components:

  • The Collector monitors PostgreSQL servers and stores metrics in a centralized datastore.
  • The Server provides MCP tools and resources for interacting with PostgreSQL systems.
  • The Alerter evaluates collected metrics against thresholds and AI-powered anomaly detection to generate alerts.
  • The Client provides a web-based user interface for the AI Workbench.

Documentation

Comprehensive documentation is available in the docs directory:

Prerequisites

Before building the project, install the following tools:

  • Go 1.24 or later for building server-side components.
  • Node.js 18 or later for building the web client.
  • PostgreSQL 14 or later for the datastore.
  • Make for build automation.

Building

The project uses Makefiles for building and testing. All components can be built from the top-level directory:

# Build all components
make all

# Build individual components
cd collector && make build

Testing

The project includes comprehensive unit tests for each component.

Run All Tests

# Run all sub-project tests
make test

# Run all sub-project tests with coverage
make coverage

# Run all sub-project tests with linting
make lint

# Run everything (all sub-project test-all)
make test-all

Run Tests for Individual Components

cd collector && make test

Environment Variables for Testing

  • TEST_AI_WORKBENCH_SERVER specifies the PostgreSQL connection string for the test database; the default is postgres://postgres@localhost:5432/postgres.
  • TEST_AI_WORKBENCH_KEEP_DB=1 preserves the test database after tests complete.

Available Make Targets

Each sub-project and the top-level Makefile support the following targets:

  • all builds the project and is the default target.
  • test runs the test suite.
  • coverage runs tests with a coverage report.
  • lint runs the linter.
  • test-all runs tests, coverage, and the linter.
  • clean removes build artifacts.
  • killall kills any running processes.
  • help shows the available targets.

Getting Started

For information on getting started with each component, refer to the following guides:

Deployment

For detailed installation, configuration, and usage instructions, see the following documentation:

Issues

To report an issue with the software, visit: GitHub Issues

Contributing

We welcome your project contributions; for more information, see docs/developer-guide/contributing.md.

For more information, visit docs.pgedge.com.

License

This project is licensed under the PostgreSQL License.

About

A PostgreSQL monitoring system built combining traditional and AI monitoring from the ground up.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors