10 Battle Scars from Building Agentic AI Analytics

Ramya6 Jul 2026

Problem

Teams that put an LLM in front of company data find that demo-grade text-to-SQL fails with real users. The same question gives different joins, dates and rankings on reruns. Business words such as "area" map to several columns. Answers differ between Slack and the main app, arrive slowly and cannot be traced to a plan.

Example from the article: "Area" means Region to Sales and Territory to Ops. "Market share for Product X in Q2 by region vs last year" returns different numbers on reruns.

Solution in brief

Treat the LLM as a proposer, not as the executor. It turns language into a typed plan, a validator checks the plan against the semantic layer and policies, and only then a compiler emits SQL. Ambiguity, caching, explanations, latency budgets and telemetry are all built around that plan artifact.

Questions this case answers
  • How to make an LLM agent that answers business questions over governed data return reproducible, auditable answers when the model's own output is stochastic
  • How to decide between guessing and asking for clarification when a business term has several valid mappings in the data model
  • How to make a chat analytics agent return the same governed answer to the same question on every run?
  • How to decide when an analytics agent must ask the user a clarifying question instead of guessing?

Tools and methods

  • Typed plan with a validator — the LLM proposes at temperature 0, a deterministic check normalizes dates, joins and metric–dimension pairs
  • Governed semantic layer — metrics, dimensions and business views with formulas, allowed pairings and synonyms
  • Ambiguity detector and clarification manager — stops and asks one question when candidates tie
  • Plan fingerprint caching — normalized plan plus model version as cache key
  • Replay harness and run-level telemetry — nightly reruns of fixed queries, one run id across all stages
  • Per-hop latency budgets — limits for planning, compilation, cache and warehouse execution
Continue reading — it's free

Google or a one-time email code. No password.