商业产业 Hacker News LLM 2026-10-01T21:29 正文 ok 1204 words

Show HN:Graphene——面向编程 Agent 的数据分析工具包

英文标题:🔶 Show HN: Graphene – Data analysis toolkit for your coding agent

Graphene 是一款面向编程 Agent 的全代码化数据分析框架,覆盖基于 SQL 的数据探索、可视化与报告构建。其核心包括语义层 Graphene SQL,以及以 Markdown 文件定义的仪表盘页面,旨在提升查询准确性和可视化的一致性。Graphene SQL 支持 ANSI SQL 风格、170 余项函数,并可接入 Snowflake、BigQuery、ClickHouse、Postgres、MotherDuck 和 DuckDB 本地数据。该项目可永久免费用于内部场景,业务逻辑保存在用户自己的代码仓库中;团队正开发 Graphene Cloud,用于托管 Agent 生成的仪表盘和报告。
打开原文相关 6 · 机会 1
media67.6 KB media1.8 MB media1.2 MB media57.5 KB

中文

Graphene 是一个为编程 Agent 打造的数据分析框架。
当 Agent 完成工作时,你可以更快 10 倍地提出问题并构建可视化内容。

Graphene 是一个全代码化的数据分析框架,用于基于 SQL 的数据探索、可视化和报告。其设计时将编程 Agent 作为主要用户角色。

它提供两项关键能力,帮助编程 Agent 更好地完成数据工作:

  1. 语义层:提高查询准确性。Graphene SQL 将 SQL 的能力与指标治理及建模关联(modeled joins)相结合。
  2. 仪表盘文件类型:相较于原始 Python 或 Javascript,可产出更一致、更精致的可视化效果。

设计目标

  • Token 效率。语言设计力求简洁,尽量减少样板代码。
  • Agent 易用性。Graphene 完全通过 CLI 控制;所有文档均包含在我们的 Agent skill 中。
  • 高能力上限。Graphene SQL 遵循 ANSI 标准并支持超过 170 个函数;Graphene 页面支持所有可通过 HTML、CSS、Javascript 和 ECharts 表达的内容。

我们相信,将编程 Agent 与全代码化分析技术栈结合,相比传统 BI 在多个方面更具优势:

  • 拥有广泛的 SOTA LLM、编排框架、skill 和工具生态
  • 可利用其他工具或代码仓库中的全企业上下文
  • 可跨工具完成端到端任务,其中数据分析只是其中一步
  • 具备更平滑的变更管理和批量重构能力
  • 可轻松将逻辑提升到语义层中,或从语义层中下沉出来
  • 版本控制与 CI。可撤销 Agent 的错误,并为关键任务仪表盘运行测试。
  • 紧密且完整的迭代闭环。Agent 可在运行前验证、查看仪表盘并在本地迭代。
  • 可利用持续运行的 Agent 实现代码库自愈

Graphene 可永久免费使用。你的业务逻辑存放在自己的代码仓库中,绝不会被锁定在与我们的合同里。

Graphene 页面支持可视化、用于筛选和动态行为的输入组件,以及面向监控型仪表盘和叙事型笔记本的布局模式。

Graphene 截图

强大的下一代语义层

传统语义层通常以牺牲能力为代价来实现治理。它们往往提供编程 Agent 不熟悉的小众查询 API。

Graphene SQL 的目标是在不牺牲能力的前提下实现治理。它的行为与常规 SQL 一致——支持 CTE、子查询、窗口函数、集合运算符等——同时加入了语义层中的度量(measure)和建模关联概念。

Graphene SQL 的灵感来自 Malloy。Malloy 由 LookML 的创造者 Lloyd Tabb 和 Michael Toy 开发;不过 Graphene 将这一理念实现为经典 SQL,以便 Agent 更容易理解和使用。

Graphene 当前支持 Snowflake、BigQuery、ClickHouse、Postgres、MotherDuck 和本地数据(通过 DuckDB)作为数据源。我们很容易添加更多数据源——只要告诉我们你的需求。

完成项目设置后,只需通过 npm exec graphene serve(或根据你的包管理器使用 pnpm graphene serve 等)启动开发服务器,然后提示你的编程 Agent 完成分析工作:回答数据问题、构建仪表盘、编辑模型等。

Graphene 本身是一个可通过 npm(或 pnpm、yarn 等)安装的 CLI。该 CLI 可以运行和编译 Graphene SQL 查询、在浏览器中渲染页面、检查语法、输出截图等。

Graphene 项目既可以是独立代码仓库,也可以是大型代码库(如 dbt)中的一个目录。它由通过 .gsql 文件定义的语义模型和通过 .md 文件定义的页面组成。

架构图

Graphene SQL 与 Graphene Markdown

语义模型定义如下:

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
)

随后可通过 select 查询模型:既可以直接通过 CLI 查询,也可以像下面这样在 Graphene Markdown 页面中查询。

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" />

Graphene 的全部文档以 Agent skill 的形式随 Graphene npm 包一同发布。源文件可在这里查看。

为什么选择编程 Agent?
主要是因为上下文。如果你的 BI 技术栈所在文件夹紧邻公司其余数据和代码,Agent 就能更智能地判断应分析什么,以及这些分析为何重要。

反过来也成立。如果你正在开发某项新功能,或为新客户制定建议,负责这些工作的 Agent 可以基于真实数据和过去的分析洞察来确定其处理方式。

我们常听到的另一个重要原因是锁定问题。后 SaaS 时代的人们担心数据和仪表盘被锁在某个专有工具中,或被迫使用单一 LLM 提供商。使用 Graphene 时,你拥有代码仓库中的全部文件,并可以使用任何你喜欢的 Agent 或 LLM。

你们如何赚钱?
我们正在构建 Graphene Cloud,将其作为一站式解决方案,用于托管你的 Agent 构建的仪表盘和报告。我们还托管了一个 MCP server 和 Slack bot,可用于快速提问。如果你希望试用,请在这里联系我们。

是否每个人都必须使用 git 和编程 Agent,才能通过 Graphene 做 BI?
如果你只想使用这个项目,而不需要更多功能,那么是的。我们的托管服务 Graphene Cloud 则提供 Slack Agent、MCP server 和基于浏览器的 SaaS 体验。

我的数据团队会失业吗?
不会,但我们认为工作的性质将发生变化。数据专家不再手动构建报告,而是会塑造团队其他成员用于回答数据问题的 skill、模型和工具。

数据团队将专注于指导 Agent 如何处理公司中最棘手、最模糊的数据问题。这些问题仍需要数据专家的判断力,才能得出高质量的解决方案。

我不能直接使用 React 或 Python notebooks 吗?
当然可以!事实上,我们交流过的许多人已经开始走这条路线。你会遇到的主要问题是一致性:仪表盘和报告的视觉风格会变得参差不齐;在最糟的情况下,它们甚至会使用不同公式计算同一个关键指标。

Graphene SQL 将指标编码为可在查询中直接调用的确定性对象。这不仅能确保每次使用“EBITDA”时结果都保持一致,我们附加的元数据标签还可以提示图表以正确方式格式化数据。

Graphene 抬高了基础质量门槛,因此在 Agent 帮助下生成的页面默认就足够美观,让你以更少的 Token 更快推进工作。

该软件采用什么许可证?
Graphene 采用 Elastic License 2.0 许可,允许你永久免费将其用于内部使用场景。如果你希望使用 Graphene 构建自己的商业应用,请在这里联系我们。

English / 原文

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

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

  • Token efficiency. Languages are designed to be brief with minimal boilerplate.
  • Agent ergonomics. Graphene is controlled entirely via CLI. All documentation is inside our agent skill.
  • High ceilings. Graphene SQL follows ANSI and supports over 170 functions; Graphene pages support anything that can be expressed with HTML, CSS, Javascript, and ECharts.

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

  • Broad ecosystem of SOTA LLMs, harnesses, skills, and tools
  • Leverage business-wide context from other tools or repos
  • Perform end-to-end tasks across tools, where analytics is just one step
  • More graceful change management and bulk refactors
  • Easily promote/demote logic into or out of the semantic layer
  • Version control and CI. Revert agent mistakes. Run tests on mission-critical dashboards.
  • Tight, complete iteration loops. Agents can validate before running, view dashboards, and iterate locally
  • Leverage continuous agents for self-healing codebases

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

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.

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.

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" />

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

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.