cube README

The project's README from github.com/cube-js/cube. As one markdown file: README.md.

Cube Core — Open-Source Semantic Layer


Website • Docs • Examples • Blog • Slack • X

npm version GitHub Actions FOSSA Status

Cube Core is the open-source semantic layer. Define metrics, dimensions, joins, and access rules once in code, then expose them through SQL, REST, and GraphQL APIs to anything downstream — BI tools, custom applications, or AI agents. Cube Core is headless: it doesn't ship a UI, so you can build the analytics experience that fits your product.

Cube Core works with all SQL data sources, including cloud data warehouses like Snowflake, Databricks, and BigQuery; query engines like Presto and Amazon Athena; and application databases like Postgres. It has a built-in relational caching engine to provide sub-second latency and high concurrency for API requests.

Cube Core — semantic layer connecting data sources to embedded analytics, BI tools, and AI agents

Learn more about connecting Cube to data sources and analytics & visualization tools.

Why Cube Core?

Every BI tool relies on a semantic layer as its core engine — the component that defines metrics, dimensions, and business logic and hides the complexity of the underlying data sources. Most semantic layers are proprietary, tightly coupled to a single BI platform, and can't be reused across other tools.

Cube Core is an open, standalone semantic layer that any analytics application or AI agent can consume through standard APIs. Define your metrics once and use them everywhere — internal BI, embedded analytics, AI agents — without re-implementing the model in each place.

Getting Started

You can run Cube Core locally or self-host it with Docker.

Once Docker is installed, in a new folder for your project, run:

docker run -p 4000:4000 \
  -p 15432:15432 \
  -v ${PWD}:/cube/conf \
  -e CUBEJS_DEV_MODE=true \
  cubejs/cube

Then open http://localhost:4000 in your browser to continue setup.

Development mode is an authentication bypass. In the official images — whose entrypoint is the cubejs CLI — CUBEJS_DEV_MODE=true also forces NODE_ENV=development, which switches off JWT verification on the REST (JSON) and GraphQL APIs, so they accept requests with no token at all. Playground and its supporting endpoints are served with no authentication either, so anyone who can reach the instance is handed a ready-to-use API token (and can mint others carrying any security context, signed with your API secret), can read your data model, and can overwrite it and your .env. With no CUBEJS_SQL_PASSWORD set, the SQL API accepts any credentials as well, allowing arbitrary SQL against connected data sources.

This is intentional — development mode is designed to run on a developer's local machine for ease of use and debugging. Never expose it to the internet or use it in production. Using development mode in the Cube cloud platform is highly discouraged, as it bypasses the platform's security model. Cube is also in development mode whenever NODE_ENV is not production, but cubejs server and the official images already set it to production. See CUBEJS_DEV_MODE.

For a step-by-step guide, see the docs.

Cube Core vs. Cube

Cube is our commercial product — an agentic analytics platform built on Cube Core. Same semantic layer underneath, plus the rest of what makes it a full BI platform: Analytics Chat, workbooks and dashboards, embedded analytics surfaces, managed deployment, RBAC, multi-tenancy, and integrations with Tableau, Power BI, Excel, and Google Sheets.

The data model is fully compatible both ways: a model you build in Cube Core runs unchanged in Cube, and vice versa. Cube Core stays open-source and is what we run inside Cube ourselves.

For more on how we think about the split, see The Future of Cube Core and Cube.

For a tour of what's in Cube today, watch the workshop:

Cube agentic analytics workshop on YouTube

Or try Cube for free.

Resources

Contributing

There are many ways you can contribute to Cube Core! Here are a few possibilities:

All sorts of contributions are welcome and extremely helpful 🙌 Please refer to the contribution guide for more information.

License

Cube Client is MIT licensed.

Cube Backend is Apache 2.0 licensed.

FOSSA Status

cube (cube-js/cube)

Searching Database…

21K ·GitHub
这是什么?一个开源的语义层:在代码里把指标、维度、关联和访问权限一次性定义好,然后通过 SQL、REST 和 GraphQL API 提供给 BI 工具、自研应用和 AI 智能体使用。
它是加到我代码里的库,还是我要自己运行的服务?它是一个独立运行的服务,部署在你的数据旁边,而不是一个库。它是无界面的——不自带 UI;你在它的 API 之上搭建自己的数据分析功能。
怎么把它跑起来?先安装 Docker,然后为你的项目新建一个文件夹,按照 README 中的 Cube Core Docker 命令运行,再在浏览器中打开本地 URL 继续设置。
它可以对接哪些数据源?任何 SQL 数据源都可以:像 Snowflake、Databricks 和 BigQuery 这样的云数仓,像 Presto 和 Amazon Athena 这样的查询引擎,以及像 Postgres 这样的应用数据库。
可以直接部署到公网服务器上吗?开发模式下不行——它等于绕过了身份验证:JWT 校验被关闭,Playground 完全开放,而且如果不设置 SQL 密码,SQL API 会接受任何凭据。只适合本地开发;千万不要把它暴露到互联网上。
我该用 Cube Core 还是商业版的 Cube?如果你想自己掌控整套技术栈——定制 BI 体验、深度集成的嵌入式分析,或者在受治理的基础上跑 AI 智能体——就选 Core。如果你想要一个开箱即用、功能齐全的托管 BI 平台,就选 Cube。
它是完全开源的吗?是的,采用拆分许可:Cube Client 是 MIT,Cube Backend 是 Apache 2.0——两者都很宽松,可以免费商用。
大量并发查询时它扛得住吗?它内置了关系型缓存引擎,专门用来为 API 请求提供亚秒级延迟和高并发能力。
我在数仓之上开发 AI 智能体,这个项目对我有用吗?有用,这正是它的核心使用场景之一:智能体通过标准的 SQL、REST 和 GraphQL API 消费同一套受治理的指标,不用在每个智能体或工具里重复实现指标逻辑。
如果以后我改用付费版的 Cube,已经做的工作能迁移过去吗?完全可以:数据模型双向兼容,你在 Cube Core 里构建的模型可以在 Cube 中原样运行,反过来也一样。
What are similar projects?redash, WrenAI, doris, metabase, dataease, superset, airbyte, starrocks
Creator
cube-js
Size
508.7 MB
Stars
21K
Age
8y
Commits · 90 Days