Text-to-SQL failures stem not from poor SQL generation but from LLMs lacking knowledge of what your data means. The solution is to build a canonical knowledge layer first — a spec combining a data model, taxonomy (what metrics exist and what's out of scope), and ontology (what relationships and joins actually compute). Evidence from Anthropic's internal analytics stack and controlled studies shows that providing this meaning layer raises accuracy from ~21% to 95%+ and adds 17–23 points across all tested models. The key insight is to write definitions before building the model, then use the same spec to both generate the data model and answer queries — keeping the two in sync automatically. This approach mirrors how GraphRAG works over unstructured text, but applied to structured data. dltHub is building tooling (AI Workbench) that implements this workflow, reportedly running 20–50x faster than manual modeling.

22m read timeFrom dlthub.com
Post cover image
Table of contents
1. A canonical model is already the structure the agent needs Link icon2. What you are missing is a canonical knowledge layer, not a data model Link icon3. Each knowledge part has a different job Link icon4. This is already how GraphRAG works Link icon5. Build the canonical knowledge layer once, use it twice Link icon6. Shifting the canonical model left collapses the time to an answer Link icon7. The honest limits everyone is reaching Link icon8. Write the definitions first Link icon
88 Impressions