> Markdown version of [/videos/2036-beyond-dashboards-fixing-text-to-sql-with-semantic-rag](https://www.wearedevelopers.com/videos/2036-beyond-dashboards-fixing-text-to-sql-with-semantic-rag). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Beyond Dashboards: Fixing Text-to-SQL with Semantic RAG Why do language models hallucinate enterprise SQL? Learn how Semantic RAG uses your semantic layer as a blueprint to safely write custom queries for unpredictable business questions. - **Speakers:** [Piotr Menclewicz](https://www.wearedevelopers.com/@piotr-menclewicz) - **Event:** World Congress 2026 Europe - Virtual Stage - **Published:** July 2, 2026 - **Duration:** 7:02 - **URL:** https://www.wearedevelopers.com/videos/2036-beyond-dashboards-fixing-text-to-sql-with-semantic-rag ## Summary Organizations increasingly want conversational data agents, but deploying large language models (LLMs) directly against complex enterprise schemas often results in dangerous hallucinations. Because LLMs are inherently probabilistic tools, using them to query deterministic business data—like quarterly revenue—forces them to guess. Initial attempts to fix this restricted AI to querying predefined metrics via a semantic layer. While this eliminated guessing, it created BI lock-in within dashboarding tools like Power BI or Looker and limited the AI to answering only anticipated questions. To break this lock-in, the industry is shifting toward a universal "headless" semantic layer pushed upstream near data warehouses like Snowflake and Databricks. While this creates a single source of truth, strictly constraining an AI to a predefined model reduces it to "an expensive voice interface for a pivot table." Real-world business needs fall into three distinct buckets: the routine "pulse," the dimensional "breakdown," and the unpredictable "rabbit hole." Semantic models handle standard breakdowns flawlessly, but deep, ad hoc rabbit hole investigations require joining complex tables and writing custom SQL that rigid predefined metrics cannot support. The ultimate solution is a methodology called Semantic RAG with fallback. When queried, the AI agent first attempts to use the semantic layer as a direct API for standard metrics, ensuring fast, zero-hallucination answers. If faced with a rabbit hole question, the AI switches modes—treating the semantic layer as a foundational blueprint rather than a strict boundary. It extracts KPI definitions, primary keys, and business logic as contextual framework to write custom SQL against the raw data, perfectly mimicking the workflow of a senior data analyst. To achieve this seamless experience, data teams must prioritize foundational engineering, as you cannot build level-five AI agents on top of a level-one broken data infrastructure. **Keywords:** text-to-SQL, semantic RAG, LLM data hallucinations, enterprise data agents, headless semantic layer, BI platform lock-in, probabilistic LLMs, open semantic interchange, self-service analytics, rabbit hole queries, custom SQL generation, enterprise data infrastructure, data warehouse integration, ad hoc analytics, deterministic data modeling ## Chapters 1. **Why language models struggle with enterprise data queries** (00:00) — Throwing raw database schemas at probabilistic language models causes hallucinations because they lack critical business context. 1. **Moving the semantic layer upstream to avoid vendor lock-in** (01:43) — Shifting semantic logic out of dashboarding tools creates a universal headless layer that standardizes metrics across downstream applications. 1. **Categorizing business queries to expose semantic layer limitations** (03:08) — Predefined semantic models successfully handle routine metric breakdowns but fail during complex, ad-hoc investigations that require deep data exploration. 1. **Implementing semantic RAG with fallback for complex queries** (04:57) — Treating the semantic layer as a blueprint for generating custom SQL enables artificial intelligence agents to accurately answer unexpected questions. 1. **Preparing enterprise data foundations for artificial intelligence agents** (06:24) — Building reliable artificial intelligence solutions requires data teams to proactively document and expose underlying semantic context before deployment. ## Related Moments - [Enhancing data validation and self-service analytics with AI](https://www.wearedevelopers.com/videos/1622-data-governance-in-the-era-of-ai) (from "Data Governance in the Era of AI") - [Replacing complex BI dashboards with live LLM queries](https://www.wearedevelopers.com/videos/100091-3-ways-to-rebuild-the-data-stack-for-agents) (from "3 Ways to Rebuild the Data Stack for Agents") - [Introducing conversational queries with AI data agents](https://www.wearedevelopers.com/videos/1547-data-analytics-with-microsoft-fabric-end-to-end-use-case-with-data-agents) (from "Data Analytics with Microsoft Fabric: End-to-End Use Case with Data Agents") - [Overcoming artificial intelligence silos in the enterprise](https://www.wearedevelopers.com/videos/1525-beyond-gpt-building-unified-genai-platforms-for-the-enterprise-of-tomorrow) (from "Beyond GPT: Building Unified GenAI Platforms for the Enterprise of Tomorrow") - [Customizing enterprise intelligence via automated RAG and secure APIs](https://www.wearedevelopers.com/videos/1665-secure-and-private-ai-deepmask) (from "Secure and Private AI - DeepMask") - [Architectural challenges of AI-driven data queries](https://www.wearedevelopers.com/videos/100212-olap-for-ai-applications-and-why-you-should-care) (from "OLAP for AI Applications and why you should care") ## Related Articles - [Graph and AI Trends 2026: Why Is AI Running but Not Yet Delivering?](https://www.wearedevelopers.com/magazine/680-graph-and-ai-trends-2026-why-is-ai-running-but-not-yet-delivering) - [Making Data Warehouses Fast: A Developer’s Story](https://www.wearedevelopers.com/magazine/107-making-data-warehouses-fast-a-developer-s-story) - [Stephan Gillich - Bringing AI Everywhere](https://www.wearedevelopers.com/magazine/489-stephan-gillich-bringing-ai-everywhere) - [WWC24 Talk - Scott Hanselman - AI: Superhero or Supervillain?](https://www.wearedevelopers.com/magazine/469-wwc24-talk-scott-hanselman-ai-superhero-or-supervillain) ## Related Jobs - [Staff Business Intelligence Engineer](https://www.wearedevelopers.com/jobs/ext/626164-staff-business-intelligence-engineer) at **Twilio** - [Data Scientist](https://www.wearedevelopers.com/jobs/ext/1351648-data-scientist) at **Almedia** - [AI Software Engineer (Germany)](https://www.wearedevelopers.com/jobs/48317-ai-software-engineer-germany) at **Sunhat** - [Principal Software Engineer, Enterprise AI Platform](https://www.wearedevelopers.com/jobs/ext/1467292-principal-software-engineer-enterprise-ai-platform) at **GitHub** - [Staff, Business Intelligence Engineer](https://www.wearedevelopers.com/jobs/ext/1401813-staff-business-intelligence-engineer) at **Twilio** - [Staff Software Engineer, Copilot Experiences](https://www.wearedevelopers.com/jobs/ext/164361-staff-software-engineer-copilot-experiences) at **GitHub**