WrenAI README

The project's README from github.com/Canner/WrenAI. As one markdown file: README.md.

WrenAI

Open-source GenBI: generative BI for AI agents.

Your agents generate, deploy, and govern dashboards from any database, grounded in a context layer they can actually trust.

Wren AI is an open-source generative BI (GenBI) engine — a governed text-to-SQL and semantic-layer platform, powered by an open AI context layer, across 22+ data sources.

Docs · Discord · Vision · Blog

License: Apache 2.0 PyPI GitHub Release Discord Last commit Follow on X Made by Canner Stars

Canner/WrenAI | Trendshift

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

Wren AI generative BI architecture — semantic layer and AI context layer for AI agents

GenBI in three beats: Generate · Deploy · Know

Why agent builders pick WrenAI

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…

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

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.

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:

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

What's 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 data sources does Wren AI support?

22+ sources via an Apache DataFusion engine, including BigQuery, Snowflake, PostgreSQL, ClickHouse, Amazon Redshift, Databricks, and DuckDB. See Connect a database.

Open core: OSS vs. Cloud / self-hosted

Wren AI is open core. The context engine in this repo — MDL semantic layer, governed text-to-SQL, MCP server, CLI, and 22+ connectors — is open source under Apache-2.0, free forever, and self-hostable. It runs without us.

The following are commercial, delivered as Wren AI Cloud or self-hosted Enterprise Plus:

Same engine underneath, and your MDL stays in your git either way. The full boundary is published — see Open core: what's OSS vs. commercial →.

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.

Documentation

Community

Contributing

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

Contributors

WrenAI contributors

License

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

WrenAI (Canner/WrenAI)

Searching Database…

17.9K ·GitHub
Что это такое?Wren AI — это open-source движок генеративной BI (GenBI): AI-агенты превращают вопросы на естественном языке в контролируемый SQL, графики и готовые к развёртыванию дашборды, работая более чем с 22 источниками данных и опираясь на семантический слой, которому можно доверять.
Это BI-веб-приложение, которое я открываю в браузере, или инструмент для моего кодинг-агента?Здесь всё управляется агентом: это Python-CLI плюс discovery-заглушка примерно на 50 строк для вашего AI-клиента, а агент сам занимается настройкой, запросами и дашбордами. Прежнее чат-приложение BI на базе Docker живёт отдельно как Wren GenBI Classic в ветке legacy/v1.
Как его запустить?Установите CLI через pip, добавьте discovery-заглушку из одного файла в свой AI-клиент, а затем скажите агенту: «Use Wren to set up my Postgres database» — он создаст профиль подключения и выполнит первый запрос. Нет под рукой базы данных? Используйте встроенный демо-датасет jaffleshop.
С какими AI-агентами он работает?С любым агентом, который умеет читать заглушку — в README упомянуты Claude Code, Cursor и MCP-клиенты. Для других стеков есть официальные SDK: wren-langchain (LangChain/LangGraph) и wren-pydantic.
В каких случаях Wren — плохой выбор?По словам самого README: пропустите Wren, если вам нужен лишь разовый график из одного CSV-файла, или если вас устраивает, что агент «угадывает» SQL без какого-либо контроля. Он рассчитан на контролируемую BI с множеством источников, а не на быстрые одноразовые графики.
Мой агент и так пишет SQL — что Wren даёт сверх этого?То, чего не дают схемы: бизнес-семантику, согласованные определения, примеры и память в контролируемом семантическом слое (MDL), чтобы ответы следовали вашей бизнес-логике, а не правдоподобным догадкам. Плюс он разворачивает дашборды, а не только SQL.
Это полностью open source или open core?Open core под лицензией Apache-2.0: движок, семантический слой MDL, контролируемый text-to-SQL, MCP-сервер, CLI и более 22 коннекторов бесплатны и всегда доступны для self-hosting. Безопасность на уровне строк и столбцов, управление доступом, GenBI-интерфейс с дашбордами и агентный режим — платные (Cloud или Enterprise Plus).
К каким базам данных он подключается?Более чем к 22 источникам через движок на Apache DataFusion — BigQuery, Snowflake, PostgreSQL, ClickHouse, Amazon Redshift, Databricks, DuckDB и другие.
Что такое MDL?Modeling Definition Language — семантический слой Wren, дружелюбный к Git: модели, колонки, связи, представления, кубы и метрики, плюс бизнес-контекст вроде перечислений, единиц измерения и согласованных джойнов — всё это в файлы instructions.md и queries.yml под контролем версий. Каждый ответ строится на его основе.
Как он не даёт агенту написать неправильный SQL?Ответы строятся на основе MDL и проверяются через dry-plan до выполнения, а на защиту корректности работают поиск с учётом схемы, структурированные ошибки с подсказками, лимиты строк, профилирование значений и golden eval runner.
Могу ли я поделиться результатами с нетехническими коллегами?Да — любой ответ можно превратить в дашборд-приложение, работающее прямо в браузере на базе wren-core-wasm; агент собирает его, показывает локальный предпросмотр и разворачивает в ваш собственный аккаунт на Vercel или Cloudflare Pages, возвращая живую ссылку, которой можно поделиться.
What are similar projects?cube, redash, airbyte, mcp-toolbox, apowerb, dbx, perspective, tusk
Creator
Canner
Size
53.3 MB
Stars
17.9K
Age
2y
Commits · 90 Days