Query Formula Generator
A hackathon prototype that turned plain-English questions into query formulas by constraining an LLM with query-engine context.
Overview
Some report and monitor work depends on writing query formulas over product data. The hard parts are joins, field discovery, and formula shapes that fail only after you try to run them. People who need a formula usually ask a teammate, dig through examples, or ask for the data over Slack.
For the August 2025 hackathon, I built a prototype that takes a plain-English description and generates an inspectable query formula. Ask something like "employees hired in the last 90 days with admin access" and the demo returns a formula you can inspect.
What I built
I supplied the LLM with query-language grammar, common joins, field constraints, and known failure cases from the query engine. The aim was to give it the information it would otherwise have to guess, particularly which fields existed and which joins or formula shapes were valid.
This fit a hackathon window because I already knew the query engine's common failure modes from working with it. I could put that context into the prompt and have the demo return a formula for someone to inspect, rather than hiding the generated query behind an answer.
Outcome
- The demo worked end to end from plain-English input to inspectable query output with query-engine constraints.
- The prompt brought query-engine grammar, joins, fields, and known failure cases into the generation step.
The next question would be how reliably those constraints helped across a broader set of requests, including ones the prompt had not anticipated. The hackathon established an authoring workflow to explore; it did not establish production query accuracy.