Ai4
Traditional semantic layers fail to validate novel business questions, necessitating version-controlled ontologies as code to achieve automated verification in AI data loops.
AI-assisted summary of The Analytics Factory: Building the Machine That Understands Your Business With TextQL — original source. Check the original for full context.
Source published:
Detailed notes
## Background Published on YouTube by the Ai4 channel on August 19, 2026, this presentation features Benjamin Shi, VP of Growth & Strategy at TextQL. According to the page description, the talk examines the concept of the analytics factory, explaining how ontology as code serves as the blueprint for AI agents and why automated verification is the critical bottleneck in AI analytics.
## TL;DR The presentation argues that the modern data stack functions like a slow, manual assembly line that lacks effective verification loops for business logic. While software engineering has advanced into automated 'loop engineering' using compilers and automated testing, data analytics still relies on human spot-checks for semantic correctness. By implementing an 'ontology as code' framework—operationalized through TQL files—organizations can establish a true business compiler that automatically verifies entity grains, relationships, and business rules, enabling reliable AI-driven analytics factories.
## Atmosphere & style The presentation carries a sharp, authoritative, and forward-looking tone characteristic of an executive technical keynote. Shi delivers his insights with structured, logical precision, using clear conceptual diagrams to contrast software engineering paradigms with data analytics pipelines. Watching the talk feels like an intellectually engaging architectural briefing that demystifies current AI limitations while offering a systematic blueprint for modern enterprise data infrastructure.
## Key takeaways - [00:08](https://www.youtube.com/watch?v=KDms50mACvY&t=8s) Software engineering paradigms evolved rapidly from Prompt Engineering in 2023 to Loop Engineering in 2026, focusing on validating LLM output and iteratively executing tasks. - [00:08](https://www.youtube.com/watch?v=KDms50mACvY&t=8s) The four-step execution cycle for software loops consists of Assemble Context, Act, Verify, and Decide. - [01:48](https://www.youtube.com/watch?v=KDms50mACvY&t=108s) Automated verification is the core unlock that enables autonomous software loops and transforms development into a software factory. - [01:48](https://www.youtube.com/watch?v=KDms50mACvY&t=108s) Software development is transitioning from 'Lit Factories' (with human inspection) toward 'Dark Factories' (fully automated end-to-end execution without human intervention). - [03:14](https://www.youtube.com/watch?v=KDms50mACvY&t=194s) The modern data engineering stack operates as a rigid, manual assembly line without feedback loops, requiring new datasets to restart the entire pipeline from scratch. - [04:34](https://www.youtube.com/watch?v=KDms50mACvY&t=274s) Data loops fail because standard query verification checks syntax and execution, but lacks automated verification for semantic definitions, grain alignment, and business intent. - [04:34](https://www.youtube.com/watch?v=KDms50mACvY&t=274s) Traditional semantic layers act as closed-world systems that only validate pre-defined, anticipated metrics rather than answering novel, exploratory questions. - [07:15](https://www.youtube.com/watch?v=KDms50mACvY&t=435s) Ontology as code serves as a compiler for business meaning, structuring entities/relationships, business logic, and population constraints to verify arbitrary queries. - [07:15](https://www.youtube.com/watch?v=KDms50mACvY&t=435s) TextQL integrates ontology into the execution loop during context assembly and post-execution verification to check join grains, metric definitions, and cardinality. - [10:13](https://www.youtube.com/watch?v=KDms50mACvY&t=613s) Ontologies can be auto-compiled by ingesting existing data artifacts, query logs, BI definitions, and documentation, updating dynamically as novel patterns emerge. - [10:13](https://www.youtube.com/watch?v=KDms50mACvY&t=613s) The TQL file format unifies plain-English documentation, executable logic, and warehouse-level access permissions into a single artifact to provide AI locality. - [10:13](https://www.youtube.com/watch?v=KDms50mACvY&t=613s) Structuring the ontology as version-controlled code in Git allows metric definitions to be managed via pull requests across complex enterprise data estates.
## Detailed walkthrough ### [00:08](https://www.youtube.com/watch?v=KDms50mACvY&t=8s) The Evolution of Software Engineering Loops
Ben Shi, who leads growth and strategy at TextQL, introduces himself and his background, having spent five years at Blackstone managing firm-wide data and AI infrastructure initiatives while serving as a venture partner with Snowflake Ventures. He posits that the dramatic transformation observed in software engineering over the last four years is about to strike the data field, though a critical missing piece currently stands in the way.
To illustrate this transformation, he traces the rapid progression of software engineering paradigms over recent years: * **2023:** *Prompt Engineering* — focused purely on crafting the right prompt for the LLM. * **2024:** *Context Engineering* — focused on shaping and expanding what the model knows. * **Late 2024 / Early 2025:** *Harness Engineering* — equipping models with tools and giving them the autonomy to execute tasks. * **Present (2026):** *Loop Engineering* — shifting focus from whether a model can perform a task to validating its output, feeding the result back into the system, and letting it execute iteratively.
Every software loop follows a four-step execution cycle:
``` +-------------------+ +-------------------+ | Assemble Context | --> | Act | +-------------------+ +-------------------+ | v +-------------------+ +-------------------+ | Decide | <-- | Verify | +-------------------+ +-------------------+ ```
- **Assemble Context:** Gathering relevant files, specifications, and context. - **Act:** Writing code and invoking API calls. - **Verify:** Checking the output for syntax errors, structural defects, or behavioral mismatches. - **Decide:** Determining whether to retry, pay, or ship to production.
---
[01:48](https://www.youtube.com/watch?v=KDms50mACvY&t=108s) Software Verification and Factory Autonomy
The third step—**Verify**—is the foundational unlock that makes the entire autonomous software loop possible. Models were capable of writing code long before anyone trusted them to do so in production. The key difference in software is that the discipline spent 50 years making the question "Is this correct?" cheap, automated, and machine-checkable. Compilers automatically catch structural errors, automated tests verify behavior against intent, and the vast majority of flawed outputs die inside the loop before a human ever sees them.
When this verification loop is executed thousands of times across tasks, it transforms software development into a software factory. Borrowing terminology from modern manufacturing, Shi draws a distinction between two operating models: - **Lit Factory:** Human operators remain on the floor. While autonomous agents and machines execute the work, a human manually inspects and reviews whatever survives the automated verification gates before deployment. - **Dark Factory:** Operates with the "lights off"—zero human involvement on the floor because the automated end-to-end verification process is entirely trusted.
Most software engineering teams currently run "lit" factories where developers review what passes automated testing, but the industry trajectory points firmly toward running darker factories as verification quality improves.
---
[03:14](https://www.youtube.com/watch?v=KDms50mACvY&t=194s) The Modern Data Stack's Manual Assembly Line
When contrasting software development with data analytics, the modern data engineering pipeline resembles a fragmented, highly manual assembly line rather than an automated factory.
``` +------------------+ +------------------+ +------------------+ +------------------+ | Centralize Data | --> | Model into | --> | Write Semantic | --> | Wire to MCP / | | (Months/Quarters)| | Marts (Medallion| | Layer (Manual) | | Hope Agent Works | +------------------+ +------------------+ +------------------+ +------------------+ | ( NO FEEDBACK LOOP) <---------------------------+ ```
Before an organization can query a new dataset, it traverses four rigid steps: 1. **Centralize Data:** Ingesting and centralizing raw datasets, which routinely takes months or quarters. 2. **Model into Marts:** Structuring data through medallion architectures (bronze, silver, gold layers) into data marts. 3. **Write Semantic Layer:** Data analysts or AI engineers handwrite metric definitions one by one. 4. **Wire to MCP:** Exposing the semantic layer to Model Context Protocol (MCP) servers and hoping an AI agent interprets it correctly.
Every stage and handoff requires manual human effort and consumes real calendar time. Crucially, no feedback loop exists—learnings from a single dataset do not make the next dataset any easier or faster to process, forcing every new data request to start back at step one.
---
[04:34](https://www.youtube.com/watch?v=KDms50mACvY&t=274s) The Verification Failure in Data and Semantic Layer Limits
Analyzing why software loops closed while data loops failed reveals a fundamental gap in verification gates. In a standard SQL query lifecycle: - **Syntax Check:** Verified by a gate (Pass). - **Execution Check:** Verified by a gate (Pass). - **Table Structure Check:** Verified by a gate (Pass). - **Semantic Definitions** (e.g., Is "active customer" defined correctly?): Unchecked / Dashed gate. - **Grain & Join Alignment:** Unchecked / Dashed gate. - **Intent Mismatch** (Did it actually answer the business question?): Unchecked / Dashed gate.
``` Query ---> [ Syntax ] ---> [ Execution ] ---> [ Table Form ] - - -> [ Semantic Def ] - - -> [ Join Grain ] - - -> Decision (Pass) (Pass) (Pass) (Unchecked) (Unchecked) ```
Because semantic gates have never been automated, the only check between a running query and an executive business decision is a human looking at a dashboard and declaring, "That looks right to me." This is not merely a maturity gap; data analytics has historically lacked a true compiler for business meaning.
While semantic layers act like data contracts that verify predetermined metrics well (e.g., approved metrics like `revenue by region` or `churn rate`), they operate as **closed-world systems**. They only validate questions that engineers anticipated in advance. When a business user asks an exploratory, ad-hoc question outside the catalog—such as *"What is our margin by cohort, excluding pilots?"*—the semantic layer does not fail loudly; it simply has nothing to say.
In contrast, a true compiler does not store a list of pre-approved programs. It encodes the underlying rules of the language itself, enabling it to check and validate completely novel programs it has never encountered before.
- Traditional semantic layers provide a static list of pre-approved answers. - A true business compiler provides rules against which *any* novel answer can be algorithmically verified.
---
[07:15](https://www.youtube.com/watch?v=KDms50mACvY&t=435s) Ontology as Code: A Compiler for Business Meaning
To solve this gap, enterprise analytics is shifting toward ontologies—a mechanical, formal type system for business operations. An ontology acts as a compiler across three structured layers:
1. **Entities & Relationships:** Pre-declares entity grains and cardinalities, preventing fan-out joins that silently double revenue numbers. 2. **Business Logic as Rules:** Establishes composable definitions (e.g., defining "active customer" through explicit rule constraints rather than saved queries), stopping AI agents from inventing metrics on the fly. 3. **Constraints & Population Filters:** Enforces valid populations, unit conversions, and regional filters that any valid query must respect.
Applying this ontology compiler inside the 4-step loop (**Context $\rightarrow$ Act $\rightarrow$ Verify $\rightarrow$ Decide**) provides the missing automated verification mechanism.
``` +-----------------------------------------------------------------------------------+ | TextQL Ontology | | +------------------------+ +-------------------------+ +--------------------+ | | | Entities/Relationships | | Business Logic & Rules | | Constraints/Filters| | | +------------------------+ +-------------------------+ +--------------------+ | +-----------------------------------------------------------------------------------+ | (Context In) ^ (Verify Out) v | +------------------+ +------------------+ +------------------+ | Assemble Context | -----> | Act | ---------> | Verify | +------------------+ | (SQL/Python Push)| | (Check Grain/ | +------------------+ | Joins/Rules) | +------------------+ | v +------------------+ | Decide | | (Dashboards/Apps)| +------------------+ ```
TextQL operationalizes this via two main integration points: - **On Context Assembly:** Supplies the tables, lineage, and domain definitions an AI agent needs to interpret a query. - **On Verification:** Validates the generated SQL's join grain, metric definitions, and cardinality against the business model on every single pass before passing results to dashboards, playbooks, or data apps.
---
[10:13](https://www.youtube.com/watch?v=KDms50mACvY&t=613s) Self-Building Ontologies, TQL Files, and Portability
Building an ontology does not require an expensive, manual greenfield modeling project. TextQL's engine auto-compiles the ontology by ingesting existing raw enterprise artifacts—warehouse schemas, historical query logs, BI tool definitions, and internal documentation accumulated over years.
As queries are executed, the ontology learns dynamically. When definitions drift or novel query patterns emerge, agents propose ontology updates that a human admin can review and approve, shifting human labor from manual pipeline maintenance to managing the analytics factory.
The atomic building block of this ontology is a file format called **TQL**.
``` +------------------------------------------------------------------+ | TQL File | |------------------------------------------------------------------| | 1. Plain-English Documentation (Semantic meaning & parameters) | | 2. Executable Logic (Parameterized SQL) | | 3. Warehouse-Level Access (RBAC & Security permissions) | +------------------------------------------------------------------+ ```
Traditional data stacks scatter these elements across disparate systems—documentation lives in a wiki, business logic in BI tools, and permissions in database settings. TQL unifies all three into a single file artifact, providing "AI locality" where human reviewers and AI agents evaluate meaning, code, and access control in one place.
Because TQL structures the ontology as code files, it integrates with modern software toolchains: - Version-controlled in Git repos. - Metric updates (e.g., redefining `active_customer`) ship via pull requests with peer review. - Highly portable across complex enterprise data estates (e.g., spanning 38,000+ disparate table columns across dozens of legacy systems).
- The ontology acts as a single centralized abstraction layer compiling downstream into data models, pipeline configs, dashboards, data apps, playbooks, scheduled reports, and autonomous agents. - Ben Shi concludes by referencing his technical article, *"Semantic layers are a patch. Ontologies are the fix,"* and invites attendees to connect at `benjamin@textql.com` or `she@textql.com`.
## Video description Benjamin Shi - VP, Growth & Strategy, TextQL
AI can build software faster. But that does not mean it builds better software.
The software industry’s answer is not better prompts. It's the software factory: a system built around better blueprints. Define what good looks like once, and AI can build toward it, test its work, and improve over time. The blueprint becomes the asset. The code becomes an output.
Data is next, but the modern data stack was built for an older model of analytics. It resembles an early assembly line: fixed stages, manual handoffs, fragmented context, and weeks of cycle time. It was built for questions you can anticipate, not for exploration that moves freely across the business.
The next model is the analytics factory. Its foundation is ontology as code: a single, version-controlled definition of the business that storage, pipelines, metrics, dashboards, playbooks, and agent workflows can all build from. Change the definition once, and the factory retools around it.
This talk explores what an analytics factory looks like in production: how the ontology becomes the blueprint AI agents work against, why verification rather than generation is the real bottleneck in AI analytics, and what it takes to move beyond a stack built for predetermined questions.
[Source](https://www.youtube.com/watch?v=KDms50mACvY)