Natural Language Is the Interface, Not the Semantic Layer
This is Part 2 of a two-part technical series. Part 1 showed how an Enterprise Data Discovery Assistant recovers legacy logic and produces grounded SQL. Rupak's article on AI-ready data products provides the larger context: agents need machine-readable semantics, active contracts, and engineering guardrails. This post follows the next step—from a business question to governed execution and an…
This is Part 2 of a two-part technical series exploring how an Enterprise Data Discovery Assistant helps users explore complex data without needing to understand SQL. The article builds on an AI-ready data product framework where agents require machine-readable semantics, active contracts, and engineering guardrails. While natural language allows users to ask business questions, it does not eliminate the need for proper data modeling. Instead, it makes good data modeling more visible.
The key insight is that natural language serves as the user interface, while the semantic layer explicitly defines analytical decisions like grain, metrics, time semantics, filters, and relationships. Snowflake policies manage access to results, and runtime contract checks ensure the data product is trustworthy before execution.
The process starts with the assistant identifying the user's intent and target domain. It then performs a mandatory contract check to evaluate factors such as data freshness, quality, and validation results before executing the query. The assistant interprets the question using a selected semantic view, which provides governed dimensions, metrics, relationships, filters, and example data needed to generate SQL.
The SQL runs within the governed data platform, with Snowflake privileges and data-protection policies still applying.
If the contract is active, fresh, and passing, the check remains behind the scenes, delivering a clean answer. However, a stale or degraded contract adds a warning, indicating the result may not be trustworthy. In extreme cases, the contract could result in a hard stop, preventing the query from being attempted. For higher-risk domains, a hard stop might be implemented instead of a warning.
The assistant uses a Routing Mode to handle cases where the semantic view cannot fully satisfy a request. It first attempts semantic SQL using the semantic view, but if coverage is insufficient, it can fall back to standard SQL on physical tables. This flexibility is valuable, but governed metrics should use a different confidence path, such as exposing the result for review, requesting clarification, or blocking the query for higher-risk questions rather than implying the same semantic guarantees.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.