为聊天构建的图表
Charts built for Chat

原始链接: https://dbtcharts.com/blog/charts-built-for-chat/

AI 驱动分析技术的兴起引发了分歧:用户必须在生成复杂代码(HTML、JS、React)的“混乱自由”与传统 BI 工具那套受限的“既定轨道”之间做出选择。随着 AI 智能体取代人类成为图表的主要创建者,整个行业需要一种新方案。 dbt Labs 正致力于通过解耦 BI 层来解决这一问题,即把图表从以 UI 为先的私有应用中剥离出来,转化为代码。他们开源了 **dbt Charts**,这是一种结构化的 YAML 语言,允许用户和 AI 智能体通过简洁、可审计的代码定义交互式仪表板。 通过与 Git 中的 dbt 项目直接集成,dbt Charts 实现了分析领域内的版本控制、自动化测试和无缝 CI/CD。虽然该语言本身是开源且功能完备的,但 dbt Labs 也推出了 **dbtCharts.com**,这是一个托管平台,提供托管服务、访问控制以及用于对话式数据探索的交互界面。 该系统在优先考虑“代码优先”透明度的同时,保持了专业的开发标准。它使人类与 AI 能够围绕统一的真实数据源进行协作,推动数据可视化从碎片化的 UI 类 BI 转向开发者友好且具有凝聚力的开放标准。

Chartio(现为 Atlassian Analytics)的创始人 Dave 推出了 **dbt Charts**,这是一个旨在为仪表板创建过程引入结构化的开源工具。 随着 AI 智能体生成越来越多的自由格式 BI(商业智能)产物,这些产物往往难以审计或扩展。dbt Charts 通过提供一种简单的基于 YAML 的语言——本质上是“仪表板版的 Markdown”——解决了这一问题。它允许开发者以简洁、确定性的代码来声明并渲染图表。 该项目采用 Apache 2.0 许可证发布,旨在推动 BI 行业向更开放、更易于维护和更具可解释性的工作流程发展。Hacker News 社区对此反响积极,称赞该工具为 AI 工作流程中常见的、不一致的“感性编码”(vibe-coded)仪表板方案提供了一种简洁且可复现的替代方案。通过将仪表板视为可审计的代码,dbt Charts 使用户即使在底层数据发生变化时,也能保持一致性。
相关文章

原文

AI for data is here, and the long-promised self-serve analytics is finally happening. Anyone with a data connection can chat a report into existence in an afternoon, and the first results are impressive.

The frictions show up fast, though. By default an agent turns one simple report into a pile of files: HTML, CSS, and JavaScript, a couple of chart libraries, and a React or Streamlit app once it has to be live. Tracing a result back to its source means following it through several languages and files, which is slow for people to audit and costs the agent time and tokens on every change.

BI tools went the other way and bolted copilots onto their UI-first apps. That keeps the AI on governed rails, but narrow ones: the agent can do only what the UI exposes.

So today you choose between the messy freedom of code and the narrow control of a BI tool. We built a third option: skip ahead, or read on for how BI got here.

Unbundling BI

As dbt Labs founder Tristan Handy wrote recently in BI’s Second Unbundling:

When I started in data, BI tools were full-stack. Everything happened inside one product: data ingestion, transformation, compute, caching, semantics, visualization, identity. The BI tool was the data stack. MicroStrategy, Cognos, etc: they’re not just visualization tools, they’re integrated data platforms.

Then the modern data stack happened. From ~2015 to 2022, the infrastructure layers of that BI bundle got pulled out and turned into purpose-built infrastructure. Compute went to the Big 5. Ingestion went to Fivetran. Transformation went to dbt. The BI tool was left with: visualization, interactive analytical interfaces, semantic definitions (sometimes!), identity and access management, and web hosting.

  1. Warehousing Big 5
  2. E L T Extract Load Transform

BI everything else

What that unbundling left behind is the BI tool we know today, and charts are its biggest piece. They stayed in the UI for good reason: for most people, clicking is quicker than writing YAML. But more and more charts won’t be made by people. As the front end and user of everything becomes increasingly a chat agent, this preference flips. Agents are fluent in code, SQL, and Git, and clumsy in someone else’s UI. So charts need to move to where agents work: into code.

Today we’re taking the next step in unbundling BI: we’re open sourcing dbt Charts, which takes charts out of the BI tool and puts them in code, specifically a new structured YAML language that can declare a full interactive dashboard in one auditable YAML file. Chat freely with an agent, and what it makes has the freedom of code while staying easy to read.

  1. Warehousing Big 5
  2. E L T Extract Load Transform
  3. New C Chart

BI a few bits

In dbt Charts, SQL remains the language for declaring WHAT data you want to see, and we wrap that in YAML to declare HOW you want to see it.

We’ve spent a long time distilling the language to a few core, extensible elements: deep in what they can express, easy to organize and read. The YAML wraps more than SQL. Markdown carries the prose, and Jinja, as in dbt, carries variables and macros.

Here’s a small example: one variable (a UI filter), one query and one chart.

variables:
  status:
    column: main.documents.status

queries:
  doc_growth: |
    SELECT DATE_TRUNC('month', created_at) AS month,
           SUM(COUNT(*)) OVER (ORDER BY month)
             AS num_docs
    FROM main.documents
    WHERE {{ filter('status', status) }}
    GROUP BY 1

charts:
  growth:
    title: Documents created, all time
    type: area
    query: doc_growth
    x: month
    y: num_docs

rows:
  - growth

That file is the whole board. The CLI renders any board file to static SVG, or to HTML, PNG, PDF, and even the terminal, on your laptop or in CI, and serves a folder of them as a site:

dct render charts/documents.yml --format svg   # or html, png, pdf, terminal
dct serve

Those few elements go deep: over 1,100 config options today, across sixteen chart types and the composed charts built from them. And like any good language, it can express complex layouts and visuals.

You rarely set those options by hand. Styles cascade: a chart inherits from its board, the board from its theme, and a theme is one line to switch. A board can also extends: another board, so a house style or a standard report is written once and inherited everywhere. Boards stay short, and theming stays cheap.

A complete commercial performance board with KPIs, bars, a donut, a line chart, and a table

A complete dbt Charts board, rendered from one easy-to-read YAML file.

Deep integration with dbt

You don’t have to use dbt Charts with a dbt project, but when you do, a lot unlocks. The chart layer sits directly on the transform layer, and the deeper the integration, the easier it is to change both.

With dbt Charts, your charts/ directory lives next to your models/ in the same Git repo, so a change to a model and its charts ships on one branch, through one CI run, and breaks before it reaches production.

your_dbt_project/
  .git/
  dbt_project.yml
  models/
  charts/          # new folder in a dbt repo for your dashboards
    revenue.yml

Queries reach models through ref(), resolved from your manifest, so a renamed model or a missing column fails the pull request that broke it, before dbt run rebuilds the warehouse:

dbt parse && dct validate charts/

Support for the dbt Semantic Layer is planned, so a board can use a metric as the project defines it instead of restating its SQL. Follow dbt-labs/dbt-charts#1.

Built for chat

Agents can be quite blind, and they do best with a tight feedback loop. dbt Charts gives them one: strict validation of both the YAML and the SQL, and an extensive set of visualization checks that flag problems before anyone sees the board:

$ dct render charts/revenue.yml
WARN-BAR-BAND-WIDTH-TOO-NARROW
182 bands x 2 series across 640px
Fix: roll up to a coarser grain.

WARN-TABLE-COLUMNS-OVERFLOW
Table needs 980px but only 640px is available.
Fix: drop columns or widen the slot.

A beautiful, cohesive reporting system

We hope dbt Charts, like dbt before it, becomes the open standard language for its layer of the data stack. We designed it for a future where humans and AI build together, and we wanted it to look like that future, not like another dashboard grid. We recruited RJ Andrews, a data graphic designer, author, and historian, to design the charts. His grasp of the craft’s history is what makes the result feel new: it reaches past the dashboard era to what charts looked like when people drew them with care.

Many tools cheat with cards and boxes that fake alignment at the cost of visual noise and lost space. We worked out the spacing, sizing, and layout of every chart, on its own and next to its neighbors.

A dbt Charts board: showcase/general/dundersign-commercial-financeA dbt Charts board: showcase/general/one-dataset-nine-waysA dbt Charts board: showcase/boards/dundersign-support-operationsA dbt Charts board: showcase/boards/quarterly-business-reviewA dbt Charts board: showcase/charts/composed-chart-shapes

The result is a cohesive system of charts that feels a level above current BI.

Alongside the open-source language, today we’re launching dbtCharts.com in public beta: a hosted platform for the rest of BI. With charts pulled out, what remains is chiefly hosting, access control, and a UI. By their nature these perhaps can’t be unbundled, or at least shouldn’t be, so the platform handles them on top of the open-source language.

variables:queries:charts:rows:ChatUIHosting & AccessdbtCharts.comBI platformdbt ChartsOpen chart language: YAML and SQL Semantic layerOptional dbt modelsTransformation Your warehouseData same dbtGit repo

The platform connects to your warehouse and adds conversational analytics, a visual editor for the finishing touches, version history, and sharing with permissions for users and groups, so the people reading a board don’t need a warehouse login.

And of course, these charts were built for chat. The platform has first-class conversational analytics: like Claude or ChatGPT, but with permissioned read-only access to your warehouse and an expert analyst’s skills and tools built in. Explore by chatting with charts, and at any point click in to fine-tune and save the board.

Because it’s built on the open language, every change, from chat, the visual editor, or code, lands in the same YAML in your Git repo. Nothing is locked in: the same board runs on your laptop, in CI, and on the platform, and teams can self-serve, agent in hand, without creating a second, hidden data stack.

Try the beta

The dbt Charts language is open source under the Apache 2.0 license, and you can author, render, and serve boards locally without creating an account. Install it yourself, or hand your coding agent one line:

Terminal uv tool install dbt-charts
Claude / AI Make charts of this with dbt Charts. Start with: uv tool install dbt-charts && dct skills intro

dbt Charts is pre-1.0 and still changing. When the grammar changes, boards migrate as they parse, so the boards you write today keep rendering. Try it, tell us what is missing[1][2], join the discussion in #dbt-charts on Slack, and help us build the chart layer that open data infrastructure has been waiting for.

联系我们 contact @ memedata.com