# Repository Briefing: Canner/WrenAI
> Source: https://repoforai.com/repo/Canner/WrenAI (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/Canner/WrenAI
- **Official Docs / Website**: https://www.getwren.ai/en/open-core
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: See repository
- **Engineering Health**: A (83/100 · Maintenance 35/35 · Adoption 22/25 · Releases 20/20 · License 6/20)
- **Latest Release**: wren-core-py-v0.8.3 (2026-11-30) — https://github.com/Canner/WrenAI/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: Self-Hosted, MCP, CLI, API
- **Momentum**: 18,476 ★ total (+6 24h / +66 7d) · 2,135 forks
- **Topics**: `ai-agents`, `bigquery`, `business-intelligence`, `charts`, `clickhouse`, `context-engineering`, `dashboard`, `databricks`, `duckdb`, `genbi`, `generative-ai`, `llm`
- **When to Use**: Best for: Data platform teams that want Claude Code or other MCP-capable agents to reuse Git-reviewed metrics and approved joins across warehouses, with an optional path from query to dashboard. Skip if: You only need a one-off CSV chart, lack an owner for semantic definitions, or require a turnkey BI portal with built-in access controls but cannot adopt the commercial edition.

## Overview
```text
### Architecture & Core Mechanics
WrenAI separates agent orchestration from semantic planning and execution. An existing agent uses project context to formulate SQL; Wren evaluates the query against the Modeling Definition Language (MDL), dry-plans it, and runs it against the configured source. The engine in `core/` is based on Apache DataFusion. MDL represents models, columns, relationships, views, cubes, and metrics, so a reusable business definition can be maintained separately from the physical schema.

Agent-facing knowledge complements MDL rather than replacing it. Definitions, units, enums, and query examples live in reviewable YAML and Markdown, notably `instructions.md` and `queries.yml`; a local LanceDB memory index supports hybrid retrieval. MCP is the protocol-level integration surface, while the Python-distributed CLI and the LangChain/LangGraph and Pydantic SDKs offer workflow and application integration paths. Use MDL for semantics the planner must apply and context files for knowledge the agent needs when deciding what to query.

### Key Capabilities & Differentiators
WrenAI supports 22+ data sources, including BigQuery, Snowflake, PostgreSQL, ClickHouse, Amazon Redshift, Databricks, and DuckDB. Schema-aware retrieval and worked examples help ground query generation; dry-plan validation, row limits, and structured errors with hints give the agent checks and feedback around execution. `wren query --sql` runs SQL through the semantic layer, while `wren ask --guided` and `wren ask --direct` offer different ways to frame a question for an agent.

The workflow extends beyond returning SQL. The `genbi` skill guides agents in building browser-side dashboard apps powered by `wren-core-wasm`, which can be deployed to Vercel or Cloudflare Pages. That app-building path is distinct from the commercial GenBI UI and managed dashboard offering. Connector breadth is useful for teams with multiple platforms, but it does not by itself establish cross-source joins or equivalent support for all dialect features; test representative workloads on each intended connector.

### Trade-offs & Limitations
Compared with giving an LLM direct warehouse access, WrenAI adds a versioned definition of business terms and a planning step before execution. Compared with a standalone semantic layer, it also supplies agent context retrieval and a dashboard-building workflow. The cost is upkeep: someone must own the MDL, keep examples current, and review generated answers against reference results. A successful dry plan does not prove that an agent chose the intended reporting period or understood the question correctly.

The open-core split matters if you expect a replacement for a managed BI platform. The engine, MCP server, CLI, connectors, SDKs, and skills are Apache-2.0; built-in user and group controls, row- and column-level security, managed GenBI UI and API features, and advanced audit sit in the commercial editions. For OSS deployments, prefer least-privilege source credentials and enforce access at the source. A row limit constrains results, not necessarily warehouse scan cost or who can see the data, so test source-side budgets and permissions independently.

### Hardware & Deployment Guide
Start with `pip install wrenai`; `pip install "wrenai[postgres,memory]"` is an example with PostgreSQL and memory extras. The `npx skills add Canner/WrenAI` step installs an agent discovery stub, and the agent retrieves workflow guides from the installed CLI as needed. Set up a connection profile for a real source, or run the bundled `jaffle_shop` sample before granting the agent access to company data. The engine can be self-hosted independently of Wren Cloud; agent inference, dependency downloads, and dashboard hosting can still introduce external services. A fully disconnected deployment is a separate validation exercise.

Size the pilot around representative query concurrency and source costs, then measure the local retrieval footprint and agent inference separately. The former Docker-based GenBI Classic is frozen on `legacy/v1` (`v1-final`) without new features or security fixes; it is not the default deployment path for the current core. Recent `wren-core-py` v0.8.3 and `wren-semantic-core` v0.5.2 releases fix model-qualified identity across relationship projections. If your MDL relies on those projections, include them in upgrade regression tests.
```

## Key Capabilities
```text
- Semantic planning: MDL defines models, columns, relationships, views, cubes, and metrics for an Apache DataFusion-based engine.
- Business context: `instructions.md` and `queries.yml` keep definitions and examples reviewable in Git; a local LanceDB index supports hybrid retrieval.
- Execution guardrails: Dry-plan validation checks query plans before execution; row limits and structured errors support controlled agent workflows.
- Integration surfaces: MCP and the `wren` CLI support agent workflows; `wren-langchain` and `wren-pydantic` provide SDK integration paths.
- Data connectivity: 22+ sources include BigQuery, Snowflake, PostgreSQL, ClickHouse, Amazon Redshift, Databricks, and DuckDB.
- Dashboard delivery: Agents can build browser-side apps with `wren-core-wasm` and deploy them to Vercel or Cloudflare Pages without adopting the commercial GenBI UI.
```

## Quick Start / Clone
```bash
pip install wrenai
```
