
Business teams often know the question they want answered before they know which table contains the answer. A natural-language analytics assistant can help bridge that gap, but only if its numbers come from actual queries and its query path is visible.
SyntaxLab's Ask Your Business demo lets a visitor ask questions about a sample distributor. The agent can run SQL against generated sample data, then present figures, findings, and a chart or table. The page also shows the SQL behind the answer.
Let the model plan; let the database calculate
The model interprets a question such as “Which region drove the revenue change?” and selects queries to investigate it. The database performs the aggregations. The model then explains the returned rows.
This distinction matters because language models are not calculators over a live business database. They may help choose a useful breakdown, but every numeric claim should be traceable to a query result. The demo's instructions explicitly require the agent to use SQL for every number and to say when the dataset cannot answer a question.
Make the query surface small
The demo exposes a run_sql tool that accepts a query and purpose, while its worker limits execution time and row count. The intended use is read-only SELECT and WITH ... SELECT queries against a constrained schema. That is a useful prototype boundary, but a production system should enforce read-only database permissions as well as application checks.
Never treat a prompt instruction as a database security boundary. Use a database account with only the necessary privileges, restrict accessible tables or views, validate query shape, cap time and returned data, and log what ran. OWASP recommends parameterized queries for application-supplied values and least privilege to reduce database exposure. OWASP SQL Injection Prevention
Show how an answer was produced
A useful answer should include its period, definitions, key figures, and query trail. Revenue and margin can mean different things across teams; the system needs an explicit metric definition and must use it consistently. When someone asks “why?”, it should break down the change by relevant dimensions rather than produce a speculative story.
The demo displays generated SQL and query results alongside the final answer. That helps a reader inspect whether the result matches the question. It does not replace data governance or analyst review.
Evaluate the complete path
Test representative questions for correct metric definitions, query selection, SQL safety, aggregation correctness, and faithful summaries. Include questions the data cannot answer. Evaluate the generated query and result interpretation separately: a correct query can still be summarized incorrectly, and a polished summary can hide a bad query.
Project evidence
This draft describes the implemented Ask Your Business demo in syntaxlab-backend/src/bi.ts and bi-worker.ts, with its chart and table interface in syntaxlab/src/routes/demos.dashboard.tsx. The dataset is fictional and generated for the demo; there is no evidence here of a connection to customer databases or validated business outcomes.