top of page

Demystifying Semantic Layers

If you work in the data/AI world, chances are you’ve heard the term 'semantic layer' being thrown around a lot lately. With more businesses looking to build chatbots that allow users to interact with data using natural language, semantic models have quickly become the foundation of that GenAI-powered BI dream. Having worked in data for nearly five years, one phrase I’ve consistently heard from everyone, from fresh graduates to senior data leaders, is "single source of truth". For years, organisations have chased this ideal, often with a false sense of confidence that they had already reached this data utopia. In reality, inconsistent definitions, siloed logic, and conflicting metrics meant the “single source of truth” was not always as single or truthful as it seemed. Semantic layers finally offer a practical path to achieving that vision. As an added bonus, they also unlock the ability to build smarter, more reliable data chatbots.


Why do we need semantic layers?


Without semantic layers or semantic models, large language models (LLMs) such as Claude, Gemini, ChatGPT, and the many models powering today’s AI agents are not, in a sense, employees of your company. Yes, they are incredibly knowledgeable. They have been trained on vast amounts of public information and can code remarkably well. But what they do not inherently understand is how your business works. They do not know your internal definitions, naming conventions, metadata, or business logic. Think of them as highly intelligent outsiders. They can analyse information, but they have no built-in understanding of what terms mean inside your organisation.


For example, imagine your business has multiple date fields in its data model: one for when a sale was made, another for when an invoice was generated, and perhaps another for delivery. Now imagine someone asks a chatbot:


“What was our gross revenue last quarter?”


Seems like a straightforward question, right? Not quite.


Internally, your company may define gross revenue based on sales data rather than invoiced data, and a quarter is based on the financial calendar, which runs April to March. But unless that logic is explicitly provided, the chatbot has no reliable way of knowing which date field to use, which months comprise last quarter, or what 'gross revenue' actually means in your business context.



As employees, we often take this knowledge for granted because we have learnt it over time working in the business. Sometimes it lives in data dictionaries, sometimes in ETL pipelines, and sometimes hidden inside BI tools through DAX calculations in Power BI or calculated fields in Tableau. A semantic layer solves this exact problem. It acts as a shared business context for your data, giving AI the definitions, relationships, and logic it needs to answer questions consistently and accurately.



Let's RIP BI's Head Off!


No, this isn’t one of those clickbait posts claiming BI is dead, because it most certainly isn’t (at least not yet). There is still appetite for reports and dashboards. However, things are changing quickly. With LLMs doing more of the heavy lifting in data workflows, the expectation is faster turnaround, more flexibility, and highly personalised answers to business questions. Over time, clients may rely less on analysts for every ad hoc request, with AI agents handling much of the day-to-day querying instead. The analyst’s role will shift toward building and maintaining those systems.


That said, BI is evolving, not disappearing. When I say “Let’s RIP BI’s head off,” I mean this: tools like Tableau and Power BI should not be where core business logic and calculations live. They are designed for building and visualising dashboards, not governing business definitions. Like any application, BI should follow a clear separation between backend and frontend. The semantic layer becomes the backend, holding the business logic, definitions, and calculations, while BI tools act as the presentation layer. Semantic Layers will lead the age of "Headless BI" (10).



Dissecting Semantic Layers


At its core, a semantic layer is a business translator that sits between complex raw data tables and the people or AI agents trying to make sense of them. Think of raw data as a phone book full of cryptic entries, while business users need a clean, intuitive directory. The semantic layer bridges that gap by abstracting technical complexity like unclear column names (e.g., RevAdj_2023) and complex joins into a business-friendly language (e.g., “Monthly Recurring Revenue”). It ensures that whether you’re using a dashboard, spreadsheet, or chatbot, the underlying logic and calculations remain consistent.


Source: dbt Labs
Source: dbt Labs

A semantic layer is typically built from a few core components which hold logic, data dictionaries, and metadata understanding (1):


  • Measures: The calculations, like sums, averages, or ratios (e.g., gross revenue).

  • Dimensions: The contextual filters such as who, what, where, and when (e.g., region or time period).

  • Entities/Joins: The relationships that define how different data tables connect.

  • Views: Curated, query-ready datasets exposed to users or AI systems.

  • Definitions: The data dictionary comprising definitions and synonyms for fields.


Together, these building blocks create a unified, governed layer of business logic that sits on top of raw data and powers every downstream use case consistently. In short, the LLMs are SQL and code generators; all they want is context to get the query right every time to access the correct data columns to answer the questions


Semantic Layers Fight Hallucinations


Hallucination has long been the villain of the AI industry. Simply put, it's the tendency of the model to be confidently incorrect. In the data world, with high-stakes decisions at stake on your dashboards and reports, it is not something anyone can afford. There is a constant requirement of factually correct data at all times with no exceptions. Large Language Models (LLMs) are probabilistic, not deterministic. They are great at language but terrible at math and logic unless of course they use code (2).


Without a semantic layer, an AI agent must guess how to join tables and filter data. Research shows that when a query requires joining more than four tables, LLMs guess wrong 80% of the time (3).


Chatbots need semantic layers to:


Eliminate Ambiguity: The layer provides a "domain ontology" (a map of what data means) so the AI doesn't have to guess what "gr_rev" stands for (4).


Ensure High Accuracy: In benchmarks, "Raw Text-to-SQL" (AI querying tables directly) scores only 40–60% accuracy, while AI grounded in a semantic layer hits 85–100% accuracy (5).


Enforce Hard Guardrails: Use "Hard Hooks" to block destructive actions (like deleting data) and "Soft Steering" to guide the agent toward correct business rules (6).


Inherit Security: The AI automatically inherits the user’s permissions. If a user isn't allowed to see "Salary" data, the chatbot simply cannot retrieve it (7).



How to Get Started on Production Grade Semantic Layer:


Building a semantic layer is not an overnight process; it's rather a journey from raw data to governed, trusted insight. Here are a few steps that usually follow in building the right semantic layer (8):


1. Assess Architecture Map your data sources, ETL models and business logic and identify where definitions conflict or differ across systems.


2. Standardise Metrics: Align stakeholders on the most critical 20–50 KPIs (for example, defining exactly what an “active user" means, which date fields to use, and when).


3. Define Modelling Standards: Establish consistent naming conventions so models are readable for both humans and machines (e.g., PascalCase for entities and camelCase for attributes) (9).


4. Centralise Governance: Implement controls such as Row-Level Security (RLS) to restrict data access by role and column masking to protect sensitive personally identifiable information (PII) (10).


5. Integrate and Test: Connect the semantic layer to BI tools and AI systems. Validate outputs using competency questions like “Which companies are working on the same project?”


6. Optimise Performance: Use pre-aggregations and caching to ensure fast, sub-second query performance even at scale (10).


7. Monitor and Evolve: Treat metrics as code. Use version control (e.g., Git) to track changes and safely evolve definitions over time (11).



Top Tools of the Trade


Like most things in data, there is no single “correct” answer. The classic response applies here: it depends.

There are a range of tools available today that help you design, manage, and scale semantic layers, depending on your architecture and where you sit in the data stack. Broadly, they fall into three categories (12):


  1. Pure Semantic Layer Tools: These are code-first or “headless” solutions designed to define metrics once and reuse them across BI tools, analytics platforms, and AI agents. Examples include dbt Semantic Layer (MetricFlow), Cube, and AtScale.


  2. Warehouse-Native: These are best suited for organisations committed to a single cloud data warehouse, where semantic definitions live close to the compute layer. Examples include Snowflake Semantic Views and Databricks Metric Views.


  3. BI-Native: These are embedded within BI tools, where one platform acts as the primary consumption layer for analytics. Examples include Looker (LookML), Power BI Semantic Models, and Omni.


The choice between these approaches usually depends on your existing warehouse and BI ecosystem, as well as how tightly you want to couple semantic logic to a specific tool. If flexibility and portability are key, pure semantic layer solutions tend to be preferred. If you are deeply invested in a single stack, warehouse-native or BI-native approaches may be more practical.



Bringing it all Together


The semantic layer is the central nervous system of a modern data architecture. It takes fragmented, inconsistent data and turns it into a unified hub that powers everything downstream from human-driven dashboards to autonomous AI agents


Powering Business Intelligence (BI): For BI tools like Tableau, Power BI, and Looker, the semantic layer becomes the single source of truth


  • Metric consistency: Instead of redefining metrics like “gross revenue" across multiple dashboards, it is defined once and reused everywhere.

  • Self-service with guardrails: Business users can explore data freely using familiar terms, while pre-defined joins and logic prevent incorrect or inconsistent queries.


Grounding AI Agents via MCP Servers: Large language models no longer need to query raw tables directly. Instead, they interact with a Model Context Protocol (MCP) layer.


  • The "JDBC for AI": MCP is the industry standard that allows AI agents to discover available data models and understand their structure without manual integration.

  • Governed context at runtime: When a question is asked, the MCP layer provides certified definitions, lineage, and access rules so the model knows exactly how to interpret metrics like "Gross Revenue"

  • Built-in security: Policies such as Row-Level Security (RLS) are enforced automatically, ensuring AI agents only access data the user is permitted to see.


All of this ultimately powers a couple of key experiences:


  • Conversational analytics: Users ask questions in natural language, with systems translating queries into governed, accurate answers.

  • Augmented dashboards: Traditional BI dashboards become AI-enhanced, with faster queries and automated insights.


The semantic layer is no longer just a nice-to-have. It is becoming the foundation of trusted AI in data systems (3). By defining metrics once and serving them through governed interfaces, organisations move away from inconsistent “best guesses” and toward reliable, reproducible insights. In doing so, data becomes not just accessible but truly trustworthy at scale


References



Comments


Want to stay in touch ?

Thanks for submitting!

bottom of page