Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
W

WrenAI

> 数据库
Open source

GenBI (Generative BI) for AI agents, an open-source, governed text-to-SQL through an open context layer that turns natural-language questions into trusted dashb

16.8K stars0 likes3 views
WebsiteGitHub

About

GenBI (Generative BI) for AI agents, an open-source, governed text-to-SQL through an open context layer that turns natural-language questions into trusted dashb

📣 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 →


What WrenAI is

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

What makes the output trustworthy is the layer underneath: an open AI context layer plus a governed semantic layer (MDL) 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.

GenBI in three beats: Generate · Deploy · Know

  • Generate. Your agent turns a business question into governed text-to-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. Wren does governed text-to-SQL — and goes beyond it: 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 a reviewable, version-controlled semantic layer (MDL), 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.
  • Governed execution, reviewable context. Dry-plan validation, row limits, and structured errors keep agent-generated SQL inside guardrails, and every definition and example lives in Git — reviewable, versioned, diff-able. (Row/column-level security and access control are Cloud / self-hosted — see Open core: OSS vs. Cloud / self-hosted.)
  • Sits on top of your existing stack. Warehouse, transformation pipelines, your existing semantic layer. Not another tool to maintain.

How Wren compares

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) ✅

Wren is for you if…

  • 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 an AI context layer and semantic layer that are 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.

Quickstart

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.

1. Install the CLI

bash
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:

bash
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

bash
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

bash
# 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.

Semantic layer (MDL)

Wren is a governed semantic layer, expressed in the Modeling Definition Language (MDL) — a Git-friendly, reviewable definition of what your data means, not just where it lives. Every text-to-SQL answer and dashboard is planned against it, so agents inherit your business truth instead of guessing.

MDL covers:

  • Models, columns, relationships, and views — the shape of your data, decoupled from any one warehouse.
  • Cubes and metrics — approved, reusable definitions so "revenue" means the same thing everywhere.
  • Business context beyond the schema — enums, units, approved joins, and definitions in version-controlled instructions.md and queries.yml.

Unlike a bare semantic layer that only stores definitions, Wren pairs the semantic layer with an AI context layer — memory, examples, and unstructured company knowledge — and a governed execution engine, so the same definitions that describe your data also run it correctly across 22+ sources.

What's Included

  • Modeling Definition Language (MDL) — the semantic layer: models, columns, relationships, views, cubes, metrics
  • Engine: Apache DataFusion based, 22+ data sources (BigQuery, Snowflake, PostgreSQL, ClickHouse, Amazon Redshift, Databricks, DuckDB, and more)
  • GenBI dashboards: agent-built, browser-side apps powered by wren-core-wasm, deployable to Vercel / Cloudflare Pages
  • Knowledge & memory — the AI context layer: 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, structured errors

What's next

  • 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 roadmap and design notes: see the introduction.

FAQ

What is generative BI (GenBI)?

Generative BI (GenBI) is business intelligence produced by AI agents: instead of manually building charts, an agent generates governed SQL, deploys a dashboard, and shares it — grounded in an AI context layer so the output is trustworthy, not just plausible. Wren AI is the open-source GenBI engine.

Does Wren AI do text-to-SQL?

Yes — Wren does governed text-to-SQL: agents turn natural-language questions into SQL that's planned against your semantic layer (MDL) and dry-plan validated. It then goes beyond text-to-SQL to deploy dashboards and manage the context that keeps answers correct.

Is Wren AI a semantic layer?

Yes. Wren is a governed semantic layer expressed in MDL — models, metrics, and relationships — and it pairs that semantic layer with an AI context layer (memory, examples, unstructured knowledge) so agents inherit your business definitions.

What is an AI context layer?

An AI context layer is the reviewable, version-controlled knowledge that agents need but schemas don't provide: business semantics, approved definitions, examples, memory, and governance. It's what makes generative BI trustworthy. Read the vision: The missing context layer for AI agents over business data.

What's in OSS vs. Wren AI Cloud / self-hosted?

The open-source engine in this repo — MDL semantic layer, governed text-to-SQL, MCP server, CLI, and 22+ connectors — is free forever and self-hostable under Apache-2.0. Row- and column-level security, access control with users and groups, the GenBI UI and dashboards, GenBI Apps, agentic mode, context preparation, and support/SLAs are commercial, delivered as Wren AI Cloud or self-hosted Enterprise Plus. The boundary is published: Open core — what's OSS vs. commercial.

Which

Issues· 291 open

View all issuesOpen on GitHub
  • #2782

    ClickHouse: seven SQL shapes planned that ClickHouse rejects or answers differently (lag/lead, CUME_DIST, EXTRACT(DOW), correlated EXISTS, CAST(NULL), date_trunc type, alias in HAVING)

    Updated Oct 1, 2026
  • #1888

    请问您的项目的开发工具和部署环境有哪些硬性要求?

    feature-requeststaleUpdated Oct 1, 2026
  • #1894

    本地模式提问报错

    bugstaleUpdated Oct 1, 2026
  • #1896

    Can't see api page in dockerized local wrenai

    bugstaleUpdated Sep 30, 2026
  • #1897

    The custom instructions are not used if compose stack is restarted.

    bugstaleUpdated Sep 30, 2026
  • #1898

    Wrenai doesn't know Todays date!

    feature-requeststaleUpdated Sep 30, 2026
  • #2772

    ModelAnalyzeRule strips the MDL catalog/schema prefix from column names, breaking derived literal columns

    bugUpdated Sep 29, 2026
  • #1901

    wren-ai-service crashes with Bus error (core dumped) when using custom LLM provider (Groq / OpenAI-compatible API)

    bugstaleUpdated Sep 29, 2026
  • #2190

    feat: Add SAP HANA data source connector

    staleUpdated Sep 27, 2026
  • #2417

    wren memory erro

    bugstaleUpdated Sep 26, 2026

> Tags

Pythonagentanthropicbigquerycharts

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库