开源项目 GitHub Trending 2026-07-19T12:00 正文 ok 1381 words

🔥 Canner/WrenAI

英文标题:🔥 Canner/WrenAI

WrenAI 是一个开源 GenBI 引擎,允许 AI 代理在 22 种以上数据源上生成、部署和治理商业智能。它通过开放的上下文层为代理提供模式之外的知识,确保生成的 SQL、图表和仪表板可信、可审查且版本可控。该工具为开发者提供了从自然语言问题到可共享仪表板的完整代理驱动工作流,并内置知识管理与受控执行原语。
打开原文相关 5 · 机会 5
media7.7 KB media9.5 KB media1.3 KB media1.3 KB media1.8 KB media1.3 KB media5.1 KB media1.2 MB media256.9 KB media57.8 KB

中文

📣 2026-05-07 : Wren Engine 已合并至本仓库 core/ 目录。之前的 Canner/wren-engine 仓库已归档。旧版 WrenAI GenBI 应用(基于 Docker、以聊天为中心的 BI 产品)保留在 legacy/v1 分支(标签 v1-final),现更名为 Wren GenBI Classic;见下方关于 “GenBI” 命名的说明。阅读公告 →


WrenAI 是 开源 GenBI 引擎:它让 AI 代理能够生成、部署和治理商业智能,从 SQL 答案到可共享的仪表板,覆盖 22 种以上数据源。

让输出可信的是底层的开放 上下文层,它为代理提供了模式之外的知识。这意味着业务语义、经过批准的定义、示例、记忆和治理,加上存在于文档、Wiki 和聊天线程中的非结构化公司知识。生成式 BI 的效果取决于它所依赖的上下文,而 Wren 就是这种上下文,并可供你已运行的每个代理审查和复用。

Wren AI 架构

三步理解 GenBI:生成 · 部署 · 了解

  • 生成。 你的代理将业务问题转化为 受控 SQL 和图表。基于模式感知的检索、MDL 规划、预演验证和结构化错误确保答案正确,而非自信地犯错。
  • 部署。 将任何答案转化为基于浏览器端的可共享仪表板,由 wren-core-wasm 驱动,并用一条命令部署到你自己的 Vercel 或 Cloudflare Pages 账户。
  • 了解。 让这一切保持正确的知识以可版本化、有证据链接的文件形式存在:语义模型(MDL)、公司定义(instructions.md)以及过往有效查询的记忆。可审查,便于 Git 管理,永远不会被锁在别人的界面里。

为什么代理构建者选择 WrenAI

  • 端到端的生成式 BI。 不只是文本到 SQL。生成答案,部署仪表板,分享 URL,全部由你已经在用的代理驱动。
  • 内置知识管理。 业务含义、经过批准的定义和经过验证的示例被捕获为可审查、版本控制的上下文,而非埋在提示词中。
  • 默认开放。 核心、SDK 和技能采用 Apache-2.0 许可证开源。
  • 正确性原语。 丰富的模式检索、预演验证、带提示的结构化错误、值分析、评估运行器。代理负责编排,推理痕迹记录在其中。
  • 运行在你现有技术栈之上。 数据仓库、转换管道、你现有的语义层。无需额外维护另一个工具。
原始 LLM 代理 传统 BI 工具 裸语义层 WrenAI
为你写 SQL ✅ (经常出错) ❌ ❌
理解你的业务定义 ❌ 部分,工具内 ✅ (仅模式)
生成并部署仪表板 ❌ ✅ (手动,工具内) ❌
通过 你的 代理工作(Claude Code、Cursor、MCP…) ✅ ❌ ❌
开放、可审查、Git 友好的上下文 ❌ ❌ 部分
跨越 22+ 数据源的受控执行 ❌ 按连接器 ✅ (仅定义)
  • 你希望 AI 代理产出可信的 BI,包括答案 和 仪表板,而不仅仅是看似合理的 SQL。
  • 你的业务逻辑(定义、枚举、单位、经过批准的关联)位于数据库之外,而你的代理总是搞错。
  • 你希望上下文是 开放、可审查且版本控制的,每个代理和人都能使用,而非被某个供应商界面独占。

如果你的情况符合以下描述,请跳过 Wren: 你只需要基于单个 CSV 的一次性图表,或者你乐于让代理在没有治理的情况下猜测 SQL。

WrenAI 按设计由代理驱动:安装 CLI,为你的 AI 客户端安装单文件发现存根,然后让 AI 代理处理其余工作。工作流指南内置于 CLI 中,并按需提供,因此内容始终与安装版本匹配。

pip install wrenai                      # 核心(包含 DuckDB)
pip install "wrenai[postgres,memory]"   # 根据需要添加各数据源和记忆扩展

中国大陆用户提示: 如果 pip install 速度慢或失败,请使用清华大学镜像:

pip install wrenai -i https://pypi.tuna.tsinghua.edu.cn/simple

如果 HuggingFace 模型下载超时,在运行 CLI 前添加 export HF_ENDPOINT=https://hf-mirror.com。

2. 为你的 AI 客户端安装发现存根

npx skills add Canner/WrenAI            # 自动检测 Claude Code、Cursor、Cline、Codex 等

存根约 50 行。它教代理通过 wren skills get <name> 获取工作流指南,通过 wren ask "<question>" --guided|--direct 获取格式化提示,其余一切都在 CLI 中。

3. 让代理设置一切

在项目目录中打开你的代理,然后说类似:

"使用 Wren 设置我的 Postgres 数据库。"

代理会运行 wren skills get onboarding,按指南逐步操作,检查你的环境,创建连接配置文件,搭建项目,并执行第一个查询。

4. (可选)丰富项目:了解 阶段

设置完成后,说:

"用 raw/ 中的业务上下文丰富我的 Wren 项目。"

代理运行 wren skills get enrich-context,并按指南在 grill 模式(一次一个问题)或 auto-pilot 模式(代理读取 <project>/raw/ 并提出建议)下操作。两种模式都会写入 MDL、指令、查询和记忆,全部可审查,且便于 Git 管理。

5. 提问:生成 阶段

"本季度按销售额排前 10 的客户是谁?"

你的代理获取 MDL 上下文,回忆相似的历史查询,编写受控 SQL,并通过 wren query 执行。

6. 构建与部署仪表板:部署 阶段

"把它变成一个我可以筛选和分享的交互式仪表板,并部署到 Vercel。"

代理运行 wren skills get genbi,从项目上下文中构建浏览器端 GenBI 应用,本地预览,然后部署到你自己的 Vercel 或 Cloudflare Pages 账户,返回实时可共享的 URL。参见构建与部署 GenBI 应用指南。

想在没有自己数据库的情况下试用? 让代理使用内置的 jaffle_shop 示例数据集。流程相同,几分钟内即可端到端查询真实数据仓库。

先从两阶段开始,然后第三阶段

# 第一天(代理驱动)
wren skills get onboarding         # 工作流指南:设置项目 + 首次查询  (生成)
wren skills get enrich-context     # 工作流指南:添加业务上下文         (了解)
wren skills get genbi              # 工作流指南:构建并部署仪表板       (部署)

# 日常
wren query --sql '...'             # 通过 MDL 语义层查询
wren ask "<question>" --guided     # 为较弱代理包装问题
wren ask "<question>" --direct     # 为较强代理包装问题

开始快,深入时灵活。始终可审查且 Git 友好。

  • 建模定义语言 (MDL) :模型、列、关系、视图、立方体、度量、行级/列级访问控制 (RLAC / CLAC)

  • 引擎:基于 Apache DataFusion,支持 22 种以上数据源

  • GenBI 仪表板:代理构建的浏览器端应用,由 wren-core-wasm 驱动,可部署到 Vercel / Cloudflare Pages

  • 知识与记忆:版本控制的 instructions.md 和 queries.yml 中的业务含义,加上本地 LanceDB 记忆索引(混合检索)供召回

  • 代理 SDK:wren-langchain(LangChain / LangGraph)、wren-pydantic;供其他技术栈参考的 Python 集成

  • 受控执行原语:函数、预演、行限制、访问控制

  • 端到端正确性原语:值分析、丰富检索、结构化错误、黄金评估运行器

  • 代理原生分发:跨主流代理框架的一流 SDK;参见 GitHub Discussions 了解下一步优先计划

  • 完全受控执行:审计日志、速率限制、审批工作流、数据流检查器

完整路线图和设计说明:参见简介。

关于“GenBI”命名的说明

“GenBI”现在指代这种开源生成式 BI 能力:在 Wren 上下文层之上,代理生成受控答案并部署仪表板。早期的 Wren AI GenBI 应用,即基于 Docker 的聊天优先 BI 产品,现更名为 Wren GenBI Classic,保留在 legacy/v1 分支(无新功能或安全修复)。如需该经典体验的维护版本和托管版本,请参阅 Wren AI Commercial。

社区

我们坚持公开建设。欢迎提交 Issues、PR、连接器贡献、SDK 集成、文档修正。

项目结构(点击展开)

core/
  wren-core/         Rust 语义引擎 (Apache DataFusion)
  wren-core-base/    共享清单类型 + MDL 构建器
  wren-core-py/      Python 绑定 (PyPI: wren-core)
  wren-core-wasm/    WebAssembly 构建 (npm: wren-core-wasm)
  wren/              Python SDK 和 CLI (PyPI: wrenai)
  wren-mdl/          MDL JSON 模式
sdk/
  wren-langchain/    参考代理 SDK 集成
skills/              上下文编写的代理技能
docs/                模块文档
examples/            示例项目

WrenAI 贡献者

Apache 2.0。见 LICENSE。


一起构建开放的 GenBI。

如果 WrenAI 对你有帮助,请给个 ⭐,这对我们的成长真的有帮助!

English / 原文

📣 2026-05-07 : Wren Engine has merged into this repo under core/. The previous Canner/wren-engine repo is archived. The previous WrenAI GenBI app (the Docker-based chat-first BI product) is preserved on the legacy/v1 branch (tag v1-final) and is now Wren GenBI Classic ; see A note on the "GenBI" name below. Read the announcement →


WrenAI is the open-source GenBI engine : it lets AI agents generate, deploy, and govern business intelligence, from a SQL answer to a shareable dashboard, across 22+ data sources.

What makes the output trustworthy is the layer underneath: an open context layer that gives agents what schemas don't. That means business semantics, approved definitions, examples, memory, and governance, plus the unstructured company knowledge that lives in your docs, wikis, and chat threads. Generative BI is only as good as the context it stands on, and Wren is that context, made reviewable and reusable by every agent you already run.

Wren AI architecture

GenBI in three beats: Generate · Deploy · Know

  • Generate. Your agent turns a business question into governed SQL and charts. Schema-aware retrieval, MDL planning, dry-plan validation, and structured errors keep it correct instead of confidently wrong.
  • Deploy. Turn any answer into a shareable, browser-side dashboard powered by wren-core-wasm and ship it to your own Vercel or Cloudflare Pages account with one command.
  • Know. The knowledge that makes all of this correct lives in versionable, evidence-linked files: semantic models (MDL), company definitions (instructions.md), and a memory of what worked. Reviewable. Git-friendly. Never locked inside someone else's UI.

Why agent builders pick WrenAI

  • Generative BI, end to end. Not just text-to-SQL. Generate the answer, deploy the dashboard, share the URL, all driven by the agents you already use.
  • Knowledge management built in. Business meaning, approved definitions, and proven examples are captured as reviewable, version-controlled context, not buried in prompts.
  • Open by default. Open-sourced core, SDK, and skills under the Apache-2.0 license.
  • Correctness as primitives. Rich schema retrieval, dry-plan validation, structured errors with hints, value profiling, eval runner. The agent orchestrates; the trace lives in its reasoning.
  • Sits on top of your existing stack. Warehouse, transformation pipelines, your existing semantic layer. Not another tool to maintain.

| A raw LLM agent | A traditional BI tool | A bare semantic layer | WrenAI
---|---|---|---|---
Writes SQL for you | ✅ (often wrong) | ❌ | ❌ | ✅ governed
Knows your business definitions | ❌ | partial, in-tool | ✅ (schema only) | ✅ + non-schema knowledge
Generates & deploys dashboards | ❌ | ✅ (manual, in-tool) | ❌ | ✅ agent-driven
Works through your agents (Claude Code, Cursor, MCP…) | ✅ | ❌ | ❌ | ✅
Open, reviewable, Git-friendly context | ❌ | ❌ | partial | ✅
Governed execution across 22+ sources | ❌ | per-connector | ✅ (definitions only) | ✅

  • You want AI agents to produce trustworthy BI , answers and dashboards, not just plausible SQL.
  • Your business logic (definitions, enums, units, approved joins) lives outside the database and your agents keep getting it wrong.
  • You want context that's open, reviewable, and version-controlled , usable by every agent and person, not gated behind one vendor's UI.

Skip Wren if you only need a one-off chart from a single CSV, or you're happy letting an agent guess at SQL with no governance.

WrenAI is agent-driven by design : install the CLI, install a one-file discovery stub for your AI client, then let your AI agent drive the rest. Workflow guides live inside the CLI itself and are served on demand, so content always matches the installed version.

pip install wrenai                      # core (DuckDB included)
pip install "wrenai[postgres,memory]"   # add per-datasource and memory extras as needed

Tip for users in mainland China: If pip install is slow or fails, use the Tsinghua mirror:

pip install wrenai -i https://pypi.tuna.tsinghua.edu.cn/simple

If HuggingFace model downloads time out, add export HF_ENDPOINT=https://hf-mirror.com before running the CLI.

2. Install the discovery stub for your AI client

npx skills add Canner/WrenAI            # auto-detects Claude Code, Cursor, Cline, Codex, …

The stub is ~50 lines. It teaches your agent to fetch workflow guides via wren skills get <name> and shaped prompts via wren ask "<question>" --guided|--direct, and everything else lives in the CLI.

3. Ask your agent to set things up

Open your agent in a project directory and say something like:

"Use Wren to set up my Postgres database."

The agent runs wren skills get onboarding, follows the guide step-by-step, checks your environment, creates a connection profile, scaffolds the project, and runs a first query.

4. (Optional) Enrich the project: the Know beat

Once onboarding finishes, ask:

"Enrich my Wren project with the business context in raw/."

The agent runs wren skills get enrich-context and follows the guide in grill mode (one question at a time) or auto-pilot mode (agent reads <project>/raw/ and proposes). Both modes write to MDL, instructions, queries, and memory, all reviewable, all Git-friendly.

5. Ask questions: the Generate beat

"Who are our top 10 customers by sales this quarter?"

Your agent fetches MDL context, recalls similar past queries, writes governed SQL, and executes via wren query.

6. Build & deploy a dashboard: the Deploy beat

"Turn that into an interactive dashboard I can filter and share, and deploy it to Vercel."

The agent runs wren skills get genbi, builds a browser-side GenBI app from your project's context, previews it locally, and ships it to your own Vercel or Cloudflare Pages account, returning a live, shareable URL. See the Build & deploy a GenBI app guide.

Want to try it without your own database? Ask your agent to use the bundled jaffle_shop sample dataset. Same flow, querying a real warehouse end-to-end in a couple of minutes.

Two beats first, then the third

# Day 1 (agent-driven)
wren skills get onboarding         # workflow guide: set up project + first query  (Generate)
wren skills get enrich-context     # workflow guide: add business context           (Know)
wren skills get genbi              # workflow guide: build & deploy a dashboard      (Deploy)

# Day-to-day
wren query --sql '...'             # query through the MDL semantic layer
wren ask "<question>" --guided     # wrap a question for a weaker agent
wren ask "<question>" --direct     # wrap a question for a stronger agent

Fast at first. Deep when you need it. Always reviewable and Git-friendly.

  • Modeling Definition Language (MDL) : models, columns, relationships, views, cubes, metrics, row-level / column-level access control (RLAC / CLAC)

  • Engine : Apache DataFusion based, 22+ data sources

  • GenBI dashboards : agent-built, browser-side apps powered by wren-core-wasm, deployable to Vercel / Cloudflare Pages

  • Knowledge & memory: business meaning in version-controlled instructions.md and queries.yml, plus a local LanceDB memory index (hybrid retrieval) for recall

  • Agent SDK : wren-langchain (LangChain / LangGraph), wren-pydantic; reference Python integration for other stacks

  • Governed execution primitives : functions, dry-plan, row limits, access control

  • End-to-end correctness primitives : value profiling, rich retrieval, structured errors, golden eval runner

  • Agent-native distribution : first-class SDKs across major agent frameworks; see GitHub Discussions for what's prioritized next

  • Full governed execution : audit logs, rate limits, approval workflow, data-flow inspector

Full roadmap and design notes: see the introduction.

A note on the "GenBI" name

"GenBI" now refers to this open-source generative-BI capability: agents that generate governed answers and deploy dashboards on top of Wren's context layer. The earlier Wren AI GenBI app, the Docker-based chat-first BI product, is now Wren GenBI Classic , preserved on the legacy/v1 branch (no new features or security fixes). For a maintained, hosted version of that classic experience, see Wren AI Commercial.

Community

  • 💬 Discord: chat with the team and other builders
  • 🐙 GitHub Discussions: design conversations, RFCs, longer threads
  • 🐦 Twitter / X: release notes and short updates
  • 🗞 Blog: vision, post-mortems, deep dives

We build in the open. Issues, PRs, connector contributions, SDK integrations, docs fixes are all welcome.

Project structure (click to expand)

core/
  wren-core/         Rust semantic engine (Apache DataFusion)
  wren-core-base/    Shared manifest types + MDL builder
  wren-core-py/      Python bindings (PyPI: wren-core)
  wren-core-wasm/    WebAssembly build (npm: wren-core-wasm)
  wren/              Python SDK and CLI (PyPI: wrenai)
  wren-mdl/          MDL JSON schema
sdk/
  wren-langchain/    Reference agent SDK integration
skills/              Agent skills for context authoring
docs/                Module documentation
examples/            Example projects

WrenAI contributors

Apache 2.0. See LICENSE.


Come build open GenBI with us.

If WrenAI helps you, drop a ⭐, it genuinely helps us grow!

⬆️ Back to top