Ask your database in plain English. Get safe, checked SQL.
SQL Analyst turns business questions into read-only SQL over Postgres, shows the query it ran, and explains the result. Watch it work end to end, then try it yourself.
From a question to an answer you can check
Each answer passes through the same eight steps. The trail of steps is shown under every answer.
Find the right tables
Hybrid search over table and column descriptions, sample values and verified examples picks the context for the question.
Ask when it is unclear
If a question can mean several things, the agent asks one short question instead of guessing.
Write and check the SQL
Three candidate queries are written in parallel, and a parser-based guard allows only one read-only SELECT.
Run it and explain
Queries run read-only with a timeout and row cap. The answer comes back as a table, a chart and a short summary.
Built for people who need to trust the numbers
Every answer shows its SQL
The exact query that produced the numbers is one click away, with every candidate and repair in the inspector.
Three layers of safety
A SQL guard, a read-only database role and row-level security. A destructive query never reaches the database.
Row-level security per person
A regional manager sees only their state. Postgres enforces it from a signed session value, whatever the SQL says.
Repairs its own mistakes
When a query fails, the exact database error goes back to the model for a bounded number of repair rounds.
Learns from approved answers
A thumbs-up and a proposal send a query to an admin. Approved queries become examples for similar questions.
A catalog people can edit
Table and column descriptions, sample values and metric definitions in YAML, edited by admins and used in every prompt.
How the full system is designed
The full product runs as a set of services behind one origin. The public demo on this site runs on simulated data in your browser.
Three candidates, then a vote
Candidates that return the same result agree; ties go to fewer repairs, then shorter SQL. One bad generation does not decide the answer.
The guard re-renders SQL
Queries are parsed with sqlglot and re-rendered from the checked syntax tree, so what runs is exactly what was checked.
Streams survive a dropped connection
The run continues on the server; the browser reconnects by polling the run, so a flaky network does not lose an answer.
Definitions live in one place
Revenue, late delivery and the other metrics are defined once in a semantic layer, so every query uses the same meaning.
Questions people ask
Is this real?
The product is real: a FastAPI and LangGraph backend, Postgres with row-level security and a Next.js frontend, with tests and a Docker setup. This public page is a static demo. It plays scripted answers in your browser; the result numbers come from running the same queries on the public Olist dataset. Timings, tokens and cost shown in the demo are simulated.
Can I use it?
You can explore the demo workspace: ask any of the suggested questions, open the inspector, switch persona to see row-level security, and try feedback and approvals. Sign-ups are closed and nothing you do is saved.
What does it cost to run?
This demo costs nothing to run: it is static files with no backend, no database and no model calls. The full system runs on one server with Docker Compose and pays per model call, with a daily budget cap built in.
Has it been benchmarked?
Not yet. The evaluation harness (BIRD Mini-Dev, a golden question set and a safety red team) is built, but results with a real model have not been published. The Method page explains how it is measured.
Where is the code?
The code is in a private repository for now. Ask through the About me page if you would like to see it.
Who built it?
Tiju Lukose, as a portfolio project. The About me page has more about my work.
Built by Tiju Lukose
SQL Analyst is a portfolio project. More about my work, and how to reach me, is on my site.