# WrenAI: Governed Text-to-SQL with an Open Context Layer

> WrenAI is an Apache-2.0 GenBI engine that gives AI agents a version-controlled semantic layer, then turns their SQL into shareable dashboards. It is strongest when business definitions live outside the database and weakest when you just want one chart.

**Canner/WrenAI** — 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 dashboards, charts, and SQL across 20+ data sources, such as BigQuery, Snowflake, PostgreSQL, ClickHouse, Amazon Redshift, Databricks and more.

- Repository: https://github.com/Canner/WrenAI
- Website: https://www.getwren.ai/en/open-core
- Stars: 17,781 · Forks: 2,031
- Language: Python
- License: NOASSERTION
- Published: 2026-09-09 · Updated: 2026-09-09 · Language: en
- Canonical page: https://hysenlabs.com/projects/canner-wrenai

## The problem WrenAI targets: agents that write SQL but do not know your business

A language model can read a schema and produce a query that runs. What it cannot read from the schema is that a cancelled order should not count toward revenue, that one column stores cents while another stores dollars, or that two tables should be joined on a key nobody documented. Those rules live in docs, wikis and chat threads. The README frames this as the gap WrenAI fills: an AI context layer plus a governed semantic layer that gives agents "what schemas don't", meaning business semantics, approved definitions, examples and memory. The audience is agent builders. The README states the project is agent-driven by design, with CLI-installed workflows and a discovery stub for AI clients, and it lists Claude Code, Cursor and MCP as the clients the engine works through. If your only need is a one-off chart from a CSV, the README says to skip Wren. That is an unusually direct piece of positioning, and it is accurate: a governance layer adds work that a single ad hoc query does not repay.

## How the MDL and the context layer turn a question into governed SQL

The mechanism has three named stages in the README: Generate, Deploy, Know. Generate is the text-to-SQL path. A business question goes through schema-aware retrieval, then MDL planning, then dry-plan validation, and errors come back structured rather than as free text. Deploy turns an answer into a browser-side dashboard powered by wren-core-wasm, and the README says it ships to your own Vercel or Cloudflare Pages account with one command. Know is the part that decides whether the first two are trustworthy: semantic models in MDL, company definitions in instructions.md, and a memory of what worked, all stored as versionable files. The design claim is that context is diff-able and reviewable in Git rather than embedded in prompts or locked in a vendor UI. Note what is absent. The README does not document a rollback path for a bad MDL change beyond ordinary Git practice, and it does not describe how conflicting definitions are resolved when two teams author the same metric. The guardrails it does name are dry-plan validation and row limits, with row and column level security deferred to Cloud and self-hosted.

## Installing the WrenAI CLI and getting a first governed answer

WrenAI installs from PyPI. The core package includes DuckDB, so a first run needs no warehouse credentials. The README gives this pair of commands, with extras added per datasource:

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

The README also notes that if pip is slow or fails for users in mainland China, an alternative is documented, but the text is truncated at that point, so check the README for the mirror instructions. After the CLI is present, the documented next step is a discovery stub for your AI client, which is what lets an agent drive the rest. Workflow guides are served on demand from the CLI itself, so the instructions match the installed version rather than a web page. That is a sensible choice for a fast-moving tool, and it means you should read the guides from your own terminal instead of trusting a tutorial written against an older release. The repository also carries an examples directory, including examples/v5-jaffle/, if you want something concrete to point the agent at.

## Where WrenAI stops: licences, open core and the missing security layer

Two constraints matter more than any feature list. First, governance is split. The README states that row and column level security and access control are Cloud and self-hosted, not in the open source build. If your compliance requirement is that a given analyst can only see certain rows, the OSS engine alone does not satisfy it, and you should confirm what the self-hosted path includes before designing around it. Second, licensing is genuinely confusing at the repository level. The GitHub licence field reports NOASSERTION, while the README badge says Apache 2.0. The repository root contains LICENSE plus LICENSE-AGPL-3.0, LICENSE-APACHE-2.0 and LICENSE-CC-BY-4.0, which suggests components are licensed differently. The README states that the core, SDK and skills are open-sourced under Apache-2.0, but that statement does not by itself settle which files fall under the AGPL text. This is not legal advice; read the licence files and get your own answer before shipping WrenAI inside a product. A third, quieter cost sits in the architecture: MDL, instructions.md and memory are files your team now owns, reviews and merges.

## WrenAI compared with Vanna AI and with a traditional BI tool

The obvious open source comparison, and one people search for, is Vanna AI. Both are Python and both attack text-to-SQL. The difference is where the knowledge lives. Vanna's approach, as commonly described, centres on training a model on question and SQL pairs so retrieval improves with examples. WrenAI instead asks you to author and version a semantic layer in MDL, with dry-plan validation before execution and structured errors after it. That is a heavier upfront commitment and a better fit when definitions must be auditable. It is the wrong fit when you have no one to own the semantic model, because an unmaintained MDL is worse than no MDL: it looks authoritative and drifts. Against a traditional BI tool the split is different again. The README's own comparison table gives traditional tools manual, in-tool dashboard building and no SQL generation, while WrenAI generates and deploys dashboards through agents. The trade is control for automation. A BI tool constrains what an analyst can build and therefore what can break; WrenAI lets an agent build and deploy, which is exactly why dry-plan validation and row limits exist.

## Maintenance status and what upgrading actually costs

The repository is not archived, and the last push was on 2026-09-09, eight days before this writing, so the project is being worked on now. Releases are frequent: wren-v0.14.0 on 2026-09-08, wren-v0.13.4 on 2026-09-02, and wren-pydantic v0.3.0 on 2026-09-02. That cadence is the upgrade cost. A tool that ships minor versions weekly will move its CLI-served workflow guides, and any internal documentation you wrote against v0.13 may not match v0.14. The mitigating design choice is that guides are served from the installed CLI, so the correct reference travels with the package. The unmigrated part is your own MDL and instructions.md. The README does not describe a schema migration or compatibility guarantee for MDL files across releases, so treat the semantic layer as code you test: keep it in Git, review changes, and re-run the eval runner the README lists among the correctness primitives after an upgrade. The repository also notes that Wren Engine merged into core/ on 2026-05-07 and that the earlier Docker-based app is preserved on the legacy/v1 branch as Wren GenBI Classic, which means older tutorials and Docker Compose files you find online may describe a product that is no longer the main line.

## Conclusion

Adopt WrenAI if your agents keep writing plausible SQL against definitions that only exist in people's heads, and you want those definitions in Git next to the code. Skip it if you need one chart from a single CSV, or if row and column level security has to be in the open source build, because the README places access control in Cloud and self-hosted. Before committing, verify two things in the repository itself: which extras your warehouse needs, since the DuckDB core is the only connector installed by default, and how the MDL files are meant to be reviewed and merged by your team. Then check the LICENSE and LICENSE-AGPL-3.0 files at the repository root, because the GitHub licence field reports NOASSERTION even though the README badge says Apache 2.0.

## FAQ

### What is WrenAI?

It is an open source generative BI engine that produces governed text-to-SQL and deployable dashboards, built on an AI context layer and a semantic layer in MDL. The README describes it as agent-driven, working through clients such as Claude Code, Cursor and MCP.

### Is WrenAI free?

The README states that the core, SDK and skills are open-sourced under the Apache-2.0 licence, and the CLI installs from PyPI. Row and column level security and access control are listed as Cloud and self-hosted rather than part of the open source build.

### How do I use WrenAI?

Install the CLI with pip, add a discovery stub for your AI client, then let the agent drive. Workflow guides are served on demand from the installed CLI, so they match your version.

### What are the benefits of using WrenAI?

The README points to governed text-to-SQL with dry-plan validation and structured errors, dashboards deployed to your own Vercel or Cloudflare Pages account, and a semantic layer stored as reviewable, Git-friendly files instead of prompts.

### How does WrenAI compare with Vanna AI?

The README does not discuss Vanna AI, so no direct comparison is documented. The architectural difference visible in the repository is that WrenAI asks you to author a semantic layer in MDL and validates queries with a dry plan, rather than relying on example pairs alone.

## Sources

- [Canner/WrenAI on GitHub](https://github.com/Canner/WrenAI)
- [Issues](https://github.com/Canner/WrenAI/issues)
- [Project website](https://www.getwren.ai/en/open-core)
- [README](https://github.com/Canner/WrenAI/blob/main/README.md)
- [Releases](https://github.com/Canner/WrenAI/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/canner-wrenai
