Building reliable self-service analytics without a human analyst in the loop is harder than wiring an LLM to SQL. Left on its own, an agent easily queries deprecated tables or copies stale join logic. A leading AI lab addressed these failure modes by redesigning its internal data stack specifically around agent consumption.

Warehouse Hygiene That Leaves Only One Canonical Answer

Accurate analytics agents start with zero ambiguity inside the data warehouse. Data teams first define canonical datasets, prune duplicate tables, and enforce code-level metadata standards so agents cannot pull numbers from abandoned schemas.

Keeping transformation SQL, the semantic layer, and reference documentation inside a single repository prevents silent drift. Whenever a data model changes, automated CI checks verify whether downstream dashboards or metadata definitions break before the commit lands.

Pairing a Semantic Layer with Business Context

Pointing an agent straight at raw warehouse tables invites join and filter mistakes. Directing queries through a verified semantic layer of governed metric definitions - enriched with organizational charts and product roadmaps - lets the agent interpret business intent accurately.

Indexing thousands of raw historical SQL queries rarely helps on its own. Internal evaluations showed that raw query retrieval failed to lift accuracy, whereas distilling recurring query patterns into curated domain guides produced consistent gains.

Teaching Procedural Workflows Through Markdown Skills

Knowing what each table means is only half the job; the agent also needs to know how to investigate a question step by step. Encoding tool execution order and disambiguation playbooks as Markdown skills gave the agent explicit procedural guardrails. Analytical accuracy, which hovered around 21-30% without skills, jumped sharply once those procedural skills were loaded.

Reliable self-service analytics depends less on raw model size than on disciplined warehouse curation, governed metrics, and explicit procedural skills.

Summary

  • Eliminating duplicate warehouse tables and enforcing CI-checked metadata in a single repository stops agents from querying stale schemas.
  • Routing queries through a governed semantic layer paired with business context outperforms raw historical SQL retrieval.
  • Loading Markdown skills that specify tool order and disambiguation steps lifts agent analytics accuracy sharply above the 21-30% baseline.