Inspiration

Every company has its numbers in a data warehouse, but getting an answer out still needs someone who knows SQL. The managers who actually own the questions wait days for an analyst, and general chatbots will happily invent a number. We wanted plain-English questions with answers you can verify, not just trust.

What it does

DataMind lets anyone ask a question like "Compare India's internet use in 2015 and 2023" and get an answer computed by SQL in Snowflake, shown with:

  • the exact SQL that ran, the Snowflake query ID and the result rows
  • the calculation steps for comparisons and percentages
  • a clear refusal or a clarifying question when the request is ambiguous, unsafe or outside the data, instead of a guess

How we built it

  • Planner (Google Gemma): turns the question into a typed plan (metric, filters, grouping, limit) over the dataset's configured vocabulary. Gemma never writes SQL.
  • Validator (Python): checks the plan against an allowlist of tables, columns and limits.
  • Compiler (Python): turns the approved plan into parameterized SQL and does the comparison maths with exact decimals.
  • Snowflake: runs the query over a read-only key-pair connection with query tagging.
  • FastAPI + SQLite run store: keeps an audited history of every question, plan, query ID and answer.
  • Web UI: shows the answer beside its evidence.

Data: 18 real World Bank World Development Indicators for 217 countries (1990–2024), loaded into Snowflake, plus Snowflake's TPC-H SF1 sample data.

Challenges we ran into

  • Keeping a language model away from raw SQL while still handling comparisons, percentages and pooled averages.
  • Precision: our first live run caught a rounding bug in the comparison maths, which is why we moved to exact decimals.
  • Speed on a laptop: each answer needs two model calls. A cache of validated plans cut a repeated question from 16.1 s to 1.4 s, while SQL still runs fresh every time.

Accomplishments that we're proud of

  • 167 automated tests passing
  • 18/18 live evaluation checks against Snowflake, verified by independent answers
  • A design where every number in an answer traces back to a query and a result row

What we learned

Grounding beats prompting: once the model only chooses from a fixed vocabulary, the answers become auditable.

What's next for DataMind: Talk to Your Enterprise Data

  • Conversation memory for follow-up questions
  • Onboarding any company's Snowflake schema through config alone
  • Fully local deployment for regulated sectors (banking, healthcare) where data can't leave the premises

Built With

Share this project:

Updates

Submission history