Read-only by default · open source

Ask your database anything.

Connect Postgres or MySQL and query in plain English. DBWhisper writes safe, read-only SQL, runs it, and shows the answer with a chart — no SQL required.

dbwhisper.app/app
Top 5 products by total revenue

Summary

Aeron Chair leads with $128,400 in revenue, followed by the Standing Desk at $96,220.

validation passed
SELECT p.name, SUM(oi.qty * oi.price) AS revenue
FROM order_items oi
JOIN products p ON p.id = oi.product_id
GROUP BY p.name ORDER BY revenue DESC LIMIT 5;
productrevenue
Aeron Chair$128,400
Standing Desk$96,220
Monitor Arm$54,900
Desk Lamp$31,050
Cable Kit$18,700

Measured, not claimed

Evaluated on a real golden set

Execution accuracy
82%Execution accuracy18 of 22 golden business questions returned the exact correct result set.
Fail-closed on unsafe input
100%Fail-closed on unsafe inputAll 4 unsafe or out-of-scope prompts were refused — never a hallucinated query.
Writes to your data
0Writes to your dataEvery query — generated or hand-edited — passes a read-only validator. Writes & DDL are always rejected.

Golden-set eval: 22 answerable + 4 unsafe / out-of-scope business questions, run end-to-end against a Postgres store with a read-only role. Execution accuracy = exact result-set match (order-insensitive), Spider-style.

How it works

From question to answer in three steps

1

Connect your database

Point DBWhisper at Postgres or MySQL with a read-only role. It introspects the schema and learns your tables.

2

Ask in plain English

“Top 5 products by revenue this quarter.” No SQL, no schema-hunting — just the question.

3

Get SQL + results you trust

It writes validated read-only SQL, shows it, runs it, and returns a table, a chart, and a plain-English summary.

Features

Everything you need to trust the answer

SQL you can read & edit

The generated SQL is always shown — and you can edit and re-run it, still through the read-only validator.

Auto-charts & summaries

Results come back as a sortable table, an auto-selected chart, and a one-line plain-English summary.

Conversational follow-ups

It suggests follow-up questions and keeps context across a session so you can drill in.

Multi-engine & exportable

Postgres · MySQL · SQL Server. Export any result to CSV, JSON, or Markdown in one click.

Architecture

What happens when you hit run

  1. You ask in plain English

    “Top 5 products by revenue this quarter.” No SQL, no schema-hunting — just the question.

  2. Relevant tables are retrieved

    pgvector

    Embedding similarity pulls only the tables your question needs, so the model sees a focused schema — not a 200-table dump. It scales to large databases and cuts invented columns.

  3. SQL is generated

    LangGraph agent

    A LangGraph agent writes the query, with automatic fallback across six LLM providers (OpenAI → OpenRouter → DeepSeek → Groq → Anthropic → Gemini).

  4. It’s proven read-only

    fail-closed validator

    Before anything runs, a deterministic validator inspects the SQL. Writes, DDL, and multi-statements are rejected — this is code between generation and execution, not a prompt the model can ignore.

  5. Run & explained

    The query runs on your read-only connection and returns a sortable table, an auto-selected chart, and a one-line plain-English summary.

Why it’s built this way

Schema-grounded, not schema-dumped

Instead of pasting your whole schema into every prompt, DBWhisper retrieves only the relevant tables via pgvector embeddings. Smaller prompts, fewer hallucinated columns, and it works on databases with hundreds of tables.

Fail-closed, not prompt-please

“Read-only” isn’t an instruction the model might ignore — it’s a deterministic validator sitting between generation and execution. If a query can’t be proven read-only, it never runs.

Six providers, always answers

If one provider is down or rate-limited, the agent falls through OpenRouter, DeepSeek, Groq, and Anthropic. Gemini’s free tier is always wired as the final fallback, so the live demo never goes dark.

Security

Read-only by default. Your data stays safe.

Read-only by construction

Every query — generated or hand-edited — passes a read-only validator. Writes, drops, and DDL are always rejected.

SQL shown before it runs

You always see the exact SQL before results. Nothing touches your data that you can't inspect first.

Least-privilege connections

Connect with a read-only database role; DBWhisper refuses to enroll a writable connection.

No black-box code execution

The model outputs SQL and structured JSON — never arbitrary code that gets executed on your server.

Query your data in plain English.

Try it on the built-in sample database — no signup required.

Open the console →