“Right is right.” -- Doug Lemov, Teach Like a Champion
Right Is Right is one of Lemov’s classroom techniques: a teacher holds out for the fully correct answer instead of rounding a partly correct one up. Data answers deserve the same standard, because an almost-right number is the most dangerous kind.
Back in April, Paul Tibbitt (CEO of Ansira) wrote a piece for the Forbes Business Council, Why Context Will Define the Next Wave of AI Transformation. His argument: without deep, accurate context, even a strong AI tool falls short. He splits context into five parts: domain expertise, governance and rules, taxonomies and data models, operational patterns, and institutional knowledge. His world is partner marketing and ours is school data, but the list carries over almost one to one.
I agree with all five. What I want to add is that even when the context is right, the model still gets to improvise the most critical part of the journey to the answer: the query itself.
This post is about how we’re trying to get as close as we can to a 100% correct answer, 100% of the time, in Ponder DWE, the data platform for K-12 schools and networks we’re building at Ponder Labs. DWE is still being built. What follows is the design we’re working toward, the reasoning behind it, and how we plan to test whether it actually works -- not a tour of something you can install today. Most of the pieces underneath already exist as separate open-source tools and earlier posts here. DWE is where we’re putting them together on purpose.
A bit of foreshadowing: to hold out for the right answer, we’re adding governance layers that slow things down and, at face value, undermine the whole promise of agent-facilitated data analysis. We’ll look at the very real costs of being more agile with data, and why in education those costs are a non-starter.
The AI agent never writes SQL
The idea fits in one line: the AI agent never writes SQL. Analysts build dbt models, Cube references them, and the AI only assembles a GraphQL query against Cube’s typed schema. SQL comes out of a compiler, not a language model.
It’s a small-scale version of the separation of powers: humans make the rules, and agents execute them but aren’t allowed to make them up -- or override them.
A quick glossary before we start
This post leans on a lot of tool names. If some are new to you, here’s the one-line version of each. Every one of them has a fuller write-up on our blog, linked below.
dbt -- a framework where analysts write data transformations as SQL files, with tests, docs and version control built in. More: Trino + dbt: Simplifying ELT with Pure SQL
dbt model / mart -- one SQL file in a dbt project that builds one table. Marts are the final, cleaned tables people are meant to query. More: dbt Core vs dbt Cloud
Semantic layer -- one place where metrics like “active students” are defined, so every tool computes them the same way. More: The End-to-End Semantic Layer
Cube -- an open-source semantic layer. It holds measures (numbers you aggregate) and dimensions (things you group or filter by), and writes the SQL for you. More: dbt → Cube.js → Superset
dbt-to-cube -- our open-source tool that generates Cube’s definitions from a dbt project, so metrics are written once. More: dbt → Cube.js → Superset
GraphQL -- a query language with a typed schema: you ask for named fields, and anything not in the schema is rejected. More: From Semantic Layers to Conversations
Superset -- Apache Superset, the open-source BI tool we use for dashboards. More: Superset Doesn’t Know What Environment You’re In
The problem with text-to-SQL isn’t accuracy, it’s that it’s a different answer every time
We’ve spent a lot of time on English-to-SQL. Our Towards English-to-SQL that actually works post and my DataTLV talk are both about feeding the model dbt metadata so it stops guessing table names. That works. Give an LLM the dbt docs and it writes noticeably better SQL.
But “better” is the wrong bar for the data chat (the AI chat principals, teachers and network leaders use to ask about their numbers), and it took us a while to say why.
When a model writes SQL, it reconsiders and re-makes every decision a group of humans already made about how to define a metric -- the reviewed, agreed version of a number like “active students” that analysts write once in dbt:
which table is the source of truth (the mart, or the staging model that happened to be in context)
which join path (enrollments to students to schools, or straight to schools)
which filter defines “active” (enrolled today, enrolled at any point this term, or not withdrawn)
which grain to aggregate at, and whether to count distinct
Each of those is a place where two runs of the same question can diverge. Ask “How many active students do we have?” on Monday and on Tuesday, and you can get a different number each day, because the model picked a different reasonable definition of “active” each time. Neither query produces an error, and neither answer matches the Superset dashboard the principal opens right after, because the dashboard used the definition the analysts agreed on.
This is because in text-to-SQL, the model isn’t just answering the question, it’s defining the metric on the fly, once per question, with nobody reviewing it.
More context makes the improvised definition more plausible, but it doesn’t guarantee the model will use the agreed-upon definition, or even define it the same way twice.
The fix isn’t a better prompt. It’s removing the definition step from the agent’s workflow entirely.
How easy is it to pick the wrong column?
It’s fair to ask how often this actually goes wrong in practice. To get a feel for it, we looked at how crowded the namespace is in a real school network’s Redshift warehouse. We took every column and table name in the dbt-built schemas, ignored case, underscores and plurals, and grouped names that look nearly the same.
The warehouse has 74,515 columns across 4,000 tables, with 7,947 distinct column names. Those names fall into 877 groups of look-alikes, and 35% of all columns belong to one of them. School number alone shows up under 14 different spellings across 861 tables (school_number, schoolnumber, ps_school_number, school_number_key…), and the student identifier under 11 spellings across more than 1,100 tables (student_id, studentid, student_dcid, student_uid…). Tables aren’t much better: 933 table names exist in more than one schema, many of them copies left behind by development and testing.
Some of those look-alikes are the same thing spelled differently. Others, like weighted_gpa and unweighted_gpa, are different things that look almost the same. Either way, each one is a fork in the road for a model writing SQL. It’s a fork for people too: without a semantic layer, analysts and school staff hit exactly the same collisions. We’ve been pushing the networks we work with toward a semantic layer for almost as long as we’ve been using dbt. AI didn’t create the problem; hallucinations just made it impossible to ignore.
The chain: analysts define, Cube references, the AI only aggregates
The data chat runs on three layers, each with one owner, each doing only the thing it’s actually good at.
1. Analysts build dbt models. Definitions live where analysts already work: dbt marts with tests and docs. “Active student,” “chronically absent,” “below grade level” are SQL in a reviewed PR, tested on every build and described in YAML. This is where the semantic decisions get made -- once, by a person, in code review. It’s the same direction as our dbt_simple_metrics work and dbt’s own 1.12 semantic YAML: the metric lives next to the model it describes.
This is the step that makes everything downstream work, and it’s a human one on purpose. The analysts building these models know the domain: how the school network is organized, how terms and grading periods actually run, which assessment counts for what, why a student can be “enrolled” in two schools on the same day during a transfer. They turn that knowledge into golden data -- the curated, tested, documented layer that both the dashboards and the AI read from. Neither one ever goes below it.
That’s what makes the answers deterministic. Same question, same definition, same number, whether it shows up on a Superset dashboard or in a chat reply. Which is a funny thing to say in a post about AI -- the most deterministic part of the system is the part with an LLM in front of it, because all the judgment happened earlier, in a PR an analyst wrote and someone else reviewed.
2. Cube references the models. It doesn’t redefine them. dbt-to-cube generates Cube’s schema straight from the dbt project, so Cube isn’t a second place to define a metric. It’s a typed, queryable projection of what’s already in dbt. Superset reads the same definitions, so the dashboard and the chat can’t quietly disagree.
3. The AI composes a GraphQL query against Cube. Never SQL. The agent’s job shrinks to choosing: which measures, which dimensions, which filters, what time grain, what order. Cube compiles that choice into SQL using the joins and definitions from step 2 and runs it on the warehouse.
The top row changes slowly and goes through code review. The bottom row runs per question, and the only thing the AI contributes to it is a selection from a menu the top row wrote.
None of these pieces is new on its own -- we’ve written about each of them. What’s new in the DWE is the rule that ties them together: the model isn’t allowed to skip a layer. No direct warehouse connection, no “fall back to SQL if Cube can’t answer.”
What this costs, and why we pay it in education
This chain isn’t free, and in plenty of domains I wouldn’t recommend it. But in education, what looks like a constraint is actually a solid foundation that lets people act on the numbers freely.
More infrastructure. dbt, dbt-to-cube, a Cube deployment and its GraphQL API, all kept in sync. Why we accept it: we already run dbt and Cube for dashboards. The chat reuses them instead of adding a parallel path.
Slower answers to new questions. A question nobody modeled yet waits days for an analyst, not seconds for a prompt. Why we accept it: school questions repeat. Attendance, assessments, enrollment and behavior cover most of what gets asked, so modeling them once pays off all year.
Less room for exploration. No poking at raw tables, no one-off ad hoc analysis from the chat. Why we accept it: the people asking questions are principals and teachers, not analysts. Exploration belongs with the data team, who understand the nuances of how the data is collected. Exploring data without that context is like exploring a new city full of blind alleys without a map. (Natural-language exploration for analysts is a different tool with different rules -- more on that in a later post.)
Definitions change slowly. Tweaking what “chronically absent” means goes through a PR, not a sentence in chat. Why we accept it: a definition that changes per question is worse than one that’s slightly out of date. Networks need every school counting the same way.
Analysts remain a dependency. Chat coverage grows only as fast as the team ships dbt models. Why we accept it: that review step is exactly what we want between raw student data and a number someone is willing to act on.
Faster will lead to slower
The common thread is who reads the answer and what they do with it. In a lot of businesses, a chat answer that’s 90% right is a useful starting point for someone who’s trying to get a general temperature reading.
In a school network, the answer often goes straight into a decision about specific students: who gets a reading intervention, who gets flagged for attendance follow-up, and which cohorts school leaders focus on at the end of the term for the following academic year.
The person asking usually can’t validate SQL, and shouldn’t have to. And once they start feeling that the numbers need validating, it hobbles their ability to act on them -- and creates a far worse bottleneck, where every chat session can spawn a request for an analyst to double-check the answer.
How we’re going to test this
Everything above is a design bet, and we’d rather measure it than assert it. We’re setting up a head-to-head test: take a set of conceptual questions -- the kind principals and network leaders actually ask -- and run each one through two paths:
Text-to-SQL against Redshift. The agent gets the dbt docs and metadata and writes SQL directly against the warehouse -- the best version of the approach from our English-to-SQL work.
GraphQL against Cube. The agent sees only the semantic layer and composes a query over its measures and dimensions.
Each question runs several times on each path, and we compare:
Accuracy. Does the answer match the analyst-agreed number, the one on the Superset dashboard?
Consistency. How often do repeated runs of the same question return the same number?
Token cost. How many tokens each path spends per answered question, schema context and retries included.
How it fails. When a path gets it wrong, does it fail loudly (an error, or “not modeled yet”) or quietly (a plausible, wrong number)?
If the Cube path doesn’t win clearly on accuracy and consistency, the costs above stop being worth paying, and we’ll say so. Either way, we’ll publish the results.
Where this leaves us
Tibbitt’s piece ends on investing in structured knowledge: taxonomies, hierarchies, standardized data definitions that help AI understand how information relates. For a data platform, that structure already has a name. It’s the dbt project and the semantic layer on top of it. The work isn’t inventing new context. It’s making sure the AI reads the context analysts already wrote, and isn’t allowed to write its own.
That’s the separation-of-powers principle we’re betting on in DWE: people own the definitions, a compiler owns the SQL, and the model owns only the choice between them. As we build it, I’ll write up the pieces as they land -- the custom servers behind the data chat are next, and the chat for engineers working on the pipelines will get a post of its own.
Context engineering isn’t just about deciding what knowledge you bolt onto a model. It’s about designing a system that minimizes the model’s ability to override human judgment. Only then will the people using it have the confidence they need to act on what it tells them.
In a follow-up post I’ll go through the technical side: why the agent speaks GraphQL instead of SQL, where RAG fits, how governance lives in Cube, and where we expect this design to hurt.
Further reading
Sources:
Paul Tibbitt, Why Context Will Define the Next Wave of AI Transformation, Forbes Business Council, April 22, 2026
Cube, GraphQL API and GraphQL API reference
Doug Lemov, Teach Like a Champion -- teachlikeachampion.org





