Skip to content Skip to footer
Xata Agent: AI agent expert in PostgreSQL by todsacerdoti

Xata Agent: AI agent expert in PostgreSQL by todsacerdoti

7 Comments

  • Post Author
    lelandfe
    Posted March 13, 2025 at 6:58 pm

    > I support multiple models from OpenAI, Anthropic, and Deepseek.

    Are there risks associated with sending DB info off to these third parties?

  • Post Author
    jasonthorsness
    Posted March 13, 2025 at 7:08 pm

    During incidents I've often found that the issue has been obvious or brewing for some time – the idea of having an LLM-driven "smart" monitoring system for key services that can recognize problems and often take action could hopefully make this less of a thing. I'll be looking at how this works to try something similar for my own company's services.

    I think a key for this one is "I use preset SQL commands. I will never run destructive (even potentially destructive) commands against your database." If it's also locked down to only informational queries (and not leaking user tables to the LLM providers) I think why not try this?

    I do wonder about cost of this at scale; compared to the cost of the services being monitored. Hopefully an Agent tax doesn't become another Datadog tax.

  • Post Author
    arjunlol
    Posted March 13, 2025 at 7:30 pm

    Looks cool! This may actually save a lot of manual dba work for myself

  • Post Author
    femiagbabiaka
    Posted March 13, 2025 at 8:44 pm

    Interesting, might try it out at home.

    Documentation asserts:
    > I use preset SQL commands. I will never run destructive (even potentially destructive) commands against your database.

    This is enforced by taking the responsibility for generating SQL in order to evaluate state out of the hands of the LLM. The LLM simply interprets results of predetermined commands based on a set of prompts/playbooks: https://github.com/xataio/agent/blob/69329cede85d4bc920558c0…

  • Post Author
    iLoveOncall
    Posted March 13, 2025 at 8:52 pm

    The title should really include the fact that it's an expert at MONITORING PostgreSQL. It's not for writing queries from natural language.

    I'm extremely interested in the latter but not at all in the first.

  • Post Author
    simonw
    Posted March 13, 2025 at 9:30 pm

    The prompts that do most of the work are in this file: https://github.com/xataio/agent/blob/main/apps/dbagent/src/l… – strings stored in these variables:

      SLOW_QUERIES_PLAYBOOK
      GENERAL_MONITORING_PLAYBOOK
      TUNING_PLAYBOOK
      INVESTIGATE_HIGH_CPU_USAGE_PLAYBOOK
      INVESTIGATE_HIGH_CONNECTION_COUNT_PLAYBOOK
      INVESTIGATE_LOW_MEMORY_PLAYBOOK
    

    Looks like they are orchestrated by these system prompts: https://github.com/xataio/agent/blob/69329cede85d4bc920558c0…

  • Post Author
    arcticfox
    Posted March 14, 2025 at 2:03 am

    This is very cool! What is preventing the other cloud providers from being supported I wonder? is the integration not just a connection string?

Leave a comment

In the Shadows of Innovation”

© 2025 HackTech.info. All Rights Reserved.

Sign Up to Our Newsletter

Be the first to know the latest updates

Whoops, you're not connected to Mailchimp. You need to enter a valid Mailchimp API key.