
Follow Maya as she retrofits a messy data estate from naive text-to-SQL to a single governed metric of net revenue, using a five-stage ladder, a semantic layer, and MCPE governance.
Explain three naive approaches—buying a bot, fine-tuning a model, and loading the full schema—and show they fail to capture encoded revenue meaning; the solution is a truth layer.
Trace the journey of a question through five hops—from intent to return—and see how a semantic layer and MCP standardize the agent-to-tool hop, adding guardrails for governance.
Assess your data warehouse against the agent-readiness ladder, from raw schema to a governed MCP. See a five yes-or-no-question demo that shows how semantic layers and governance elevate your readiness.
Examine how a text-to-SQL bot hallucinates a join in a star schema, inflating revenue fourfold, and learn diagnostics across five failure modes for reliable analytics.
Identify the five failure modes—wrong join, wrong grain, fanout, ambiguous metric, and the silent wrong answer—and learn how a semantic layer and text-to-sql prevent them.
Pasting the schema into a prompt creates noise that degrades accuracy, as lost in the middle and misaligned relationships emerge; a semantic layer provides a curated, governed description of business.
Prevent silent wrong answers by enforcing a single governed semantic layer that both BI tools and agents read, aligning meaning, joins, and grain to real churn metrics.
The missing semantic layer translates business meaning to SQL, creating a single source of truth where one metric definition updates all dashboards and agents with consistent net revenue results.
Define the three nouns: entities, dimensions, and metrics, within a semantic layer to anchor joins, ensure deterministic queries, and prevent guessing, using business terms like region and net revenue.
Build a join graph to encode relationships once; declare edges with keys and cardinality, so the semantic layer only traverses known joins, delivering deterministic, fanout-free results.
Decide where logic should live: use raw SQL for one-off explorations, the BI layer for tool-specific measures, or the semantic layer for governance-friendly, agent-readable definitions that feed multiple consumers.
Define metrics once and serve them over SQL, GraphQL, REST, and a headless API, so every consumer reads the same numbers.
Unify revenue with a single metric defined once in a semantic model; map metrics, dimensions, and entities to one source of truth, while noting grain and additivity limits.
Encode metrics with correct grain and additivity in the semantic layer to prevent fanout traps in text-to-sql, using ratio, distinct count, and last-value aggregation.
Clarify metadata and synonyms to steer the agent toward the correct metrics and dimensions, turning descriptions into a memory map that anchors accurate, auditable queries.
Define time intelligence with a shared calendar to align all metrics and avoid hand-written windows, while deriving revenue year-over-year and rolling metrics that automatically compare periods.
Diagnose metric inflation from incorrect grain by tracing the join from orders to line items, model line revenue at the line-item grain, and validate with reconciliation tests in CI.
A single bad join can silently inflate totals when summing orders and line items. Encode one-to-many, many-to-many, and role-playing relationships in the semantic layer to prevent duplicates and anti-hallucination.
Encode relationships with declared cardinalities using one-to-many edges, many-to-one joins through bridges for many-to-many, and role-playing entities to keep date dimensions distinct.
Identify fanout and chasm traps that inflate sums and explode rows, and learn to pre-aggregate at the base grain within the semantic layer to prevent erroneous results.
Compare naive text-to-sql with the join graph in the semantic layer to compute revenue, and learn to aggregate at order grain to avoid fan out for electronics in Q3.
Compare five engines for an agent-ready data platform, distinguishing open, warehouse native, and BI native lanes, and learn how metric flow, MCP interfaces, and LookML shape portable, cost-aware decisions.
Construct and test the eight-dimension spine, scoring engines 1–5 on openness, agent and m c p, support, governance, multi-engine reach, cost, maturity, lock-in, and query pushdown.
See how reweighting eight decision axes flips the winner across three shops, highlighting native semantic views, the DBT semantic layer, and an open layer cube as context-driven solutions.
Defend your engine choice with a one-page decision record, using a five-section template—context, options, weights, decision, consequences—and map objections to dimensions.
Connect the warehouse with the semantic layer using dbt and meridian cube, scaffold both tracks in snowflake, enabling BI tools and LLM agents to query data without touching the warehouse.
Encode orders and line items at the correct grain to model the Meridian retail star, avoiding fan-out. Define revenue once as a governed metric across dbt, cube, and snowflake.
Expose metrics via the query interface demonstrates a single governed metric definition accessible through sql, rest, and graphql doorways, delivering identical results across dbt semantic layer, cube, and snowflake pushdown.
Validate known-good numbers by reconciling total revenue and units sold to a repeatable baseline, using coalesce to handle nulls and fix grain and join errors across slices.
Build and ground a semantic layer for Text-to-SQL and MCP-ready workflows, exposing SQL, GraphQL, and REST through an engine-agnostic, validated model grounded on a clean semantic model with metrics.
Show how a semantic layer grounds questions, enabling semantic queries to yield accurate results without raw joins and boost accuracy from 40% to 90%.
Grounding shrinks the model’s role to picking a metric, while the semantic layer holds validated joins and dimensions as an intent object that compiles into safe SQL.
Explore how the semantic layer compiler translates an intent like total revenue by store region into optimized sql by aggregating to the base grain before joining, preventing fanout.
Compare naive and grounded prompts for 20 questions, showing how grounded prompts prune scans, reduce tokens, lower credits per question, and cut error rates for a cost-effective data platform.
Identify and address the remaining 10 percent of failures in an agent-ready data platform by handling ambiguity, missing metrics, and novel questions through context engineering and honest declines.
Context is the new limiting factor; practice context engineering by retrieving the right metrics and examples through the semantic layer to boost accuracy.
Retrieval narrows 80 metrics to the few relevant ones by embedding labels, descriptions, and synonyms, then querying with the same model to produce accurate top five candidates.
Explore how few-shot exemplars generalize semantic queries by using diverse patterns, store them as question, query, pattern tag, and evolve a correction-driven exemplar bank in a version-controlled workflow for Meridian.
Disambiguation uses clarifying questions to avoid confident guesses. Explore three triggers—metric tie, missing time grain, and vague entity—and a gate that asks before compiling.
Diagnose metric confusion by reproducing the exact question, logging similarity scores, and fixing metadata in the semantic model to distinguish total revenue from revenue recognized.
Explore a four-part evaluation strategy—exact, execution, result, and semantic match—and learn why exact match is misleading, using Meridian data for deterministic, grounded assessments.
Build a custom eval set from your own questions by mining slack, BI logs, and bot failures. Label each case with the plain English question and its gold semantic query.
Use regression gates in CI to detect renamed columns and issues, with a structural parse and config validation gate plus a behavioral execution-accuracy gate gated by a frozen data snapshot.
Capture accuracy over time by logging each eval run to a results table and displaying a dashboard that tracks execution and semantic match, latency, and cost per question.
Your CEO just forwarded a conversational-analytics demo and said: "By Q3, anyone should ask our data in English and trust the answer." That mandate lands on the data platform — not the app team. This course is that retrofit, built end to end on a real, messy, mid-migration warehouse.
You will follow Maya, Head of Data Platform at a $2B retailer, as she makes an inherited Teradata-to-Snowflake estate safe for AI agents to query in plain English. You start by measuring why naive LLM text-to-SQL fails — hallucinated joins, three definitions of "revenue", confident wrong numbers — using a real evaluation harness. Then you fix it.
You design and author a semantic layer (metrics, dimensions, entities, a join graph) that grounds text-to-SQL accuracy from roughly 40% to roughly 90%. You choose a semantic-layer engine with a decision matrix — dbt Semantic Layer, Cube, Snowflake Semantic Views, Databricks Metric Views, LookML — and learn to defend the choice.
From there you make it production-grade: enforce governance at the semantic layer so agents inherit RBAC, row/column security, and PII masking instead of bypassing them. You build and secure a governed MCP server that exposes Snowflake, dbt, and Databricks to agents safely. You add guardrails against the $40K runaway query, then operate agentic analytics with tracing, cost control, and semantic-drift defense.
By the capstone you ship an agent-queryable platform and defend every decision against an 8-dimension architect's rubric. This is advanced, architect-level material for engineers who own the warehouse — not a prompt-engineering tour. You leave able to say "yes, safely" to the English-query mandate.