Beyond semantic models: "Domain context as code" for high-accuracy text-to-SQL
How to turn vague natural language questions into highly accurate semantic layer queries, improving both Text-to-SQL performance and overall data quality.
Overview
Text-to-SQL accuracy plateaus on questions tied to specific frontend actions that dbt semantic models don't capture. This session introduces "Domain Context as Code": YAML-based web access log measurement designs plus QA automation scenarios, merging dbt metadata with frontend ontology to turn imprecise questions into precise Semantic Layer queries.
What you'll take away
- 01
A text-to-SQL agent had access to the right data but still returned wrong answers because near-identical event names (tap reserve, tap reserve icon, show render) couldn't be reliably disambiguated from the data alone.
- 02
Rather than build a general-purpose ontology, Recruit Holdings took an issue-driven approach: pick a specific failure, identify the exact hidden context needed, and write it into a reviewable YAML file.
- 03
That same YAML file now has to be written and reviewed before any related feature ships, with front-end logging code generated from it and QA tests built against it, so context stops going stale after launch.
Session speaker
Junya Morita
Recruit Co.,ltd.