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.
Top Related Projects
Robust Speech Recognition via Large-Scale Weak Supervision
Port of OpenAI's Whisper model in C/C++
WhisperX: Automatic Speech Recognition with Word-level Timestamps (& Diarization)
Faster Whisper transcription with CTranslate2
High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model
Quick Overview
WrenAI is an open-source AI assistant framework designed to help developers create custom AI assistants. It provides a flexible and extensible platform for building conversational AI applications, leveraging large language models and other AI technologies.
Pros
- Highly customizable and extensible architecture
- Supports multiple AI models and integrations
- Easy to deploy and scale
- Active community and ongoing development
Cons
- Limited documentation for advanced features
- Steeper learning curve compared to some simpler chatbot frameworks
- Requires knowledge of AI concepts and language models
- May have higher computational requirements for complex assistants
Code Examples
Here are a few code examples demonstrating basic usage of WrenAI:
- Creating a simple assistant:
from wrenai import Assistant
assistant = Assistant("My Assistant")
assistant.add_skill("greeting", "Say hello to the user")
assistant.add_skill("weather", "Provide weather information")
response = assistant.process("Hello, what's the weather like today?")
print(response)
- Adding a custom skill:
from wrenai import Skill
class WeatherSkill(Skill):
def execute(self, input_text):
# Implement weather fetching logic here
return "It's sunny and 25°C today."
assistant.add_skill(WeatherSkill())
- Using a specific AI model:
from wrenai import Assistant, GPT3Model
model = GPT3Model(api_key="your-api-key")
assistant = Assistant("GPT-3 Assistant", model=model)
response = assistant.process("Explain quantum computing")
print(response)
Getting Started
To get started with WrenAI, follow these steps:
- Install WrenAI:
pip install wrenai
- Create a basic assistant:
from wrenai import Assistant
assistant = Assistant("My First Assistant")
assistant.add_skill("greeting", "Greet the user")
assistant.add_skill("farewell", "Say goodbye to the user")
while True:
user_input = input("You: ")
if user_input.lower() == "exit":
break
response = assistant.process(user_input)
print(f"Assistant: {response}")
- Run your assistant and start interacting with it!
For more advanced usage and customization options, refer to the WrenAI documentation.
Competitor Comparisons
Robust Speech Recognition via Large-Scale Weak Supervision
Pros of Whisper
- Highly accurate speech recognition across multiple languages
- Open-source with extensive documentation and community support
- Robust performance on diverse audio inputs, including noisy environments
Cons of Whisper
- Requires significant computational resources for real-time transcription
- Large model size may be challenging for deployment on resource-constrained devices
- Limited customization options for specific domain adaptations
Code Comparison
WrenAI:
from wren import Wren
wren = Wren()
result = wren.transcribe("audio.wav")
print(result.text)
Whisper:
import whisper
model = whisper.load_model("base")
result = model.transcribe("audio.wav")
print(result["text"])
Key Differences
- WrenAI focuses on lightweight, efficient speech recognition, while Whisper prioritizes accuracy and multilingual support
- WrenAI is designed for edge devices and real-time applications, whereas Whisper is better suited for server-side processing
- Whisper offers more comprehensive language support and advanced features, while WrenAI emphasizes simplicity and ease of integration
Use Cases
- Choose WrenAI for mobile apps, IoT devices, or scenarios requiring low-latency transcription
- Opt for Whisper when accuracy is paramount, dealing with multiple languages, or processing large volumes of audio data
Port of OpenAI's Whisper model in C/C++
Pros of whisper.cpp
- Highly optimized C++ implementation for efficient speech recognition
- Supports various quantization levels for reduced memory usage
- Provides both command-line and library interfaces for flexibility
Cons of whisper.cpp
- Limited to Whisper model, while WrenAI supports multiple models
- Requires more technical expertise to set up and use effectively
- Less focus on user-friendly interfaces compared to WrenAI
Code Comparison
whisper.cpp:
#include "whisper.h"
int main(int argc, char ** argv) {
struct whisper_context * ctx = whisper_init_from_file("ggml-base.en.bin");
whisper_full_default(ctx, wparams, pcmf32.data(), pcmf32.size());
whisper_print_timings(ctx);
whisper_free(ctx);
}
WrenAI:
from wren import Wren
wren = Wren()
result = wren.transcribe("audio.mp3")
print(result.text)
The code comparison showcases the difference in complexity and ease of use between the two libraries. whisper.cpp requires more setup and C++ knowledge, while WrenAI offers a simpler Python interface for quick transcription tasks.
WhisperX: Automatic Speech Recognition with Word-level Timestamps (& Diarization)
Pros of WhisperX
- Offers advanced features like word-level timestamps and speaker diarization
- Supports multiple languages and provides language detection
- Actively maintained with frequent updates and improvements
Cons of WhisperX
- Requires more computational resources due to its advanced features
- May have a steeper learning curve for beginners
- Limited to audio transcription and diarization tasks
Code Comparison
WhisperX:
import whisperx
model = whisperx.load_model("large-v2")
result = model.transcribe("audio.mp3")
print(result["segments"])
WrenAI:
from wren import Wren
wren = Wren()
response = wren.generate("Summarize this text: ...")
print(response)
Key Differences
WhisperX focuses on audio transcription and diarization, while WrenAI is a more general-purpose AI assistant. WhisperX provides detailed audio analysis, including word-level timestamps and speaker identification. WrenAI, on the other hand, offers a broader range of capabilities, including text generation, summarization, and potentially other AI-powered tasks.
The choice between these repositories depends on the specific use case. For audio-related tasks, WhisperX would be more suitable, while WrenAI might be preferable for general AI assistance and text-based tasks.
Faster Whisper transcription with CTranslate2
Pros of faster-whisper
- Optimized for speed, offering faster transcription than standard Whisper models
- Supports multiple languages and can perform translation
- Provides streaming capabilities for real-time transcription
Cons of faster-whisper
- Focused solely on speech-to-text, lacking additional AI capabilities
- May require more computational resources due to its optimization for speed
- Limited customization options compared to more general-purpose AI frameworks
Code Comparison
faster-whisper:
from faster_whisper import WhisperModel
model = WhisperModel("large-v2", device="cuda", compute_type="float16")
segments, info = model.transcribe("audio.mp3", beam_size=5)
for segment in segments:
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
WrenAI:
from wren import Wren
wren = Wren()
response = wren.chat("Transcribe the following audio file: audio.mp3")
print(response)
Summary
faster-whisper excels in speech-to-text tasks with its speed-optimized approach and multi-language support. However, it's limited to transcription tasks. WrenAI, while not specifically optimized for transcription, offers a more versatile AI platform that can handle various tasks through natural language interactions. The choice between the two depends on whether you need specialized transcription capabilities or a more general-purpose AI assistant.
High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model
Pros of Whisper
- Optimized for performance with GPU acceleration
- Supports multiple languages for transcription
- Provides a C++ implementation for better integration with native applications
Cons of Whisper
- Limited to speech recognition and transcription tasks
- Requires more setup and configuration compared to WrenAI
- May have a steeper learning curve for non-technical users
Code Comparison
WrenAI:
from wren import Wren
wren = Wren()
result = wren.transcribe("audio.mp3")
print(result.text)
Whisper:
#include "whisper.h"
whisper_context * ctx = whisper_init_from_file("model.bin");
whisper_full_params params = whisper_full_default_params(WHISPER_SAMPLING_GREEDY);
whisper_full(ctx, params, audio_data, audio_len, "en");
Summary
Whisper offers high-performance speech recognition with multi-language support and GPU acceleration, making it suitable for more advanced applications. However, it may require more technical expertise to implement and use effectively. WrenAI, on the other hand, provides a simpler interface for transcription tasks, making it more accessible for quick integration into projects, but may lack some of the advanced features and optimizations found in Whisper.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Open-source GenBI for AI agents
Your agents generate governed SQL, deploy dashboards, and keep business definitions in Git, across 22+ data sources.
Get started in 3 commands â · Read the docs â · Join Discord â
What WrenAI is
WrenAI is the open-source generative BI (GenBI) engine. It gives the AI agents you already use (Claude Code, Cursor, MCP clients, LangChain) a governed semantic layer and an AI context layer, so they turn business questions into correct SQL, ship the answer as a shareable dashboard, and stay inside your guardrails.
Schemas tell an agent where data lives. Wren tells it what the data means: approved metric definitions, enums, units, joins, worked examples, and the tribal knowledge buried in docs and chat threads. All of it lives as reviewable YAML and Markdown in a repo you own.
Quickstart
Three commands, then your agent does the rest. Works with Claude Code, Cursor, Cline, Codex, and 50+ other agents.
1. Install the CLI
pip install wrenai
Add connector extras as you need them, for example pip install "wrenai[postgres,memory]".
2. Teach your agent about Wren
npx skills add Canner/WrenAI
This installs a ~50-line discovery stub. Your agent fetches full workflow guides from the CLI on demand, so instructions always match the installed version.
3. Open your agent in a project folder and ask
"Use Wren to set up my Postgres database."
The agent checks your environment, creates a connection profile, scaffolds the project, and runs a first query.
No database handy? Say "Use Wren with the bundled jaffle_shop sample" and run the same flow against a real sample warehouse.
Slow pip install from mainland China?
pip install wrenai -i https://pypi.tuna.tsinghua.edu.cn/simple
If HuggingFace model downloads time out, run export HF_ENDPOINT=https://hf-mirror.com before using the CLI.
Then keep going
Once you're connected, these three prompts cover the whole GenBI loop:
| Beat | Ask your agent | What happens |
|---|---|---|
| Know | "Enrich my Wren project with the business context in raw/." | Runs wren skills get enrich-context. Writes definitions, examples, and memory as reviewable files. |
| Generate | "Who are our top 10 customers by sales this quarter?" | Recalls MDL context and past queries, writes governed SQL, executes via wren query. |
| Deploy | "Turn that into a dashboard I can filter and share, deployed to Vercel." | Runs wren skills get genbi. Builds a browser-side app and returns a live URL on your Vercel or Cloudflare Pages account. |
Why agent builders pick WrenAI
- Answers and dashboards, not just SQL. Generate a governed answer, deploy it as a dashboard, share the URL. One agent-driven loop, end to end.
- Correct instead of confidently wrong. Schema-aware retrieval, MDL planning, dry-plan validation, row limits, value profiling, and structured errors with hints keep agent SQL inside guardrails.
- Business meaning lives in Git. Metric definitions, enums, approved joins, and proven examples are versioned files. Review them in a pull request. Diff them. Take them with you.
- Works through the agents you already run. Claude Code, Cursor, Cline, Codex, MCP clients, LangChain. Wren is a layer, not another chat UI to adopt.
- Sits on your existing stack. Warehouse, transformation pipelines, existing semantic models. 22+ sources on one Apache DataFusion engine.
- Open by default. Core engine, SDK, and skills under Apache-2.0. It runs without us.
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 a context layer that is open, reviewable, and version-controlled, usable by every agent and every 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.
Take it to your team with git push
Everything Wren writes on your laptop is plain YAML and Markdown in a repo you own. Git Sync turns that same repo into a governed, team-wide GenBI deployment in Wren Cloud or a self-hosted installation, including air-gapped. Nothing to export, nothing to re-model.
- No new CLI to learn. Bind a directory once with
wren cloud createorwren cloud link. After that,git pushandgit pullare the entire interface. - Metrics reviewed like code. A change to
net_revenueshows up as a readable diff in a pull request on GitHub, GitLab, Bitbucket, or your own remote. Run CI on it. Promote staging to production like application code. - You keep the repo, always. Clone it, back it up, feed it to another tool, or leave with it, any time.
- No reusable credential on disk. Every push authenticates with a fresh token that expires in 600 seconds. The durable key stays in
~/.wren/cloud.yml(mode0600) and is never handed to git.
$ git push
To cloud.getwren.ai/acme/wren-analytics.git
9f2c1a4..b71e0d3 main -> main
â deploy queued · model queryable in Wren Cloud
Open core: what's OSS, what's commercial
The engine in this repo (MDL semantic layer, governed text-to-SQL, MCP server, CLI, 22+ connectors) is Apache-2.0, free forever, and self-hostable. The following are commercial, delivered as Wren AI Cloud or self-hosted Enterprise Plus:
- Row- and column-level security and access control with users and groups
- GenBI UI, dashboards, embedded and APIs
- Scenario AI harnesses: GenBI Apps, Agentic Mode, AI-assisted context preparation
- Advanced security and audit, support and SLAs, plus cloud, VPC, and air-gapped deployment
Same engine underneath. Your MDL stays in your Git either way. Read the published boundary â
Under the hood
Semantic layer (MDL)
Wren is a governed semantic layer, expressed in the Modeling Definition Language (MDL): a Git-friendly definition of what your data means, not just where it lives. Every answer and dashboard is planned against it.
- Models, columns, relationships, views: the shape of your data, decoupled from any one warehouse.
- Cubes and metrics: approved, reusable definitions so "revenue" means the same thing everywhere.
- Context beyond the schema: enums, units, approved joins, and definitions in
instructions.mdandqueries.yml.
What's included
- Engine: Apache DataFusion based. BigQuery, Snowflake, PostgreSQL, ClickHouse, Amazon Redshift, Databricks, DuckDB, and more. Connect a database â
- GenBI dashboards: agent-built, browser-side apps powered by
wren-core-wasm, deployable to Vercel or Cloudflare Pages - Knowledge and memory: version-controlled
instructions.mdandqueries.yml, plus a local LanceDB memory index with hybrid retrieval - Agent SDKs:
wren-langchain(LangChain / LangGraph),wren-pydantic, and a reference Python integration for other stacks. SDK overview â - Governed execution primitives: functions, dry-plan validation, row limits, structured errors
Day-to-day commands
wren skills get onboarding # workflow guide: set up project + first query
wren skills get enrich-context # workflow guide: add business context
wren skills get genbi # workflow guide: build & deploy a dashboard
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
Full reference: CLI · MDL · Architecture
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
Vote on what ships next in GitHub Discussions â
FAQ
What is generative BI (GenBI)?
Business intelligence produced by AI agents. Instead of a person building charts by hand, an agent generates governed SQL, deploys a dashboard, and shares it, grounded in an AI context layer so the output is trustworthy rather than merely plausible. Wren AI is the open-source GenBI engine.
Does Wren AI do text-to-SQL?
Yes, and governed: questions become SQL planned against your semantic layer (MDL) and dry-plan validated before execution. Wren then goes further, deploying dashboards and managing the context that keeps answers correct.
Is Wren AI a semantic layer?
Yes. Wren is a governed semantic layer expressed in MDL (models, metrics, relationships), paired with an AI context layer (memory, examples, unstructured knowledge) and a governed execution engine that runs those definitions across 22+ sources.
What is an AI context layer?
The reviewable, version-controlled knowledge agents need but schemas don't provide: business semantics, approved definitions, examples, memory, and governance. Read the vision: The missing context layer for AI agents over business data.
What happened to the Docker-based Wren AI GenBI app?
On 2026-05-07 Wren Engine merged into this repo under core/, and the previous Canner/wren-engine repo was archived. The earlier chat-first BI product is now Wren GenBI Classic, preserved on the legacy/v1 branch (tag v1-final) with no new features or security fixes. For a maintained, hosted version of that experience, see Wren AI Commercial. Read the announcement â
Documentation
- Quickstart: from skill install to first answer
- Build & deploy a GenBI app: generate a dashboard and ship it
- Concepts: what context is, what MDL is, how memory works
- Connect a database: Postgres, BigQuery, Snowflake, DuckDB, and more
- Agent SDKs: what's shipping today, what's next
- Git Sync:
git pushyour open-source project to governed, team-wide GenBI
Community
- ð¬ Discord: get unstuck fast, chat with the team and other builders
- ð GitHub Discussions: design conversations, RFCs, roadmap votes
- ð¦ Twitter / X: release notes and short updates
- ð Blog: vision, post-mortems, deep dives
Contributing
We build in the open. Issues, PRs, connectors, SDK integrations, and docs fixes are all welcome.
- New here? Pick up a
good first issue. - Contributor guide: setup, conventions, and the contribution bar
- Architecture map: find the right place to land your change
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/ LangChain / LangGraph integration
wren-pydantic/ Pydantic AI integration
skills/ Agent skills for context authoring
docs/ Module documentation
examples/ Example projects
Contributors
License
Apache 2.0. See LICENSE.
If WrenAI saved you time, star the repo â. It's the fastest way to help more agent builders find it.
Top Related Projects
Robust Speech Recognition via Large-Scale Weak Supervision
Port of OpenAI's Whisper model in C/C++
WhisperX: Automatic Speech Recognition with Word-level Timestamps (& Diarization)
Faster Whisper transcription with CTranslate2
High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot