Skip to content

Use the TableAI database agent

The database agent investigates questions by searching your schema, running read-only queries and reading query plans. For questions that need several checks, it can start a deeper research step within the same conversation.

Set up a provider with the shared setup guide first. Then open chat on the database you want to investigate.

  1. Select Agent in the mode control beside the chat input.
  2. Describe the question and the result you need.
  3. Send the request.
  4. Review the read-access prompt if one appears.
  5. Read the answer and expand the completed steps to inspect its checks.

For example:

Find the five authors with the highest book sales last month. Use completed orders only and group sales by author ID. Show the query and explain how you handled books with several authors.

Use a read-only database account for production investigations. See production databases for account and connection preparation.

Read-only query results can contain private values and go to your selected provider. Review what AI sees before allowing reads. That page explains every Preview Consent choice.

If you decline read access, TableAI stops the current request. Choose Chat mode to continue from supplied context, or click Allow read access to reopen the prompt. Approval there repeats your last request in Agent mode.

The timeline shows each check as it starts, with its current status. Expand a step to inspect its SQL, results or error. When the answer starts, the timeline collapses; completed steps remain available in current and saved chats.

When the model supplies additional analysis, it appears under the collapsed Thought heading. Expand it if you want to follow that analysis.

Agent mode chat with a running database investigation and an expanded timeline

Click Stop to cancel an active request. Read any status or error before using a partial answer.

TableAI enforces read-only execution for the agent in the app. The agent returns writes, schema changes, permission changes and administrative SQL as proposals for you to review. It does not run them itself or automatically run EXPLAIN ANALYZE.

Inspect proposed SQL with the SQL review checklist. When you run it, your connection’s query guardrails apply.

Open Settings › Chat › Database Tools to adjust:

  • Preview Rows: the maximum rows fetched for a read-only preview, from 1 to 500; the default is 50.
  • Max Iterations: the maximum steps in a research investigation, from 2 to 20.

TableAI also limits database checks and the amount of result text. If a question needs more evidence, narrow it to one part and ask a follow-up. These controls limit work rather than provider charges; see cost control. For incorrect conclusions, see AI gives the wrong SQL.