Back to Wrenai

README

README.md

1-final9.2 KB
Original Source
<p align="center" id="top"> <a href="https://getwren.ai/?utm_source=github&utm_medium=title&utm_campaign=readme"> <picture> <source media="(prefers-color-scheme: light)" srcset="./misc/wrenai_logo.png">
</picture>
<h1 align="center">Wren AI - Open-Source GenBI Agent</h1>
</a> </p> <p align="center"> <a aria-label="Follow us on X" href="https://x.com/getwrenai"> </a> <a aria-label="Releases" href="https://github.com/canner/WrenAI/releases"> </a> <a aria-label="License" href="https://github.com/Canner/WrenAI/blob/main/LICENSE"> </a> <a aria-label="GitHub Stars" href="https://github.com/Canner/WrenAI/stargazers"> </a> <a href="https://docs.getwren.ai"> </a> <a aria-label="Join the community on GitHub" href="https://discord.gg/5DvshJqG8Z"> </a> <a aria-label="Canner" href="https://cannerdata.com/?utm_source=github&utm_medium=badge&utm_campaign=readme"> </a> </p> <p align="center"> <a href="https://trendshift.io/repositories/9263" target="_blank"></a> </p>

Ask your database anything in plain English. Wren AI generates accurate SQL, charts, and BI insights β€” backed by a semantic layer that keeps LLM outputs grounded and trustworthy.

<p align="center"> </p>

😍 Demos

https://github.com/user-attachments/assets/f9c1cb34-5a95-4580-8890-ec9644da4160

▢️ Watch the full GenBI walkthrough β€” end-to-end from question to chart

πŸ’‘ Why a Semantic Layer?

Feeding raw DDL to an LLM gets you SQL that looks right but means the wrong thing β€” "revenue" joins the wrong tables, "active user" uses the wrong filter. Wren AI's semantic layer (MDL) encodes your business definitions once, then every generated query is grounded in that shared understanding. The LLM doesn't guess what your metrics mean; the semantic layer tells it.

πŸ€– Features

What you getWhy it matters
Talk to Your DataAsk in any language β†’ precise SQL & answersSlash the SQL learning curveο»Ώ
GenBI InsightsAI-written summaries, charts & reportsDecision-ready context in one clickο»Ώ
Semantic LayerMDL models encode schema, metrics, joinsKeeps LLM outputs accurate & governedο»Ώ
Embed via APIGenerate queries & charts inside your apps (API Docs)Build custom agents, SaaS features, chatbotsο»Ώ (Streamlit Live Demo)

🀩 Learn more about GenBI

πŸ”Œ Data Sources

Cloud WarehousesDatabasesQuery Engines
BigQueryPostgreSQLTrino
SnowflakeMySQLAthena (Trino)
RedshiftMicrosoft SQL ServerDuckDB
DatabricksClickHouse
Oracle

Don't see yours? Vote for it β€” community votes drive our connector roadmap.

🧠 LLM Models

Wren AI works with any LLM provider you're already using:

Cloud APIsPlatform ServicesSelf-hosted
OpenAIAzure OpenAIOllama
AnthropicGoogle AI Studio (Gemini)
DeepSeekVertex AI (Gemini + Anthropic)
GroqAWS Bedrock
Databricks

[!TIP] For best results, use a frontier model (GPT-4o, Claude Sonnet, Gemini Pro). Wren AI works with smaller and local models too β€” accuracy scales with model capability. See configuration examples for setup guides.

πŸš€ Getting Started

Three ways to get started β€” pick what fits:

OptionBest forLink
Self-hosted (Docker)Full control, local dataInstallation guide
Wren AI CloudTry it without setupgetwren.ai

Compare OSS vs. Cloud plans. Full documentation at docs.getwren.ai.

<p align="center"> </p>

πŸ—οΈ Architecture

<p align="center"> </p>

User questions flow from the Next.js UI β†’ Apollo GraphQL β†’ AI Service (RAG + LLM) β†’ Wren Engine (semantic query execution) β†’ your database. The semantic layer (MDL) sits at the center, making sure the LLM's SQL reflects your actual business definitions.

πŸ‘‰ Deep dive into the design

πŸ§‘β€πŸ’» For Developers

WrenAI is a full-stack AI system with interesting problems at every layer β€” semantic modeling, RAG retrieval, LLM-driven SQL generation, and query execution across heterogeneous data sources. Here's what the stack actually looks like under the hood:

LayerWhat it does
wren-uiNext.js + Apollo GraphQL β€” semantic modeling UI and the BFF that wires everything together
wren-ai-servicePython/FastAPI pipeline β€” intent classification, vector retrieval from Qdrant, LLM prompting, and SQL correction loops
wren-engineRust + Apache DataFusion β€” the query execution core that resolves MDL semantics (metrics, joins, access controls) before SQL reaches the database

wren-engine is a separate open-source project and the part of the stack closest to the metal. It's where MDL definitions get translated into actual query plans across 15+ data sources. If you work with Rust, DataFusion, or database connectors, it's worth a look β€” the codebase is approachable and there are real unsolved problems around query planning, semantic resolution, and MCP (Model Context Protocol) agent integration.

Some areas where contributions tend to have the most impact across both repos:

  • Data source connectors β€” wren-engine supports 15+ sources; new connectors are always useful
  • MCP integration β€” wren-engine exposes an MCP server; agent-native workflows are still early and evolving
  • SQL generation quality β€” prompt engineering, correction loop heuristics, and eval harnesses in wren-ai-service
  • Semantic layer tooling β€” MDL schema inference, validation, and developer ergonomics in wren-ui

πŸ› οΈ Contribution

  1. Read Contribution Guidelines for setup & PR guidelines.
  2. Open an issue for bugs, feature requests, or discussion.
  3. If Wren AI is useful to you, a ⭐ goes a long way β€” it helps more people find the project.

⭐️ Community

We follow a Code of Conduct to keep the community welcoming for everyone.

πŸŽ‰ Our Contributors

<a href="https://github.com/canner/wrenAI/graphs/contributors"> </a> <p align="right"> <a href="#top">⬆️ Back to Top</a> </p>