← Projects

AI / ML · Demo on a bundled dataset

AskSQL

Natural-language questions answered with guarded, read-only SQL.

In plain words. Ask a question about a database in plain English and get a chart and an answer. A safety check makes sure the computer only reads data and never changes it.

The problem

Generated SQL can parse and run yet answer the wrong question, join incorrectly, or touch data it should not.

What it does

A seven-stage LangGraph pipeline retrieves relevant schema and glossary context, generates SQL, validates it through a parser, executes read-only against a 15-table demo database, and returns a chart with the query and explanation.

Key decisions

  • Queries are parsed into an AST and checked structurally rather than filtered by keywords.
  • Schema retrieval falls back to reading SQLite directly when the vector store is unavailable.
  • Refinement retries are bounded.

Limits and status

  • Runs on a bundled demo database, not arbitrary enterprise data.
  • Read-only is necessary but not sufficient: resource limits and row-level permissions would be needed in production.