{"id":26354414,"url":"https://github.com/xataio/agent","last_synced_at":"2025-05-15T16:06:06.775Z","repository":{"id":282293104,"uuid":"934059787","full_name":"xataio/agent","owner":"xataio","description":"AI agent expert in PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-05-12T12:32:45.000Z","size":2331,"stargazers_count":744,"open_issues_count":51,"forks_count":47,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-12T13:43:27.549Z","etag":null,"topics":["agent","ai","anthropic","llm","openai","postgres","postgresql"],"latest_commit_sha":null,"homepage":"https://xata.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xataio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-17T07:54:52.000Z","updated_at":"2025-05-12T06:47:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"d202c758-4d3d-4dc7-8ec0-bb14c230cc67","html_url":"https://github.com/xataio/agent","commit_stats":null,"previous_names":["xataio/agent"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xataio%2Fagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xataio%2Fagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xataio%2Fagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xataio%2Fagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xataio","download_url":"https://codeload.github.com/xataio/agent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374465,"owners_count":22060611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","ai","anthropic","llm","openai","postgres","postgresql"],"created_at":"2025-03-16T12:03:10.476Z","updated_at":"2025-05-15T16:06:06.769Z","avatar_url":"https://github.com/xataio.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"brand-kit/banner/xata-agent-banner-github-dark-mode@2x.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"brand-kit/banner/xata-agent-banner-github-light-mode@2x.png\"\u003e\n    \u003cimg alt=\"Xata logo\" src=\"brand-kit/banner/xata-agent-banner-github@2x.png\"\u003e\n  \u003c/picture\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/xataio/agent/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-Apache_2.0-green\" alt=\"License - Apache 2.0\"\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca href=\"https://github.com/xataio/agent/actions?query=branch%3Amain\"\u003e\u003cimg src=\"https://github.com/xataio/agent/actions/workflows/ci.yml/badge.svg\" alt=\"CI Build\"\u003e\u003c/a\u003e \u0026nbsp;\n  \u003ca href=\"https://xata.io/discord\"\u003e\u003cimg src=\"https://img.shields.io/discord/996791218879086662?label=Discord\" alt=\"Discord\"\u003e\u003c/a\u003e \u0026nbsp;\n  \u003ca href=\"https://twitter.com/xata\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/xata?style=flat\" alt=\"X Follow\" /\u003e \u003c/a\u003e\n\u003c/p\u003e\n\n# Xata Agent, your AI expert in PostgreSQL\n\nXata 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.\n\nLetting the agent introduce itself:\n\n\u003e Hire me as your AI PostgreSQL expert. I can:\n\u003e\n\u003e - watch logs \u0026 metrics for potential issues.\n\u003e - proactively suggest configuration tuning for your database instance.\n\u003e - troubleshoot performance issues and make indexing suggestions.\n\u003e - troubleshoot common issues like high CPU, high memory usage, high connection count, etc.\n\u003e - and help you vacuum (your Postgres DB, not your room).\n\u003e\n\u003e More about me:\n\u003e\n\u003e - I am open source and extensible.\n\u003e - I can monitor logs \u0026 metrics from RDS \u0026 Aurora via Cloudwatch.\n\u003e - I use preset SQL commands. I will never run destructive (even potentially destructive) commands against your database.\n\u003e - I use a set of tools and playbooks to guide me and avoid hallucinations.\n\u003e - I can run troubleshooting statements, like looking into pg_stat_statements, pg_locks, etc. to discover the source of a problem.\n\u003e - I can notify you via Slack if something is wrong.\n\u003e - I support multiple models from OpenAI, Anthropic, and Deepseek.\n\u003e\n\u003e Past experience:\n\u003e\n\u003e - I have been helping the Xata team monitor and operate tons of active Postgres databases.\n\n## Demo\n\nHere is an under 4 minutes walkthrough of the agent in action:\n\nhttps://github.com/user-attachments/assets/cdd2da8f-2d9d-4794-ada5-da161a8861fd\n\nA youtube version of the demo is available [here](https://youtu.be/SLVRdihoRwI).\n\n## Installation / self-hosted\n\nWe 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.\n\nWe provide a docker-compose file to start the agent and the Postgres database.\n\nEdit 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.\n\nStart a local instance via docker compose:\n\n```bash\ndocker compose up\n```\n\nOpen the app at `http://localhost:8080` (or the public URL you set in the `.env.production` file) and follow the onboarding steps.\n\nWe have a more detailed [guide](https://github.com/xataio/agent/wiki/Xata-Agent-%E2%80%90-Deploy-on-EC2) on how to deploy via docker-compose on an EC2 instance.\n\nFor authentication, you can use your own OAuth provider.\n\n## Development\n\nGo to the `apps/dbagent` directory and follow the instructions in the [README](./apps/dbagent/README.md).\n\n## Extensibility\n\nThe agent can be extended via the following mechanisms:\n\n- **Tools**: These are functions that the agent can call to get information about the database. They are written in TypeScript, see this [file](https://github.com/xataio/agent/blob/main/apps/dbagent/src/lib/ai/aidba.ts#L50) for their description.\n- **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](https://github.com/xataio/agent/blob/main/apps/dbagent/src/lib/tools/playbooks.ts).\n- **Integrations**: For example, the AWS and Slack integrations. They contain configuration and UI widgets.\n\n## Status / Roadmap\n\nWhile it's still early days, we are using the agent ourself in our day-to-day operations work at Xata.\n\n- Playbooks:\n  - [x] general monitoring\n  - [x] tune settings\n  - [x] investigate slow queries\n  - [x] investigate high CPU\n  - [x] investigate high memory\n  - [x] investigate high connection count\n  - [ ] investigate locks\n  - [ ] investigate vacuuming\n  - [x] Support for custom playbooks\n  - Other playbooks (please let us know)\n- MCP integrations:\n  - [ ] Act as an MCP server for other agents\n  - [ ] Call the tools over the network via MCP\n- Support for more cloud providers:\n  - [x] AWS RDS\n  - [x] AWS Aurora\n  - [x] Google Cloud SQL\n  - [ ] Azure Database for PostgreSQL\n  - [ ] Digital Ocean Managed Databases\n  - [ ] Other (please let us know)\n- Notifications \u0026 integrations:\n  - [x] Simple Slack integration\n  - [ ] Slack integration as an AI agent (https://github.com/xataio/agent/pull/29)\n  - [ ] Discord integration\n  - [ ] Other (please let us know)\n- Eval \u0026 testing:\n  - [x] Add eval testing for the interaction with LLMs\n- Approval workflow:\n  - [ ] Add an approval workflow for the agent to run potentially dangerous statements\n  - [ ] Allow configuration of the tools that can be defined per monitoring schedule\n\nWhile 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 some integrations are easier to install. If you are interested in the cloud version, please [sign up on the waitlist here](https://tally.so/r/wgvkgM).\n","funding_links":[],"categories":["🤖 AI \u0026 Machine Learning","TypeScript","NLP","Agent Categories"],"sub_categories":["\u003ca name=\"Unclassified\"\u003e\u003c/a\u003eUnclassified"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxataio%2Fagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxataio%2Fagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxataio%2Fagent/lists"}