Xata Agent

Your AI expert
in PostgreSQL

Open source AI agent that monitors your PostgreSQL databases, finds root causes, and suggests fixes. Like an always-on SRE with deep Postgres expertise.

View on GitHub

Monitoring that thinks

Traditional monitoring tools show you dashboards. Xata Agent understands what the metrics mean and tells you what to do about them.

Proactive monitoring

Continuously watches CPU, memory, query latency, and connection counts. Catches anomalies before they become outages.

Root cause analysis

Investigates pg_stat_statements, pg_locks, and system views using curated diagnostic playbooks. Finds the actual problem, not just the symptoms.

Actionable fixes

Suggests specific configuration changes, missing indexes, and query optimizations. Gives you the exact SQL or config change to apply.

Safety-first design

Never runs destructive or write commands against your database. All diagnostics use read-only SQL routines. Your data is never at risk.

Custom playbooks

Write diagnostic playbooks in plain English. Extend the agent with your team's specific knowledge about your database and infrastructure.

Multi-LLM support

Works with OpenAI, Anthropic, Deepseek, and Google Gemini. Choose the model that fits your budget and performance requirements.

How it works

Tools, playbooks, and schedules

The agent combines three primitives to diagnose and respond to issues autonomously.

Tools

Safe, read-only SQL routines that inspect pg_stat_statements, pg_locks, configuration settings, and more. The agent selects the right tools based on the situation.

Playbooks

Diagnostic procedures written in plain English. Built-in playbooks cover common scenarios. Add your own for team-specific knowledge.

Schedules

Configure when and how often the agent runs checks. Continuous monitoring, scheduled health checks, or on-demand investigation.

Integrations

Works with your infrastructure

Connect to your cloud provider for rich metrics and logs. Get notifications where your team works.

AWS RDS & Aurora

Collects logs and metrics via CloudWatch. Monitors RDS-specific performance insights.

Google Cloud SQL

Integrates with GCP monitoring for log and metric collection from Cloud SQL instances.

Slack

Sends alerts and recommendations to your Slack channels. Get notified where your team already works.

Custom tools via MCP

Extend the agent with custom diagnostic tools using the Model Context Protocol.

Getting started

Running in four steps

1

Install with Docker

Pull the Docker image and run with docker-compose. The agent ships as a Next.js application using the Vercel AI SDK.

2

Configure your LLM

Set your preferred LLM provider — OpenAI, Anthropic, Deepseek, or Google Gemini. Just an API key and model name.

3

Connect your Postgres

Point the agent at your database. Optionally configure CloudWatch or GCP monitoring for richer log and metric data.

4

Set up notifications

Connect Slack for real-time alerts. The agent starts monitoring immediately and notifies you when it finds issues.

Built in the open

980+ GitHub stars

Apache 2.0 license

TypeScript / Next.js

Docker deployment

Postgres for agent scale.

Use your existing Postgres. Run it better with Xata.