How to make an LLM answer business-analytics questions reliably — Anthropic’s own production system, where 95% of analytics queries are automated at ~95% accuracy, freeing the data team for causal modeling and forecasting. The central, counterintuitive claim: accuracy is a context and verification problem, not a code-generation one. Source: How Anthropic Enables Self-Service Data Analytics with Claude.

Why analytics is harder than coding for an agent

This is the load-bearing insight. Data is not software.

Coding agentAnalytics agent
Solution spaceopen-ended, rewards creativityusually a single correct answer from a single source
Guardrailsdocs + tests catch hallucinationno deterministic way to prove correctness
Hard partwriting the codemapping the question to the right entity

Pointing Claude at a warehouse and letting it run produces a false sense of precision — it cuts stakeholders off from the documentation and expertise that used to steer them. Once you can map a user’s question to the correct, current entities, the SQL is trivial. So the whole engineering effort goes into that mapping.

The three failure modes

Everything in the stack exists to attack one of these:

  1. Concept ↔ entity ambiguity — hundreds of plausible fields; the agent picks the wrong one. (“Active users” — which actions? include fraud? what lookback?)
  2. Data staleness — definitions and schemas change daily; assets and agent knowledge rot into subtly-wrong answers.
  3. Retrieval failure — the right info exists and is annotated, but the agent doesn’t find it in a million-field space.

The stack — one layer per failure mode

Data foundations   → collapse ambiguity into ONE governed answer (+ first staleness defense)
Sources of truth   → resolve "weekly active users" to a specific governed entity
Skills             → reliably FIND and correctly USE that answer (retrieval)
Validation         → detect which failure mode is still leaking

Data foundations. Fewer, heavily governed canonical datasets (single source of truth, clearly owned, near-duplicates aggressively deprecated). Enforced by tooling + CI + mandate — governance without enforcement decays back to “forty plausible candidates.” Colocate all data code in one repo so a modeling change and its dashboard/doc fix ship in the same PR. Treat metadata as a first-class product: a warehouse can be as legible as a well-documented codebase, but only if descriptions, grain, lineage, ownership, and tiering are maintained with the same rigor as the transforms. (This is Agent Legibility applied to a data warehouse — “what the agent can’t see doesn’t exist.”)

Sources of truth, in descending trust: semantic layer (compiled metric definitions → the agent calls a function and gets one number; agents are structurally required to try it first) → lineage graph (which governed model feeds a concept) → query corpus (distilled into reference docs, not read raw) → business context (a company knowledge graph so the agent resolves “the Q2 launch” and asks better clarifying questions — the layer most teams skip). The recurring enemy across all four is stale documentation; Claude drafts the docs, humans own the definitions.

Skills carry the procedural knowledge and did the heavy lifting: without skills, accuracy capped at 21%; with them, 95%+ aggregate, ~99% in some domains. Two paired skills: a knowledge skill (a thin router — “semantic layer first; else these ~30 reference files”) that is the answer to retrieval failure, and an unbook skill encoding a senior analyst’s process (clarify → find → query → adversarial review sub-agents) plus reusable patterns. This is exactly the fat-skills / resolver-router architecture, and the skill-writing discipline of Skillify - Meta-Skill Pattern.

The broader prerequisite: agent-ready data

Making Your Data Ready for Agentic AI generalizes this production analytics stack to agents that also query live systems and take actions. The two sources agree that structure, not model capability, is the bottleneck. The broader architecture adds four controls that Anthropic’s analytics case study leaves implicit:

  • Contracts as code — strict schema, quality rules and consumer-specific freshness SLAs. Freshness is keyed to the last successful load, not the last business-value change.
  • Quarantine before access — failed or stale records never reach the agent-facing tier. For RAG, the same rule applies to chunks, extraction quality and the last successful index rebuild.
  • A three-part context layer — domain model (entities and relationships), semantic model (compiled metrics) and capability model (governed reads and actions). Anthropic’s semantic layer is the middle part; acting agents need the other two as well.
  • Agentic lineage — provenance footer at answer time grows into a trace of sources, live checks, rules, approvals and actions when the agent can change state.

The practical synthesis is: Anthropic shows how to make an analytics agent accurate; Sadalage and Chandrasekaran show what has to surround the data before that agent can be trusted to act on it.

The two findings worth remembering

1. The bottleneck is structure, not access (a null result that redirected months of roadmap)

They gave the agent grep access to thousands of prior SQL files and verified it read them — accuracy moved <1 point. The answer was in the corpus ~80% of the time, and “answer present” didn’t predict “gets it right.” The information was there, the agent saw it, and still didn’t use it. The bottleneck wasn’t access to prior work, it was mapping a question to the right entity. This is a textbook ablation and a case for designing experiments expecting null results — see Evaluating AI Agents.

2. Skill docs rot — maintenance is an engineering problem

Offline accuracy drifted from ~95% to ~65% in a month before they colocated skill markdown with the models and added a CI hook flagging any model change that doesn’t touch a skill file. Now ~90% of data-model PRs include a skill change in the same diff. Plus an active correction-harvesting agent that scans Slack every few hours, drafts a one-line doc fix, and opens a PR. This is Golden Principles and Garbage Collection for a data warehouse: mechanical rules + recurring background agents that pay down drift continuously.

Validation, three layers deep

  • Offline evals — Q/A pairs (dashboard-based + long-tail), anchored to snapshots so they can’t drift, stored like telemetry (skill version, git SHA, model ID, per-assertion pass/fail) so “did that change help?” is a query. Gate each domain’s launch at ~90%.
  • Ablation — vary one component against a fixed eval set; deltas in the PR description keep “I improved the docs” honest.
  • Online validation — adversarial-review skill (+6% accuracy for +32% tokens, +72% latency — a concrete cost/accuracy trade), a provenance footer (source tier · freshness · owner) so consumers can judge trust, passive monitoring (% resolved via semantic layer, % responses with correction language).

The silent failure — wrong but plausible and used unchallenged — is the one nobody has fully solved; mitigations are the provenance footer, human sign-off on leadership-bound answers, and a daily KPI sanity-check against the blessed dashboard.