Xata Agent is an open source agent that monitors your database, finds root causes of issues, and suggests fixes and improvements. It's like having a new SRE hire in your team, one with extensive experience in Postgres.
Letting the agent introduce itself:
Hire me as your AI PostgreSQL expert. I can:
- watch logs & metrics for potential issues.
- proactively suggest configuration tuning for your database instance.
- troubleshoot performance issues and make indexing suggestions.
- troubleshoot common issues like high CPU, high memory usage, high connection count, etc.
- and help you vacuum (your Postgres DB, not your room).
More about me:
- I am open source and extensible.
- I can monitor logs & metrics from RDS & Aurora via Cloudwatch.
- I use preset SQL commands. I will never run destructive (even potentially destructive) commands against your database.
- I use a set of tools and playbooks to guide me and avoid hallucinations.
- I can run troubleshooting statements, like looking into pg_stat_statements, pg_locks, etc. to discover the source of a problem.
- I can notify you via Slack if something is wrong.
- I support multiple models from OpenAI, Anthropic, and Deepseek.
Past experience:
- I have been helping the Xata team monitor and operate tons of active Postgres databases.
Here is an under 4 minutes walkthrough of the agent in action:
Xata.Agent.demo.mp4
A youtube version of the demo is available here.
We provide docker images for the agent itself. The only other dependency is a Postgres database in which the agent will store its configuration, state, and history.
We provide a docker-compose file to start the agent and the Postgres database.
Edit the .env.production
file in the root of the project. You need to set the PUBLIC_URL
and the API key for at least OpenAI.
Start a local instance via docker compose:
docker compose up
Open the app at http://localhost:8080
(or the public URL you set in the .env.production
file) and follow the onboarding steps.
We have a more detailed guide on how to deploy via docker-compose on an EC2 instance.
For authentication, you can use your own OAuth provider.
Go to the apps/dbagent
directory and follow the instructions in the README.
The agent can be extended via the following mechanisms:
- Tools: These are functions that the agent can call to get information about the database. They are written in TypeScript, see this file for their description.
- Playbooks: These are sequences of steps that the agent can follow to troubleshoot an issue. They are simply written in english. The pre-defined playbooks are here.
- Integrations: For example, the AWS and Slack integrations. They contain configuration and UI widgets.
While it's still early days, we are using the agent ourself in our day-to-day operations work at Xata.
- Playbooks:
- general monitoring
- tune settings
- investigate slow queries
- investigate high CPU
- investigate high memory
- investigate high connection count
- investigate locks
- investigate vacuuming
- Support for custom playbooks
- Other playbooks (please let us know)
- MCP integrations:
- Act as an MCP server for other agents
- Call the tools over the network via MCP
- Support for more cloud providers:
- AWS RDS
- AWS Aurora
- Google Cloud SQL
- Azure Database for PostgreSQL
- Digital Ocean Managed Databases
- Other (please let us know)
- Notifications & integrations:
- Simple Slack integration
- Slack integration as an AI agent (#29)
- Discord integration
- Other (please let us know)
- Eval & testing:
- Add eval testing for the interaction with LLMs
- Approval workflow:
- Add an approval workflow for the agent to run potentially dangerous statements
- Allow configuration of the tools that can be defined per monitoring schedule
While the Agent is by its nature primarily an open-source project that you self-host, we are also working on a cloud version. The advantage of the cloud version is that s 79F7 ome integrations are easier to install. If you are interested in the cloud version, please sign up on the waitlist here.