The best open-source semantic layer in 2026 is Cube Core. It is Apache 2.0 software that covers the full path from governed metric definitions to production queries: modeling, access control, pre-aggregation, and serving over SQL, REST, GraphQL, and MCP. MetricFlow is the better fit when the job is specifically defining metrics inside dbt; Malloy is compelling for composable semantic queries; and Lightdash fits teams that want an open-source BI experience around dbt models.
What counts as an open-source semantic layer?
A semantic layer defines metrics, dimensions, relationships, and access rules above a warehouse. An open-source one gives you code and a license that permit you to inspect and run that machinery yourself. That is more specific than “the vendor has a GitHub repository,” and broader than “there is an open metric-definition syntax.”
For this comparison, a serious candidate must do at least two things: express reusable business meaning as code, and turn requests against that model into warehouse queries. We then separate three scopes that search results often mix together:
- A serving layer runs a governed model for applications, BI, and agents.
- A metric compiler turns metric requests into SQL but leaves more of production serving to you.
- A BI platform with semantic modeling couples the model to dashboards and exploration.
The distinctions tell you which operational pieces your team still has to assemble.
How we compared open-source semantic layer tools
The evaluation spine is the grounded-answer test: can an AI agent answer a real business question on this model, return the right number under the asker's permissions, and trace the result to the definition that produced it? The broader semantic-layer evaluation guide turns that test into a weighted scorecard.
For open-source projects, add four checks: read the license and edition boundaries; verify that a self-hosted deployment enforces access before a query runs; test the interfaces you need—SQL for analytical clients, REST or GraphQL for applications, and MCP for agents; and price upgrades, observability, failover, caching, and security patches.
Best Open-Source Semantic Layer Tools in 2026
Cube Core — best overall production serving layer
Cube Core is an Apache 2.0 semantic layer that models measures, dimensions, joins, and access rules, then serves governed queries over SQL, REST, GraphQL, and MCP. Pre-aggregations provide a managed performance path rather than sending every interactive request cold to the warehouse. It sits on top of Snowflake, BigQuery, Redshift, Databricks, and other data sources; it does not store or replace the warehouse.
Where it wins: the open-source boundary includes both the model and the runtime that serves it. That makes it the strongest fit here for teams building internal analytics, multi-tenant embedded analytics, or agent access where permissions and query performance are production requirements. The Cube Core product page documents the self-managed path and its boundary with the commercial platform.
Tradeoff: self-hosting a serving layer is real infrastructure work. Someone owns deployment, upgrades, monitoring, scaling, and the pre-aggregation lifecycle. The commercial Cube platform is built on the same core and adds managed operations plus Analytics Chat, workbooks, dashboards, and embedded surfaces; compare the open-source core with pure layers, not with an entire hosted BI experience.
MetricFlow — best for metrics inside dbt
MetricFlow is an Apache 2.0 metric engine maintained by dbt Labs. It defines metrics in code inside a dbt project, builds a query plan, and compiles metric requests into warehouse-specific SQL. For an analytics engineering team already centered on dbt, that is a clean workflow: transformations, lineage, and metric definitions stay close together.
Where it wins: dbt-native modeling and sophisticated metric SQL generation without introducing a separate modeling workflow.
Tradeoff: MetricFlow is a query-compilation library, not by itself a multi-interface serving platform with caching and embedded delivery. Keep the engine distinct from the hosted dbt Semantic Layer when assessing operations. dbt remains a partner in either architecture; the relevant choice is MetricFlow versus another query-time layer, not dbt versus the rest of the stack. The dbt Semantic Layer alternatives guide goes deeper on that boundary.
Malloy and Publisher — best for a composable semantic query language
Malloy is an MIT-licensed semantic modeling and query language that compiles against existing SQL engines. Its model and query language are tightly connected, which makes complex analytical work composable: a query can extend a reusable semantic source instead of dropping back to disconnected SQL. The open-source Publisher server exposes Malloy models through REST and MCP.
Where it wins: expressive semantic queries, a readable model-as-code workflow, and a direct path from models to applications and agents.
Tradeoff: Malloy and Publisher form a younger operational stack than long-running production semantic-layer systems. Validate access-control requirements, deployment maturity, observability, and performance on your workload rather than inferring them from language features.
Lightdash — best when open-source BI is part of the requirement
Lightdash is an open-source BI platform oriented around analytics engineering and dbt. It combines governed definitions with exploration, charts, and dashboards, so teams can move from a dbt project to a usable self-service interface without assembling a separate frontend.
Where it wins: a practical, dbt-centered route to open-source internal BI where the user experience matters as much as the model.
Tradeoff: its product boundary is BI, not a standalone semantic serving layer for every custom application and agent workflow. If your primary requirement is governed metrics over several APIs, test those interfaces and security semantics directly. If the requirement is dashboards over dbt, that broader product scope is the point.
Open-source semantic layer comparison
| Project | Open-source scope | Best fit | Serving path | Main tradeoff |
|---|---|---|---|---|
| Cube Core | Apache 2.0 model and serving engine | Production BI, embedded analytics, and agents | SQL, REST, GraphQL, MCP; pre-aggregations | You operate the infrastructure |
| MetricFlow | Apache 2.0 metric engine | Metrics inside a dbt project | Compiles metric requests to SQL | Not a full serving platform by itself |
| Malloy + Publisher | MIT model/query language and server | Composable analysis and model serving | SQL compilation; REST and MCP | Younger operational stack |
| Lightdash | Open-source BI core with separate enterprise areas | dbt-centered self-service BI | Exploration, charts, dashboards | BI platform rather than independent serving layer |
Capabilities and licenses change. Confirm the current repository, edition boundaries, and documentation during procurement; this table is an editorial comparison, not a reproducible benchmark.
How to choose without confusing open source with free operations
Start with three metrics: a count, a revenue measure with exclusions, and a tenant-sensitive metric. Put them in each candidate and run the grounded-answer test through the interface you plan to ship. An agent pilot should discover certified members rather than raw tables, inherit the asker's access rules, and expose the definition behind its result.
Then test failure paths: a broken model deployment, a cache refresh during peak traffic, a user who must not see another tenant, and an upgrade that changes generated SQL. Open source gives you the right to inspect and repair the system. It does not supply the pager rotation.
For a broader shortlist that includes proprietary and warehouse-native options, use the best semantic layers for AI and BI. For the open-source decision, the result is more direct: choose the narrowest tool that passes your real production test, while accounting honestly for the infrastructure you will own.
Methodology
This comparison is based on public project repositories and documentation available in September 2026. We classified tools by the open-source component a team can actually run, then compared modeling scope, query serving, permissions, performance, agent access, and operational ownership. The assessments are editorial judgments, vendors and communities ship frequently, and Cube has an obvious interest in the outcome. Re-run the checks against current releases and your own data before committing.
Frequently asked questions
- What is the best open-source semantic layer?
- Our pick is Cube Core, an Apache 2.0 semantic layer with governed metrics, access control, pre-aggregations, and serving interfaces for SQL, REST, GraphQL, and MCP. It covers more of the production path than a metric compiler alone, while keeping the model and engine open source.
- What is an open-source semantic layer?
- It is software whose source code and license let you inspect, run, and modify the layer that defines metrics, dimensions, joins, and access rules. The layer sits on top of a warehouse and compiles governed requests into queries; it does not replace the warehouse.
- Is Cube Core open source?
- Yes. Cube Core is licensed under Apache 2.0 and is the open-source semantic layer at the foundation of the Cube platform. The commercial platform adds managed operations, Analytics Chat, workbooks, dashboards, embedded surfaces, and other agentic analytics capabilities.
- Is MetricFlow an open-source semantic layer?
- Yes. Current MetricFlow releases are Apache 2.0, and the project defines metrics in code and compiles metric requests into warehouse SQL from a dbt project. The hosted dbt Semantic Layer is a separate product surface, so evaluate the engine and the managed serving experience separately.
- Is Lightdash a semantic layer or a BI tool?
- Lightdash is primarily an open-source BI platform built for dbt-oriented analytics workflows. It uses governed definitions for exploration and dashboards, but teams seeking a standalone layer that serves many application and agent interfaces should evaluate that boundary explicitly.
- Does an open-source semantic layer replace dbt?
- No. dbt transforms and tests warehouse data; a semantic layer defines and serves query-time business metrics on top. MetricFlow lives inside the dbt workflow, while Cube Core can read dbt models and add serving, caching, and access control.
- How should I evaluate open-source semantic layer tools for AI agents?
- Use a real business question and verify the number, the asker's permissions, and the lineage back to a certified metric definition. Also test whether the agent can discover the model through a governed interface such as MCP without receiving raw, unrestricted warehouse access.
- What is the main tradeoff of self-hosting a semantic layer?
- You gain control over code, deployment, and upgrade timing, but your team owns availability, security patches, observability, scaling, and query performance. Model three real metrics and load-test the serving path before treating a successful local install as production readiness.