agent  by xataio

Open-source AI agent for PostgreSQL database monitoring and optimization

Created 7 months ago
859 stars

Top 41.7% on SourcePulse

GitHubView on GitHub
Project Summary

Xata Agent is an open-source AI system designed to act as an expert PostgreSQL administrator, automating database monitoring, issue detection, and performance tuning. It targets database administrators and SREs seeking to proactively manage PostgreSQL instances, offering benefits similar to a seasoned SRE hire with specialized Postgres knowledge.

How It Works

The agent leverages a tool and playbook-based architecture to interact with PostgreSQL databases and cloud provider metrics. It analyzes logs and metrics (e.g., from AWS CloudWatch for RDS/Aurora), executes predefined SQL queries against database internals (pg_stat_statements, pg_locks), and uses LLMs (OpenAI, Anthropic, Deepseek) to interpret findings and suggest fixes. This approach aims to provide structured troubleshooting and prevent LLM hallucinations by grounding responses in concrete data and predefined workflows.

Quick Start & Requirements

  • Install via Docker Compose: docker compose up
  • Prerequisites: Docker, PostgreSQL database (for agent state), OpenAI API key (or other supported LLM provider).
  • Access the agent at http://localhost:8080.
  • Detailed deployment guides are available for EC2.
  • Demo Walkthrough

Highlighted Details

  • Proactively monitors logs and metrics for common issues (high CPU, memory, connections).
  • Suggests configuration tuning and indexing improvements.
  • Supports multiple LLM providers (OpenAI, Anthropic, Deepseek).
  • Extensible via custom TypeScript tools and English-language playbooks.
  • Integrates with AWS RDS/Aurora and Slack notifications.

Maintenance & Community

  • Actively used internally at Xata for database operations.
  • Roadmap includes support for custom playbooks, more cloud providers (GCP, Azure), Discord integration, and an approval workflow for potentially destructive commands.
  • A cloud version is under development.

Licensing & Compatibility

  • License: Not explicitly stated in the README.
  • Compatibility: Designed for self-hosting; commercial use implications are unclear without a stated license.

Limitations & Caveats

The agent is in early stages, with features like lock investigation and vacuuming support still under development. It currently lacks an approval workflow for potentially destructive commands, though this is planned. Support for cloud providers beyond AWS is also pending.

Health Check
Last Commit

3 days ago

Responsiveness

1 day

Pull Requests (30d)
7
Issues (30d)
2
Star History
25 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.