- Home
- Skills
- Agents & Orchestration
- ChatWithDB
Works with the AI Agents you already use
ChatWithDB
Ask your database questions in plain English. A senior analyst in your field reads the schema, runs read-only SQL, explains the numbers, and stress-tests its own advice.
$1
ChatWithDB
Example session with this skill installed
I run a small coffee-gear shop. How much did we make in October, and what should I focus on next month?
- Read your context and instructions
- Compiled the chatwithdb
(Real run against the fictional sample shop included in the package: 180 customers, 759 orders.)
$10,981 from 86 orders in October, up 42% on September ($7,733 from 71 orders).
| Month | Orders | Revenue |
|---|---|---|
| 2026-07 | 73 | $9,011 |
| 2026-08 | 24 | $2,495 |
| 2026-09 | 71 | $7,733 |
| 2026-10 | 86 | $10,981 |
How it was counted: paid and shipped orders only; cancelled, refunded and 3 test accounts excluded; months in UTC.
⚠️ A naive query (join line items, sum the order total, no status filter) returns $29,859, almost 3× too high.
SELECT substr(o.created_at,1,7) AS month, COUNT(*) AS orders, ROUND(SUM(o.total),0) AS revenue
FROM orders o JOIN customers c ON c.id = o.customer_id
WHERE o.status IN ('paid','shipped') AND c.is_test = 0 AND o.created_at >= '2026-07-01'
GROUP BY month ORDER BY month;
What to focus on next month (after adversarial review)
Draft: Brewing gear drove October (+$2,420 vs September), so push brewing gear.
Critique: August (24 orders) is an outlier that inflates any growth story; brewing gear is a one-off purchase, while 84% of buyers (145 of 173) order again, mostly beans; one month of category data can't prove cause.
Revised recommendation (confidence: medium)
- Find out what happened in August before trusting month-over-month trends.
- Use brewing gear to acquire customers, and bundle a bean subscription with every kettle or grinder to keep them.
- Next month, compare first-order category against 90-day repeat rate to settle it.
Connects securely to your tools. The creator never sees your data.
About this skill
You have a database full of answers and no time to learn SQL. ChatWithDB turns your agent into a senior data analyst in your field (e-commerce, SaaS, clinic, logistics) who already knows your tables.
How it works
- Maps your database once. Crawls the schema and writes
db-map.md: every table in plain English, how they join, and a business glossary ("revenue = paid + shipped orders, excluding test accounts"). You confirm the guesses; it remembers them next time. - Answers in plain language. Number first, a small table if it helps, exactly how it was counted, and the SQL so you can check.
- Catches the classic mistakes. Join fan-out, cancelled and refunded orders, test accounts, timezones. In the example, a naive query overstates October revenue almost 3× ($29,859 vs the real $10,981).
- Stress-tests its own advice. Before telling you what to do, it runs an adversarial review (on a stronger model if your agent supports sub-agents) and shows what the critique changed.
Safe by design
- Read-only, enforced by the database where possible (
mode=ro, read-only transactions), not just by the prompt. Write statements are refused. - Credentials come from an environment variable or your database MCP server and never appear in chat.
- Limits and timeouts protect production; personal data stays aggregated unless you ask for specific records.
Works with PostgreSQL, MySQL/MariaDB, SQLite and SQL Server, through a database MCP server or the standard CLI. Includes a fictional sample shop so you can try it in a minute.
Works with Claude Code, Codex CLI, Gemini CLI, Cursor and other agents that can run shell commands.
Needs a working connection (database MCP server, CLI client or Python driver). Very large warehouses may need you to point it at the relevant schemas. Advice is only as good as the data; it says so when confidence is low.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 8 days ago
Permissions
Runs read-only SQL through your database CLI, driver or MCP server (shell). Reads the connection string from an environment variable. Writes db-map.md (schema map and glossary, no personal data) after asking. No other network calls.