WrenAI

⚡️ GenBI (Generative BI) queries any database in natural language, generates accurate SQL (Text-to-SQL), charts (Text-to-Chart), and AI-powered business intelligence in seconds.

17.8k
Stars
+491
Stars/month
191
Commits (90d)
10
Releases (6m)

Star Growth

+3.1k (20.9%)
14.4k16.3k18.1kMar 27Oct 1

Overview

WrenAI是一个开源的生成式商业智能(GenBI)代理,允许用户使用自然语言查询任何数据库,自动生成准确的SQL语句、图表和AI驱动的商业洞察。该工具的核心价值在于消除了SQL学习曲线,使业务用户能够直接与数据对话。WrenAI采用语义层架构,通过MDL(Modeling Definition Language)模型对数据库模式、指标和关联关系进行编码,确保LLM输出的准确性和治理性。系统不仅能生成SQL查询,还能创建可视化图表、AI编写的摘要报告,为决策提供即时可用的上下文信息。作为开源项目,WrenAI在GitHub上获得了14,717星标,由Canner公司开发维护。该工具还提供API接口,允许开发者将查询生成和图表功能嵌入到自己的应用程序中,支持构建自助式分析平台。

Deep Analysis

Key Differentiator

Semantic layer ensures LLM-generated SQL reflects actual business definitions — vs text-to-SQL tools that guess schema meaning from raw DDL

⚡ Capabilities

  • • Natural language to SQL generation with semantic layer grounding
  • • GenBI insights: AI-written summaries, charts, and reports
  • • Semantic layer (MDL) encoding business definitions, metrics, and joins
  • • Embeddable API for building custom analytics agents
  • • Support for 15+ data sources (BigQuery, Snowflake, PostgreSQL, etc.)
  • • Multi-LLM provider support (OpenAI, Anthropic, Google, Ollama)

🔗 Integrations

BigQuerySnowflakeRedshiftDatabricksPostgreSQLMySQLSQL ServerClickHouseOracleTrinoDuckDBOpenAIAnthropicGoogle GeminiOllama

✓ Best For

  • ✓ Business teams needing natural language data querying
  • ✓ Building embedded analytics with accurate SQL generation

✗ Not Ideal For

  • ✗ Ad-hoc data exploration without a defined data model
  • ✗ Teams unwilling to invest in semantic layer setup

Languages

PythonTypeScript

Deployment

Docker (self-hosted)Wren AI Cloud

Pricing Detail

Free: Open source self-hosted (AGPL v3)
Paid: Cloud plans available

⚠ Known Limitations

  • ⚠ SQL generation accuracy depends on model capability
  • ⚠ Semantic layer (MDL) requires upfront modeling effort
  • ⚠ AGPL license may be restrictive for some commercial uses

Pros

  • + 自然语言到SQL转换能力强大,显著降低数据查询门槛,让非技术用户也能直接查询数据库
  • + 集成语义层架构确保查询结果的准确性和一致性,通过MDL模型维护数据治理标准
  • + 提供完整的GenBI功能链路,从查询生成到图表可视化再到AI洞察报告,形成闭环分析体验

Cons

  • - 需要前期投入时间构建和维护语义模型,对复杂业务场景的建模要求较高
  • - 作为开源项目,可能在企业级支持、性能优化和高级功能方面存在限制
  • - 依赖LLM的查询理解能力,在处理模糊或复杂业务逻辑时可能产生不准确的结果

Use Cases

  • • 业务分析师无需SQL技能即可进行自助式数据分析,快速获取业务指标和趋势洞察
  • • 构建面向业务用户的内部分析平台,通过API集成实现自然语言查询功能
  • • 创建自动化报告和仪表板系统,定期生成AI驱动的业务摘要和可视化图表

Getting Started

1. 安装部署:使用Docker或源码方式部署WrenAI服务并连接目标数据库;2. 配置语义模型:根据业务需求创建MDL模型文件,定义数据表关系、指标计算和业务规则;3. 开始查询:通过Web界面或API接口使用自然语言提问,系统将自动生成SQL并返回结果和可视化

Alternatives

See all 8 WrenAI alternatives →

Works with WrenAI

Tools that integrate with WrenAI, often used together in the same stack.

Compare WrenAI

Maintain WrenAI?

Show your live rank in your README, or put WrenAI in front of every visitor to AgentoolRank.