Ask your BigQuery warehouse questions in plain English

A read only query console where anyone asks a question, sees the query and what it will cost, and nothing runs until a person clicks Run.

App
Google BigQueryGroqSlack BotOperationsEngineeringAI ReportsResearch & Monitoring
PromptCreate

I want an app that turns plain English questions into Google BigQuery queries, shows the query and what it will cost before anything runs, and never runs anything until a human clicks Run. The audience is non analysts: people who know the business question but not SQL. The data team has to be able to trust what is being fired at the warehouse, so hard read only guardrails and a full audit trail are part of the core product, not an afterthought.

The main page is the Ask screen. At the top there is a scope picker: a handler calls BigQuery List Datasets for the connected project to populate the dataset list, then BigQuery List Tables for each dataset the user selects, and BigQuery Get Table for the tables that end up in scope so the model gets real column names, types and descriptions rather than guesses. Below the picker is a plain text box where someone types a question like "how many trial signups converted to paid last month, broken down by plan". Read each dataset's location from List Datasets and reuse it on every job, otherwise cross region queries fail with a not found error.

When they click Ask, a handler sends the question plus the collected schemas to Groq Create Chat Completion and asks for a single GoogleSQL SELECT statement with fully qualified backticked table names, useLegacySql false, and a sensible LIMIT. Groq is the right engine here because drafting and redrafting is where latency is felt: the first draft should feel instant and a wrong draft should be cheap to fix. Render the SQL on screen in a read only code block with a "Regenerate with a hint" box so the user can nudge it ("only paid plans", "group by week") and get a fresh draft in a couple of seconds.

Before anything else happens, run the draft through a hard guardrail check on the server, not just in the UI. Reject anything that is not a single SELECT or WITH ... SELECT statement: no INSERT, UPDATE, DELETE, MERGE, TRUNCATE, CREATE, DROP, ALTER, GRANT or EXPORT, no scripting, no multiple statements chained with semicolons. If the model returns something that fails the check, show the rejection reason on screen and send it back to Groq for a redraft rather than silently patching it. The BigQuery connection should be set up with read only scope so the guardrail is belt and braces, not the only line of defence.

Then price it. A handler calls BigQuery Insert Job with a configuration.query body and configuration.dryRun set to true, and reads totalBytesProcessed off the returned statistics. BigQuery returns these numbers as JSON strings, so parse accordingly. Show the estimate next to the SQL in human units (GB or TB) plus a rough dollar figure using a per terabyte rate the admin sets. Two thresholds, both admin configurable: a warn line where the Run button gets a loud confirmation stating the scan size, and a hard ceiling above which Run is disabled entirely with a message telling the user to narrow the date range or the dataset scope. If the dry run comes back with a SQL error, surface the BigQuery error message and offer a one click fix that sends the error back to Groq.

Nothing runs automatically. The Run button is the only thing that executes. On click, a handler calls BigQuery Run Query (Synchronous) with the approved SQL and the dataset location. If the response comes back with jobComplete false, keep the jobReference and poll BigQuery Get Query Results until it completes; for anything expected to be slow, use Insert Job plus Get Query Results instead. Zip the returned row cells back to the schema field names and render a proper result table with column headers, sorting, and a CSV download.

Under the table, show a two line plain English readout. Send the SQL, the column schema and the first rows (capped so the payload stays small) back to Groq Create Chat Completion and ask for at most two sentences on what the numbers actually say, for example "Conversions were 312 last month, up 18 percent on the month before. Almost all of the growth came from the Pro plan." No hedging, no restating the question back.

Anything good should be reusable. A Save to library button stores the question, the final SQL, the datasets in scope and a short title into a shared library that everyone in the workspace can see. The Library page lists saved questions with who saved them and when they were last run, and each one has a Run button that goes back through the same dry run estimate and then waits for a human click, so the same weekly questions get rerun by anyone without rewriting anything. Saved questions can be edited and re-saved.

A History page logs every run: who asked, the question, the exact SQL that ran, the estimated and actual bytes scanned, the estimated cost, the duration, and whether it succeeded. Log blocked attempts too, including which guardrail blocked them, because that record is what makes the data team comfortable. Let people filter by person, by dataset and by cost, and show a running total of estimated spend for the current month at the top.

From any result, a Share to Slack button posts the question, the two line readout and the top rows as a formatted table into a channel the user picks, using Slack Bot Send a Message. Include the scan size in the message so the channel sees the cost alongside the answer.

Every result also has an Investigate this button that hands the question to a background agent defined inside the app. The agent takes the original question, the SQL and the result set and does what an analyst would do next: draft two to five follow up queries that break the number down (by segment, by week, against the prior period, filtered to the outlier rows), run each one through the same non SELECT rejection and the same dry run cost check with Insert Job in dryRun mode before executing it with Run Query (Synchronous), and stop early if it hits the admin's bytes budget for a single investigation. It then writes a short findings note, three to six bullets covering the numbers that mattered plus one line on what it could not determine, and saves that note back into the app so it shows on the question's page and in a Findings list. Show the agent's progress while it runs and list every query it ran with its own cost, so an investigation is exactly as auditable as a manual run.

An admin settings page holds the knobs: which BigQuery project to use, which datasets are selectable, the warn threshold and the hard bytes ceiling, the per investigation bytes budget, the dollars per terabyte rate used for cost display, and the default Slack channel. Everyone else sees these as read only context on the Ask screen so people know what the limits are before they run into them.

Design wise this should feel like a calm internal tool rather than a BI product. Stack the question box, the generated SQL and the cost estimate in one column so the read before you run flow is impossible to miss, and give the result table the full width below it.

What does this prompt do?

  • Type a question in plain English, pick which parts of your warehouse are in scope, and get a query drafted for you in seconds.
  • Every query is shown on screen with an estimated scan size and cost before it runs, and nothing touches the warehouse until someone clicks Run.
  • Results come back as a table plus a two line plain English readout of what the numbers actually say, ready to share straight to Slack.
  • Save good questions to a shared library so the same weekly checks get rerun by anyone, keep a full history of who asked what and what it cost, and hand any question to a background helper that digs into the follow ups and writes back a short findings note.

What do I need to use this?

  • A Google account with read access to the BigQuery project you want people to explore
  • A Groq account, which is what turns questions into queries and writes the plain English readouts
  • A Slack workspace if you want to share result tables with the team
  • A scan size ceiling you are comfortable with, since your data team usually has a number in mind

How can I customize it?

  • Set the scan size that blocks a query outright, plus a lower warning line that just flags it loudly before someone clicks Run
  • Choose which datasets non analysts can put in scope, and which stay out of reach entirely
  • Pick the Slack channel result tables get shared to, and set the price per terabyte used for the cost estimates

FAQs

Can this change or delete anything in my warehouse?
No. It only ever reads. Anything that is not a plain read only question gets rejected before it goes anywhere near your data, and the connection itself is set up with read only access, so there is no path to writing, dropping, or overwriting a table.
What stops someone running a hugely expensive query by accident?
Every query is priced before it runs. You set two lines: a warning line where the Run button shows a loud confirmation with the scan size, and a hard ceiling above which Run is switched off entirely and the person is told to narrow their date range or scope.
Do I need to know SQL to use this?
No. You type the question the way you would ask a colleague. The query is written for you, and it is shown on screen so anyone who does know SQL can check it before it runs.
Will my data team be able to see what people are running?
Yes. There is a full history of every question asked, the exact query that ran, who ran it, how much it scanned and what it cost. Blocked attempts get logged too, so the data team can see what people are trying, not just what got through.
What does the Investigate button actually do?
It hands the question to a background helper that behaves like an analyst would: it runs a handful of follow up questions to break the number down by segment, by week, or against the prior period, then writes a short findings note back into the app. Every query it runs goes through the same read only and cost checks and is listed with its cost.
Can I reuse the same question every week?
Yes. Save any question into the shared library and anyone on the team can rerun it without rewriting anything. It still shows the query and the cost estimate and still waits for a human to click Run.

Related templates

Share of voice dashboard for your brand and competitors

See how your brand's news coverage and sentiment stack up against four competitors, then let an assistant write the weekly report for you.

GDELT
Notion
Slack Bot
App
Approval war room for every social post awaiting sign-off

One screen showing every social post waiting on approval, sorted by deadline, so reviewers can approve or reject without leaving the page.

Hootsuite
Slack Bot
App
Turn champion job changes into new pipeline in Attio

Every Monday, find the past champions and closed-won contacts who changed jobs, update Attio, and get the moves worth chasing in Slack.

Boomerang
Attio
Slack Bot
Agentic Task
Collect social post requests and schedule them in Hootsuite

Staff submit what happened, your social manager edits the copy, picks the accounts and puts it on the calendar without a single spreadsheet.

Hootsuite
Slack Bot
General Input Database
App
Voice agent QA review board for your Hume EVI calls

Open one board each morning, see which voice calls went badly, replay the exact moment the caller got frustrated, and file the fix.

Hume
Linear
Slack Bot
App
Clear your Guru verification backlog in one weekly app

A personal queue of every overdue Guru card, sorted by how late it is, with one-click verify, reassign, comment, and an agent that drafts the refresh for you.

Guru
Slack Bot
App

Let anyone ask the warehouse, without anyone fearing the bill.

Give your team a read only query console where plain English questions turn into queries your data team can actually trust.