AI glossary · Advanced · Data engineering · AI platforms & solutions
Semantic layer
A semantic layer is an intermediate layer that defines in one place what business terms such as 'revenue' or 'active users' actually mean in the data and how they are calculated. Because dashboards, spreadsheets and AI all retrieve data through these definitions, the same question gets the same number.
About this term
- Level
- Advanced · Specialist terms that need the inner workings
- Category
- Data, ops & platforms
- Added
- 2026-10-09
How it works
A data warehouse only has table and column names; it does not contain business rules such as 'net revenue is calculated excluding refunds.' A semantic layer defines these metrics, dimensions (date, region, etc.) and how tables are joined, in code or configuration files. When a user requests 'net revenue by region,' the semantic layer looks up the definitions, generates the appropriate SQL and sends it to the warehouse. The results are calculated the same way no matter where the request comes from, whether a BI dashboard, spreadsheet, API or AI agent.
Why it matters
As organizations grow, it is common for each team to calculate 'revenue' slightly differently, so numbers do not match in meetings. A semantic layer reduces this confusion by gathering definitions in one place, and when a definition changes, it only needs to be fixed once. Recently it has drawn particular attention for Text-to-SQL, where LLMs ask questions of data. When an LLM interprets hundreds of tables directly, it easily makes wrong joins or incorrect calculations, but going through well-organized metric definitions makes answers much more stable.
Things to know
A semantic layer is harder to maintain than to build. If you do not decide who updates and approves changes when business definitions change, it quickly drifts away from reality. So it is often run together with data governance and a data catalog. Conceptually it has things in common with ontologies and knowledge graphs, but a semantic layer focuses mainly on 'calculating metrics consistently.'
Example
When an employee asks an internal data chatbot, "Tell me the number of new customers last month," the chatbot's LLM calls the 'new customer count' metric defined in the semantic layer instead of digging through tables directly. The number on the finance team's dashboard and the chatbot's answer are then calculated with the same definition, so they do not conflict.