Chat with your data. Natural language → SQL → instant results. No backend required.
QueryMind lets you query a database using plain English. Type a question like "Show me the top 10 customers by total spend" and it:
- Sends your question + database schema to Claude (claude-sonnet-4) via the Anthropic API
- Gets back a precise SQL query
- Runs it instantly in-browser using sql.js (SQLite compiled to WebAssembly)
- Displays the results in a clean, sortable table
Everything runs client-side — no server, no backend, no data ever leaves your browser (except the schema sent to Claude to generate the query).
- 🤖 AI-powered SQL generation via Claude Sonnet 4
- 🗄 3 sample databases — RetailCo, HR Corp, StreamDB
- 📂 Upload your own
.sqlfile to query custom data - 💬 Multi-turn chat — ask follow-up questions in context
- ⚡ SQL inspector — view, copy, and re-run generated queries
- 📱 Mobile-responsive layout
- 🔑 API key stored locally — never transmitted to any server other than Anthropic
- 🎨 Dark industrial design built for showcasing
- Fork this repository
- Go to Settings → Pages → Source → Deploy from branch (main)
- Visit
https://your-username.github.io/querymind - Enter your Anthropic API key in the sidebar
# Clone the repo
git clone https://github.com/your-username/querymind.git
cd querymind
# Serve with any static server (required for sql.js WASM loading)
npx serve .
# or
python3 -m http.server 8080
# or
php -S localhost:8080Then open http://localhost:8080.
⚠️ Important: You must serve via HTTP, not openindex.htmldirectly from the filesystem. Thesql-wasm.wasmfile requires HTTP to load correctly.
- Sign up at console.anthropic.com
- Go to API Keys and create a new key
- Paste it into the QueryMind sidebar — it's saved to
localStoragein your browser only
E-commerce platform data with customers, orders, products, and order items.
| Table | Description |
|---|---|
customers |
80 customers with segments, lifetime value, location |
products |
15 products across 8 categories with pricing |
orders |
~400 orders with status, totals, dates |
order_items |
Line items with product, quantity, price, returns |
Try asking:
- "What's the average order value by customer segment?"
- "Which product category has the highest return rate?"
- "Show customers who haven't ordered in the last 90 days"
Human resources data for a mid-size company.
| Table | Description |
|---|---|
departments |
7 departments with budgets |
employees |
~75 employees with salary, level, hire date, performance |
reviews |
2 performance reviews per employee |
Try asking:
- "Show average salary by department"
- "Which employees have the highest performance scores?"
- "How many employees were hired each year?"
Streaming video platform data.
| Table | Description |
|---|---|
users |
120 users across plans (Free/Basic/Standard/Premium) |
content |
20 shows and movies with genres, ratings |
watch_history |
Viewing events with completion and watch time |
Try asking:
- "What are the top 5 most-watched shows?"
- "What's the completion rate by genre?"
- "Show monthly active users for the last 6 months"
- Export your database schema + data as a
.sqlfile - Click 📂 Upload SQL in the sidebar
- Start asking questions!
Example minimal SQL file:
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT,
email TEXT,
plan TEXT,
created_at DATE
);
INSERT INTO users VALUES (1, 'Alice', 'alice@example.com', 'pro', '2024-01-15');
INSERT INTO users VALUES (2, 'Bob', 'bob@example.com', 'free', '2024-02-20');┌─────────────────────────────────────────────┐
│ Browser │
│ │
│ ┌──────────────┐ ┌─────────────────┐ │
│ │ Chat UI │───▶│ Claude API │ │
│ │ (HTML/CSS) │ │ (Anthropic) │ │
│ └──────────────┘ └────────┬────────┘ │
│ │ │ SQL Query │
│ │ ┌────────▼────────┐ │
│ └───────────▶│ sql.js │ │
│ │ (SQLite WASM) │ │
│ └────────────────┘ │
└─────────────────────────────────────────────┘
No backend. No database server. Everything runs in the browser.
Great question! MCP (Model Context Protocol) is powerful for connecting Claude to real databases from a server-side context. However:
| Approach | Hosting | Real DB | Setup |
|---|---|---|---|
| QueryMind (this) | GitHub Pages, Netlify, Vercel, anywhere | sql.js in-browser | Zero — just static files |
| MCP backend | Requires Node.js server | PostgreSQL, MySQL, etc. | Server + MCP config |
For a public demo or portfolio piece, the client-side approach is ideal. For a production tool with real database access, you'd combine this UI with an MCP server or a backend API proxy.
If you want to connect to a real PostgreSQL or MySQL database, here's the upgrade path:
-
Add a backend proxy (Node.js/Express or Python/FastAPI) that:
- Accepts the natural language question
- Calls Claude with your real schema
- Executes the generated SQL against your actual DB
- Returns results as JSON
-
Or use MCP with:
Claude → MCP Server → PostgreSQLSee the Anthropic MCP docs and community MCP servers for PostgreSQL/MySQL.
querymind/
├── index.html # App shell
├── css/
│ └── style.css # All styles (dark industrial theme)
├── js/
│ ├── databases.js # Sample database definitions + seed data
│ └── app.js # Main app logic: API calls, SQL execution, UI
└── README.md
In js/app.js, find:
model: 'claude-sonnet-4-20250514',Replace with any Claude model you have access to.
In js/databases.js, add a new entry to the DATABASES object following the existing pattern:
mydb: {
name: "My Database",
description: "...",
suggestions: ["Question 1", "Question 2"],
schema: `CREATE TABLE ...`,
seed: () => `INSERT INTO ...`
}Then add a button in index.html:
<button class="load-btn" data-db="mydb">🏢 My DB</button>In js/app.js, edit systemPrompt inside generateSQL() to tune the AI's behavior.
- Your API key is stored only in your browser's
localStorage - Your database contents never leave your browser — only the schema (table/column names) is sent to Anthropic to generate SQL
- No analytics, no telemetry, no external requests except to Anthropic's API
MIT — do whatever you want with it.
Built with:
- Claude — AI SQL generation
- sql.js — SQLite compiled to WebAssembly
- Google Fonts — Syne, JetBrains Mono, DM Sans
Made with ⬡ QueryMind