### 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.*
[Docs](https://docs.getwren.ai) ยท [Discord](https://discord.gg/5DvshJqG8Z) ยท [Vision](https://www.getwren.ai/post/the-missing-context-layer-for-ai-agents-over-business-data) ยท [Blog](https://www.getwren.ai/blog)
[](LICENSE)
[](https://pypi.org/project/wrenai/)
[](https://github.com/Canner/WrenAI/releases)
[](https://discord.gg/5DvshJqG8Z)
[](https://github.com/Canner/WrenAI/commits/main)
[](https://x.com/getwrenai)
[](https://cannerdata.com)

> ๐ฃ **2026-05-07**: Wren Engine has merged into this repo under [`core/`](./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`](https://github.com/Canner/WrenAI/tree/legacy/v1) branch (tag `v1-final`) and is now **Wren GenBI Classic**; see [A note on the "GenBI" name](#a-note-on-the-genbi-name) below. [Read the announcement โ](https://github.com/Canner/WrenAI/discussions/2205)
---
## What WrenAI is
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.

## 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`](https://docs.getwren.ai/oss/sdk/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.
## 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 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.
## 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 ` and shaped prompts via
`wren ask "" --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
`/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](https://docs.getwren.ai/oss/guides/genbi).
**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 "" --guided # wrap a question for a weaker agent
wren ask "" --direct # wrap a question for a stronger agent
```
Fast at first. Deep when you need it. Always reviewable and Git-friendly.
## What's Included
- **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`](https://docs.getwren.ai/oss/sdk/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
## 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](https://github.com/Canner/WrenAI/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](https://docs.getwren.ai/oss/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`](https://github.com/Canner/WrenAI/tree/legacy/v1) branch (no new
features or security fixes). For a maintained, hosted version of that classic
experience, see [Wren AI Commercial](https://getwren.ai).
## Documentation
- [Quickstart](https://docs.getwren.ai/oss/get_started/quickstart): from skill install to first answer
- [Build & deploy a GenBI app](https://docs.getwren.ai/oss/guides/genbi): generate a dashboard and ship it
- [Concepts](https://docs.getwren.ai/oss/concepts/what_is_context): what context is, what MDL is, how memory works
- [Connect a database](https://docs.getwren.ai/oss/guides/connect): Postgres, BigQuery, Snowflake, DuckDB, and more
- [Agent SDKs](https://docs.getwren.ai/oss/sdk/overview): what's shipping today, what's next
## Community
- ๐ฌ [Discord](https://discord.gg/5DvshJqG8Z): chat with the team and other builders
- ๐ [GitHub Discussions](https://github.com/Canner/WrenAI/discussions): design conversations, RFCs, longer threads
- ๐ฆ [Twitter / X](https://x.com/getwrenai): release notes and short updates
- ๐ [Blog](https://www.getwren.ai/blog): vision, post-mortems, deep dives
## Contributing
We build in the open. Issues, PRs, connector contributions, SDK integrations, docs fixes are all welcome.
- [Contributor guide](./CONTRIBUTING.md)
- [Connector ecosystem program](./docs/contributing-a-connector.md): three-tier ownership (official, community-blessed, community-owned)
- [Architecture map](./docs/architecture.md): find the right place to land your change
- Looking for somewhere to start? Try the [`good first issue`](https://github.com/Canner/WrenAI/labels/good%20first%20issue) label.
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
## License
Apache 2.0. See [LICENSE](./LICENSE).
---
*Come build open GenBI with us.*
**If WrenAI helps you, drop a โญ, it genuinely helps us grow!**