Flowstate Technologies LLP
Data intelligence7 min read

What is a semantic layer? Why AI analytics depends on one

Two departments, two revenue figures, one meeting. A semantic layer is the structural fix — and it is also what makes an AI analytics assistant give the same answer twice.

A semantic layer is the place where a business defines what its numbers mean — once, in version-controlled code — so that every dashboard, export and AI assistant reads the same definition. In data terms it sits between the raw tables in your database or warehouse and the tools people use to ask questions. In AI terms it is the difference between a model guessing how 'collection rate' is calculated and a model being told.

The symptom it fixes is familiar. Finance brings one revenue figure to the review, operations brings another, and the hour is spent reconciling spreadsheets instead of deciding anything. Usually both figures are 'correct': one excludes cancelled orders and the other does not, or one counts by invoice date and the other by delivery date. The metric has been defined independently in four places, and the four definitions have drifted.

What is a semantic layer in data, concretely?

It is a set of definitions, not a product you buy. Whatever tool expresses them, a semantic layer typically holds four things:

  • Entities and how they join — a rider belongs to a hub, a hub belongs to a city, an invoice references an order. The joins are declared once, so nobody writes a slightly different join next quarter.
  • Measures — the aggregations, with their filters: 'net revenue is the sum of invoice taxable value, excluding cancelled and credit-noted invoices'.
  • Dimensions and time grains — which attributes a metric can be sliced by, and whether 'week' means Monday-to-Sunday or the business's own reporting week.
  • Access rules — which roles may see which rows, so a hub supervisor's question is answered only from that hub's data.

A semantic layer example

Take a fleet operator that rents scooters to delivery riders weekly and collects part of the rent in cash at hubs. 'Collection rate' sounds simple. Written down properly, it needs decisions nobody made explicitly before:

One metric, defined once
QuestionDecision recorded in the semantic layer
What is the denominator?Rent due for the week, excluding riders on an approved pause
When does cash count as collected?When the hub deposit is reconciled to the bank, not when the supervisor logs it
What about partial payments?Counted proportionally; the unpaid balance carries forward as arrears
Which week?The business week, Monday 00:00 to Sunday 23:59 IST
Who can see it?Supervisors for their own hub; regional managers for their region; finance for all

Once that is code, the weekly report, the finance export and the dashboard on the operations manager's phone stop disagreeing. The arguments move to where they belong — the definition — and they happen once.

What is a semantic layer in AI, and why does AI analytics need one?

When someone asks an AI assistant 'which hubs fell behind on collections last week?', the model has to turn that into a query. Without a semantic layer it has to infer the joins, the filters and the meaning of 'behind' from raw table and column names, on every single question. It can get a plausible answer that is quietly wrong, and it can get a different plausible answer to the same question tomorrow. Cube makes this point directly: raw text-to-SQL makes the model re-derive metric logic, joins and permissions per prompt.

Sources: Cube: Best conversational analytics software

The measured effect is large. Teradata, citing dbt Labs benchmark figures, reports text-to-SQL accuracy of 64.5% on an unmodelled baseline dataset rising to 72.7% with a semantic layer, and on fully modelled data from 90.0% to 98.2% with a semantic layer. The lesson is not the exact percentages, which come from one benchmark; it is that most of the gain comes from modelling the data, not from choosing a cleverer model.

Sources: Teradata: What is conversational analytics?

This is also why the semantic layer has become an executive topic rather than a data-team detail. KPMG's 2026 survey of chief data and analytics officers frames it as the bridge between raw data and AI, while noting that the tooling is still maturing. Forrester has opened research coverage of semantic layer platforms.

Sources: KPMG: Voice of the CDAO 2026; Forrester: Multimodal, semantic and agentic enterprise data is the future

Semantic layer vs ontology vs knowledge graph

The terms overlap, and vendors use them loosely. A working distinction:

Three related ideas
ConceptWhat it describesTypical question it answers
Semantic layerMetrics, dimensions, joins and access rules over your tablesWhat was net revenue by region last month?
OntologyThe types of things in the business and how they relate, independent of storageWhat is a 'site', and how does it relate to an 'asset' and a 'contract'?
Knowledge graphActual instances of those things and their relationships, stored as a graphWhich assets under this vendor's AMC failed twice after the same technician's visit?

For most operational businesses the semantic layer comes first, because most questions are aggregations over transactions. An ontology becomes worth writing down when several systems describe the same things differently. A knowledge graph earns its cost only when the important questions are about relationships across many hops. The large platforms are converging these ideas: Synechron reports Databricks, Microsoft, Snowflake, SAP and others building semantic and ontology capabilities directly into their products.

Sources: Synechron: The ontology goes native

Where the semantic layer lives

  • In a transformation tool such as dbt, with metric definitions alongside the models that build the tables.
  • In a dedicated semantic server such as Cube, which sits in front of the database and serves the same definitions to dashboards, APIs and AI assistants.
  • In the BI tool itself — a Power BI semantic model or LookML in Looker. This works when one BI tool is the only consumer.
  • In your warehouse platform, where Snowflake and Databricks now offer native semantic features.

The choice matters less than one rule: every consumer must read from the same definitions. A semantic layer that the AI assistant uses but the finance export bypasses has simply created a fifth definition.

When not to build one

If you have one reporting tool, a handful of metrics and one team that owns them, a well-built set of views and a single BI model may be all you need. If the source data itself is unreliable — duplicate vendors, cash entries logged days late, invoices typed by hand — fix capture and cleanup first. A precise definition over wrong data produces a precise wrong number.

Flowstate builds semantic layers as part of its data intelligence work, usually in dbt or Cube over PostgreSQL or a cloud warehouse, and always with the access rules alongside the metrics. The first deliverable is the list of definitions your teams disagree about, because that list is where the value is.

Sources and further reading