Blog/Buyer's Guide

Best Semantic Layers in 2026: dbt MetricFlow vs Cube vs Snowflake

The 3 most popular semantic layers (dbt MetricFlow, Cube, Snowflake semantic views), the fourth option (no semantic layer), how to use each with the nao analytics agent, and which one to pick.

Best Semantic Layers in 2026: dbt MetricFlow vs Cube vs Snowflake

22 November 2026

By Claire GouzeFounder @ nao

The semantic layer is one of the most discussed topics in data right now.

A semantic layer stores your business definitions (metrics, dimensions, entities and the joins between them) once, and compiles every request into SQL from them. The three most popular today are dbt MetricFlow, Cube and Snowflake semantic views. All three work with nao, the open source analytics agent: MetricFlow natively, Snowflake semantic views as synced context, Cube through its MCP server.

There is a fourth option most comparisons leave out: no semantic layer. A rules file listing each metric and its source table, documented columns and a data model built for agents. In our benchmark, that setup reached 86% correct answers, against 82% for a MetricFlow layer after four rounds of manual work. So this post compares four options, not three: if you want a semantic layer for your agent, pick MetricFlow; if you don't have one yet, start without.

dbt MetricFlow

MetricFlow is the SQL generation engine behind the dbt Semantic Layer. You define semantic models, entities, dimensions and metrics (simple, ratio, cumulative, derived, conversion) in YAML, in your dbt project, and MetricFlow builds the joins and the SQL, avoiding fan-out and chasm joins. It is open source under Apache 2.0. Starting with dbt v1.12, it can read semantic models written as Ossie documents (MetricFlow docs).

The same example in each option below: a revenue metric on an orders table. In MetricFlow, with the YAML spec of dbt v1.12 and later (older projects declare measures in a semantic_models: block):

yaml
# models/marts/fct_orders.yml models: - name: fct_orders semantic_model: enabled: true agg_time_dimension: ordered_at columns: - name: order_id entity: type: primary name: order - name: customer_id entity: type: foreign name: customer - name: ordered_at granularity: day dimension: type: time - name: status dimension: type: categorical metrics: - name: revenue label: Revenue type: simple agg: sum expr: order_total

Its strength: your metrics sit next to the models they aggregate, and they are reviewed in the same pull requests. Its catch for agents: the dbt Semantic Layer APIs, and the integrations built on them, require a dbt platform Starter or Enterprise account (dbt Semantic Layer docs).

Cube

Cube is a semantic layer (Cube Core, open source, Apache 2.0 by default) plus an agentic analytics platform (Cube Cloud). You define cubes (measures, dimensions, joins) and views in YAML or JavaScript, in version control, and query them through a Postgres-compatible SQL API, REST, GraphQL or the Meta API. Pre-aggregations in Cube Store and access policies as code are its extra strengths (Cube docs).

yaml
# model/cubes/orders.yml cubes: - name: orders sql_table: analytics.fct_orders joins: - name: customers relationship: many_to_one sql: "{CUBE.customer_id} = {customers.customer_id}" measures: - name: revenue type: sum sql: order_total dimensions: - name: order_id sql: order_id type: number primary_key: true - name: status sql: status type: string - name: ordered_at sql: ordered_at type: time

It shines when many apps or tenants hit the same data. A practitioner on r/PostgreSQL put Cube Core in front of a Postgres replica, with row filters compiled from a signed JWT and rollups in Cube Store, and reported p95 dashboard waits going from 14 seconds to under 60 ms. Their warning: watch dimension cardinality in rollups.

Snowflake semantic views

Semantic views are schema-level objects in Snowflake that store logical tables, relationships, facts, dimensions and metrics. You create them with CREATE SEMANTIC VIEW, a YAML spec, or the Autopilot and Semantic Studio UIs, and query them with SELECT ... FROM SEMANTIC_VIEW(...) or SELECT with AGG() (Snowflake docs). Cortex Analyst and Cortex Agents use them to generate SQL.

sql
CREATE SEMANTIC VIEW analytics.orders_sv TABLES ( orders AS analytics.fct_orders PRIMARY KEY (order_id), customers AS analytics.dim_customers PRIMARY KEY (customer_id) ) RELATIONSHIPS ( orders_to_customers AS orders (customer_id) REFERENCES customers ) FACTS ( orders.order_total AS order_total ) DIMENSIONS ( orders.ordered_at AS ordered_at, customers.country AS country ) METRICS ( orders.revenue AS SUM(orders.order_total) ) COMMENT = 'Revenue by customer country'; -- Query it SELECT * FROM SEMANTIC_VIEW( analytics.orders_sv METRICS orders.revenue DIMENSIONS customers.country );

No extra infrastructure if you are all-in on Snowflake. The catch: they only work in Snowflake, and your definitions live in Snowflake, not next to your dbt models.

Option 4: no semantic layer

The agent writes SQL from the context your data team maintains: a rules file with each metric's definition and source-of-truth table, column descriptions, dbt docs, and tables modeled so the right one is obvious. Nothing to compile, no extra infrastructure, and no question falls outside a layer's scope. The catch: definitions live in prose and docs, so they are only as consistent as your tests. That is why this option comes with an evaluation suite. We tested it against MetricFlow in our semantic layer impact study, and it came out ahead on accuracy, speed and cost.

The same metric, written in the RULES.md the agent reads:

markdown
# RULES.md ## Metrics - **Revenue**: `SUM(order_total)` from `analytics.fct_orders`, only `status = 'completed'`. Never compute it from `stg_orders`: it includes test orders. - **Revenue by country**: join `analytics.dim_customers` on `customer_id`, group by `country`. ## Tables - `analytics.fct_orders`: one row per order, the source of truth for revenue. - `analytics.dim_customers`: one row per customer.

At a glance

dbt MetricFlow Cube Snowflake semantic views No semantic layer
Open source Yes, Apache 2.0 Cube Core, Apache 2.0 by default No, a Snowflake feature Nothing to license
Where definitions live YAML in your dbt project YAML or JavaScript, in version control In Snowflake A rules file and docs, in your repo
Building blocks Semantic models, entities, dimensions, metrics Cubes (measures, dimensions, joins) and views Logical tables, relationships, facts, dimensions, metrics Metric definitions, column descriptions, clean models, tests
Warehouses Snowflake, BigQuery, Databricks, Redshift, Postgres Connects to your warehouse or database Snowflake only Any
Best for Teams already on dbt Many apps or tenants on the same data Teams all-in on Snowflake Most teams starting an agent, and questions beyond predefined metrics

We also review Cube as an agent in our nao vs Cube comparison, and Snowflake's agent in our Snowflake Cortex review.

How to use each semantic layer with nao

nao is an open source analytics agent: your data team builds its context (schemas, dbt docs, rules, skills) as files, and business users ask questions in plain English. A semantic layer is one more piece of that context.

dbt MetricFlow: native

Point nao_config.yaml at the semantic_manifest.json that dbt parse produces:

yaml
semantic_layer: type: metricflow manifest_path: ./repos/dbt/target/semantic_manifest.json database: snowflake-prod

Then run nao sync. nao writes one file per metric in semantics/metrics/ and gives the agent an execute_semantic_query tool that takes metrics, dimensions and filters instead of SQL. MetricFlow runs inside nao as a SQL compiler only: no call to dbt Cloud, no Semantic Layer plan, and the compiled SQL goes through the same read-only checks as any other query.

Admins pick a mode under Settings -> Agent -> SQL: Semantics first (default, falls back to SQL for what the layer doesn't cover), Semantics only, or Don't use semantics. Full setup in the semantic layer docs.

Snowflake semantic views: synced as context

Nothing to configure. When nao sync runs against Snowflake, it imports the semantic views in your account (metrics, dimensions, relationships) into a definition.md per view, next to the table metadata. The agent reads them as the intended way to query and aggregate the data. See Snowflake semantic views in the databases docs.

Cube: through its MCP server

nao has no native Cube integration today. Cube hosts an MCP server for its platform, and nao's agent can call any MCP server you declare in agent/mcps/mcp.json, including remote HTTP servers (MCP docs). Expect the trade-off we measured with the dbt MCP: governed answers, more tool calls, slower answers.

No semantic layer: rules, docs and tests

This is nao's default. nao sync writes your warehouse metadata and dbt docs as files, you describe each metric and its source table in RULES.md, and nao test checks the agent's answers against the SQL you expect. The method is in our context engineering guide and in 4 steps to improve your analytics agent reliability from 45% to 86%; the data model side in how to do data modeling for AI agents.

Do you really need a semantic layer?

Before you pick one: no, it's not mandatory.

A semantic layer solves computation, not orientation. Answering "what was our MRR last month?" takes two steps: finding which metric and which table the question means (MRR? ARR? billing month or subscription month?), then computing it. A semantic layer makes the second step deterministic. The first step, where agents actually fail, is still the agent's job.

Our numbers, on our own agent, 40 tests over 12 tables:

Setup Correct answers
AI-generated MetricFlow semantic layer, as the only way to query 4% to 13% (most questions fell outside its scope)
Same layer after 4 rounds of manual work 82%
No semantic layer: rules file, documented columns, a data model built for agents 86%

The semantic layer version was also slower and more expensive, because every answer went through MCP tool calls. We wrote up each step:

So:

  • You don't have a semantic layer: don't start by building one. Test the agent on what you already have (schema, dbt docs, a rules file listing each metric and its source-of-truth table) and fix the data model where tests fail. That's how we went from 45% to 86%.
  • You already have one (MetricFlow, Cube, Snowflake semantic views, LookML, TMDL): use it as context, next to your rules and docs, and let your tests tell you whether querying through it helps.
  • When it starts to pay off: our hypothesis is that it matters more as the number of tables and the number of teams sharing the same metrics grow.

In the current debate, WisdomAI's CPO called the semantic layer "necessary, but not sufficient" for chat over data (Chain of Thought). We agree with "not sufficient", not with "necessary": picking the right metric is context engineering work, with business definitions, rules and a data model built for agents.

Whatever you choose, test it: write 20 to 40 metric questions, run them with and without the layer using nao's evaluation framework, and keep the layer only if it moves your numbers.

Summary: the best semantic layer to use with nao

Semantic layer How nao uses it Setup Our take
dbt MetricFlow Native: compiled inside nao, queried with execute_semantic_query Point nao_config.yaml at semantic_manifest.json Best choice if you want a semantic layer
Snowflake semantic views Synced as context by nao sync Nothing to configure Use the ones you have, don't build new ones for nao
Cube Through Cube's MCP server Declare it in agent/mcps/mcp.json Works, but slower: not native
No semantic layer Default: rules file, docs and dbt context, tested with nao test Write RULES.md, run nao test Best place to start: 86% in our benchmark

If you want a semantic layer with nao, use dbt MetricFlow. It is open source, lives in your dbt project next to the models it aggregates, needs no dbt Cloud plan with nao, and is the only one nao compiles natively, with a fallback to SQL for what it doesn't cover. If you don't have one yet, start without: rules, a clean data model and tests got us to 86%.

nao is open source: github.com/getnao/nao ยท docs

Claire

Claire

For nao team

Frequently Asked Questions