graphene README

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


Graphene Logo

Graphene is a data analytics framework built for coding agents.
Ask questions and build visualizations 10x faster when agents do the work.

Website  •  Demo Project  •  Setup

Why Graphene?

Graphene is an everything-as-code analytics framework for SQL-based data exploration, visualization, and reporting. It is designed with coding agents in mind as the primary user persona.

It provides two critical pieces that allow coding agents to do better data work:

  1. A semantic layer, which yields more accurate queries. Graphene SQL combines the power of SQL with the governance of metrics and modeled joins.
  2. A dashboard file type, which yields more consistent and polished visuals compared to raw Python or Javascript.

Design goals

Versus traditional BI

We believe coding agents coupled with an everything-as-code analytics stack beats traditional BI in several ways:

Open, forever

Graphene is free to use, forever. Your business logic lives in your repo and is never locked into a contract with us.

Rich visualizations

Graphene pages support visualizations, input components for filtering and dynamic behaviors, and layout modes for monitoring-oriented dashboards vs. narrative-oriented notebooks.

Graphene Screenshots

Powerful, next-generation semantic layer

Traditional semantic layers give you governance at the expense of capability. They tend to expose niche query APIs that agents aren't familiar with.

Graphene SQL's goal is to bring governance without sacrificing capability. It behaves like regular SQL—with CTEs, subqueries, window functions, set operators, and more—but also adds in the concepts of measures and modeled joins from semantic layers.

Graphene SQL is inspired by Malloy, from the creators of LookML Lloyd Tabb and Michael Toy, but implements it as good old SQL for agent familiarity.

Get started

Graphene currently supports Snowflake, BigQuery, ClickHouse, Postgres, MotherDuck, and local data (via DuckDB) as data sources. It is easy for us to add more - just ask.

Once your project is set up, simply start the dev server via npm exec graphene serve (or pnpm graphene serve, etc. based on your package manager) and then prompt your coding agent to do analytics work: answer a data question, build a dashboard, edit the model, etc.

How it works

Graphene itself is a CLI which can be installed via npm (or pnpm, yarn, etc.). The CLI can run and compile Graphene SQL queries, render pages in the browser, check syntax, print screenshots, and more.

A Graphene project can either be a standalone repo or a directory within a larger codebase (such as dbt). It is comprised of semantic models via .gsql files and pages via .md files.

Architecture Diagram

Graphene SQL and Graphene markdown

Semantic models are defined like so:

table orders (
  id BIGINT
  user_id BIGINT
  amount FLOAT
  status STRING

  join one users on user_id = users.id  -- many orders per user

  is_complete: status = 'Complete'      -- dimension (scalar expression)
  revenue: sum(amount)                  -- measure (agg expression)
  aov: revenue / count(*)               -- measures can compose
)

table users (
  id BIGINT
  name VARCHAR

  join many orders on id = orders.user_id
)

Models are then queried via select, either directly via CLI or inside a Graphene markdown page like this.

```sql top_customers
select
  users.name as name,   -- Use the dot operator to traverse the modeled join relationship
  revenue               -- Invokes the measure
from orders             -- A join statement here is not needed
group by 1
order by 2 desc
limit 10
```

<BigValue data="orders" value="revenue" />
<BarChart data="top_customers" x="name" y="revenue" />

Documentation

Graphene's entire documentation ships as an agent skill in the Graphene npm package. The source files are available here.

FAQ

Why coding agents?
Context, mostly. If your BI stack lives in a folder right next to the rest of your company’s data and code, an agent can make smarter decisions on what it should be analyzing and why it matters.

The reverse is also true. If you’re working on building out some new feature or a recommendation for a new client, the agent doing that work can ground it’s approach in real data and past analytical insights.

Lock-in is the other big reason we hear. Folks post-SaaS are wary of having their data and dashboards locked away in some proprietary tool, or forced to use a single LLM provider. With Graphene, you own all the files in your repo. You can use whatever agent or LLM you’d like.
How do you make money?
We’re building out Graphene Cloud as a turnkey solution to host the dashboards and reports your agent builds. We also host an MCP server and Slack bot that you can use for quick questions. If you'd like to pilot it, contact us here.
So does everyone have to use git and a coding agent to use Graphene for BI?
If you just want to use this project and nothing more, yes. Our managed service, Graphene Cloud, offers a Slack agent, MCP server, and browser-based SaaS experience.
Is my data team out of a job?
No, but we think the nature of the work is going to change. Instead of manually building out reports, data experts are going to be shaping the skills, models, and tools that the rest of their team uses to answer data questions.

Data teams are going to be focused on guiding agents on how to approach the trickiest and most nebulous data questions at a company. Questions that still require a data expert’s taste to get a good solution.
Can’t I just use React? Or python notebooks?
You could! In fact a lot of the folks we’ve talked to have started down this route. The main problem you’ll run into is consistency. The look and feel of your dashboards and reports are all over the place, and in the worst case they end up using different formula to compute the same key metric.

Graphene SQL codifies metrics into deterministic objects you can directly invoke in queries. Not only does this ensure that every use of "EBITDA" will be the same, the metadata tags we attach can hint our charts into formatting data correctly.

Graphene raises the floor so that pages you generate with the help of an agent look beautiful by default, so you can move faster with less tokens.
What software license does this use?
Graphene is licensed under the Elastic License 2.0 which allows you to use it for internal use cases for free, forever. If you would like to build your own commercial application with Graphene, please contact us here.

graphene (graphene-data/graphene)

Searching Database…

这是什么?Graphene 是一个专为编程 agent 打造的“一切皆代码”分析框架:它添加了 SQL 语义层和仪表盘文件格式,让 agent 能够回答数据问题并构建精美的可视化,而不需要人去 BI 工具里点来点去。
这是一个托管的 BI 仪表盘应用,还是代码优先的框架?它是代码优先的:语义模型放在你自己 git 仓库的 .gsql 文件里,仪表盘放在 .md 页面里,由 CLI 编译和提供服务,而不是在托管的拖拽式工具里编辑。
怎么让一个 Graphene 项目跑起来?从 npm 安装 Graphene CLI,创建项目(或克隆演示项目),其中包含 .gsql 模型和 .md 页面,然后运行 npm exec graphene serve(或 pnpm/yarn 的等价命令)启动开发服务器,再让编程 agent 构建仪表盘。
Graphene 可以连接哪些数据库?它目前可以连接 Snowflake、BigQuery、ClickHouse、Postgres、MotherDuck,或通过 DuckDB 连接本地数据,团队表示按需求添加更多数据源很容易。
使用 Graphene 必须用 git 和编程 agent 吗?对于免费的自托管版本,是的——README 明确指出,不用 git/agent 的唯一替代选择是付费的 Graphene Cloud,后者额外提供 Slack agent、浏览器 SaaS 界面和 MCP 服务器。
Graphene SQL 到底是什么?它的行为就像带 CTE、子查询和窗口函数的常规 ANSI SQL,但增加了来自语义层的度量和建模连接,这样你可以直接写“revenue”或“users.name”之类的东西,而不用手写连接和聚合。
为什么不直接用 React 或 Python notebook 搭建仪表盘?可以,但走这条路的团队最终会得到不一致的视觉样式和重复的指标公式;Graphene 把指标固化成确定性对象,让每个图表都以同样的方式计算“EBITDA”,并默认渲染一致。
核心项目免费,公司怎么赚钱?靠 Graphene Cloud,这是一个付费托管服务,托管 agent 构建的仪表盘和报告,还附带一个用于快速即席提问的 Slack 机器人和 MCP 服务器。
Graphene SQL 的设计灵感来自哪里?它的灵感来自 LookML 创造者打造的 Malloy,但实现为普通 SQL 而不是新的查询语言,因此已经熟练掌握 SQL 的编程 agent 可以立即上手。
Size
23 MB
Stars
215
Age
1y
Commits · 90 Days