Natural-language Q&A

OneAnalytics' Ask interface lets you type a question in plain English (or Hindi) and get a grounded answer — a chart, a number, and the compiled SQL — in a few seconds. Behind the scenes we use Claude (default: claude-sonnet-4-6) with the dataset's semantic model as tool context.

How it works

  1. Your question is embedded and matched against the workspace's datasets — we pick the most relevant.
  2. The semantic model for that dataset is injected into the system prompt: all dimensions, measures, grains, and RLS rules in structured form.
  3. Claude emits a QueryRequest (dimensions, measures, filters, grain) — never raw SQL.
  4. Our compiler binds it to the model, runs it, returns rows.
  5. Claude picks a visual type and composes a natural-language explanation of the answer.

Examples

You: What was revenue last quarter by region? OneAnalytics: ₹12.4 Cr across four regions — North leads with ₹5.1 Cr (+14 % YoY). [bar chart]. [show SQL]

You: Why did August revenue drop? OneAnalytics: August revenue fell 8 % vs July. The biggest contributor is the South region (-22 %), driven by the "Retail" channel (-31 %). [stacked bar].

Tool usage

Claude has access to three tools:

  • run_query(QueryRequest) — executes against a specific dataset, returns rows.
  • describe_dataset(dataset_id) — returns the semantic model as Markdown.
  • list_datasets(workspace_id) — enumerates available datasets.

We constrain Claude to these tools only — no internet, no code execution. Prompt caching is enabled (cache_control: ephemeral) on the system block, which makes the second question in a conversation ~4× cheaper.

Languages

Questions in Hindi, Bengali, Gujarati, Marathi, Tamil, Telugu, Kannada, Malayalam, Punjabi, and English all work. Answer language matches the question language by default; override with Settings → AI → Reply language.

Grounding

Every answer cites its data. Click Show SQL on any response and you see the exact compiled query. Click Trace and you see the tool-call sequence Claude took. No black boxes.

Confidence

Each answer carries a confidence estimate:

  • High — single dataset, unambiguous entity match.
  • Medium — disambiguation happened ("sales" matched both revenue and order_count) — we picked one and said so.
  • Low — entity not in any dataset, or the question doesn't decompose to measures/dimensions. We say "I can't answer this with your current data."

Privacy

The LLM never sees row data. It sees only: the question, the semantic model (schema-only, no values), and the row_count + sql_preview of tool results. Actual rows are rendered client-side.