Skip to main content

Query: AI SQL Analyst Agent

Query is an AI SQL analyst that learns your data's context, writes correct SQL and profiles datasets before anyone draws a conclusion from them.

Last updated:

What does Query do?

Query is the SQL Analyst in the xSquads Data Analytics Squad. Writes and optimises queries and documents the data context. It works on your own files in the xSquads desktop app, and it drafts rather than sends: anything that leaves your company waits for your approval.

Query at a glance

Role
SQL Analyst
Works with
Stat (Data Scientist), Chart (Visualisation Designer)
Who approves the work
You. Drafts wait for your review before anything is sent or published.
Skills
4 skills
Connections needed
None beyond the app

Common problems Query solves

Where this work usually goes wrong, and what Query does about it.

Queries written against a guess of the schema

The problem: The query runs and returns numbers, and they are wrong, because a column meant something other than its name suggests.

How Query handles it: Query extracts the data context first with data-context-extractor, so queries use tables and columns the way they are meant to be used.

Waiting in the data team's queue

The problem: A simple question waits days for someone who knows SQL.

How Query handles it: Query writes and optimises the SQL with write-query and sql-queries.

Analysing data nobody looked at

The problem: Nulls, duplicates and odd distributions go unnoticed until the result looks strange.

How Query handles it: Query explores and profiles datasets with explore-data before any analysis.

How Query is tuned for the job

Query is not a general chatbot with a new name. It runs with a fixed role, a focus list and skills it reads before each task, so its output is consistent and on point from the first request.

What keeps it fast and accurate

  • Writes down the data context it learns, so the next query starts informed.
  • Explains what each query does in plain language next to the SQL.
  • Profiles the data before it concludes anything.

Its standing focus

  • Extract data context and write correct SQL.
  • Explore and profile datasets.

Skills it reads before a task

  • sql-queries
  • write-query
  • explore-data
  • data-context-extractor

Rules it always works by

  • Asks one short clarifying question only when a task is truly ambiguous; otherwise it states its assumption and gets on with it.
  • Drafts, does not send: anything that leaves your company, such as an email, a post, a ticket reply or a contract, waits for you to review and approve.
  • Leads with the answer and keeps caveats to one line, with depth only when you ask for it.
  • Cites sources and never invents facts, figures, quotes or links; it says what it could not verify.
  • Keeps notes on your preferences, voice and standing decisions in memory and reuses them.
  • Reads the relevant skill before a task the skill covers, and follows it.

What you can ask Query to do

Requests are written in plain language. A few examples:

  • Write SQL for monthly revenue by plan
  • Profile this customer table and flag data issues
  • Document what the columns in our orders table mean
  • Why does this query return duplicate rows?

Query's teammates in the Data Analytics Squad

Add Query on its own, or import the whole squad so each part of the work goes to the agent built for it.

Frequently Asked Questions About Query, the AI SQL Analyst

Which databases does Query work with?

Query writes standard SQL and adapts it to the dialect you use. It works from the schemas, exports and data you give it in the xSquads app.

Can non-technical people use Query?

Yes. Ask a question in plain language and Query writes the SQL and explains what it does, so you can check the logic.

How do I add Query to xSquads?

Open the xSquads app, go to Explore agents, find Query under the Data Analytics Squad and choose Add Query. Query joins your sidebar as its own chat with its skills ready. To get the whole team, import the Data Analytics Squad from Squad templates.

Put Query to work

Download xSquads, open Explore agents and add Query. Or have the xSquads team set it up for your team and tune it to how you work.

Download for Mac and Windows