explaingit

canner/wrenai

Analysis updated 2026-06-24

15,194RustAudience · dataComplexity · 4/5LicenseSetup · moderate

TLDR

WrenAI is an open-source context layer that lets AI agents write accurate, governed SQL across 20+ data sources by modeling tables, relationships, and rules once in MDL.

Mindmap

mindmap
  root((WrenAI))
    Inputs
      MDL model
      Natural language
      DB credentials
    Outputs
      SQL queries
      Charts
      Dashboards
    Use Cases
      Text to SQL
      GenBI dashboards
      Agent analytics
      LLM data access
    Tech Stack
      Rust
      DataFusion
      Python
      WASM
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Give an AI agent reliable text-to-SQL access to a production warehouse.

USE CASE 2

Model business metrics once in MDL and reuse them across Claude, Cursor, and ChatGPT.

USE CASE 3

Build a GenBI app that turns natural language into charts and dashboards.

USE CASE 4

Embed the WASM engine in a browser tool that runs governed SQL queries.

What is it built with?

RustPythonDataFusionWebAssemblyLangChain

How does it compare?

canner/wrenaiquickwit-oss/tantivybenfred/py-spy
Stars15,19415,18015,178
LanguageRustRustRust
Setup difficultymoderatemoderateeasy
Complexity4/54/52/5
Audiencedatadeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Needs database credentials, an LLM API key, and time to author an MDL model that matches your schema.

Apache 2.0 for the core: use, modify, and redistribute freely including commercially, keep the notice, with a patent grant from contributors.

In plain English

WrenAI is an open source project that acts as a context layer between AI agents and your business databases. The core problem it solves is that AI models like Claude or ChatGPT struggle to write accurate SQL (the language for querying databases) against real business data because they do not understand what the tables and columns actually mean, overlapping naming, inconsistent definitions, and complex relationships confuse them. WrenAI lets you model your business data once using MDL (Modeling Definition Language), defining entities, relationships, calculations, and access rules, and then any AI agent queries through that shared understanding rather than trying to interpret the raw database directly. The system is powered by a Rust engine built on Apache DataFusion (a query execution engine) that translates modeled SQL queries and runs them against over 20 data sources including PostgreSQL, BigQuery, Snowflake, MySQL, DuckDB, Databricks, Redshift, ClickHouse, Athena, Spark, and others. It can be used as a Python SDK, a command-line tool, or as a WebAssembly (WASM) module that runs in the browser. There are also integrations for LangChain (a popular AI framework) with more framework integrations listed as coming soon. You can install WrenAI's agent skills using the npx skills add command and let an AI coding assistant like Claude Code or Cursor handle the onboarding setup. The core components are licensed under Apache 2.0, built by Canner.

Copy-paste prompts

Prompt 1
Walk me through standing up WrenAI locally with Docker and connecting it to my PostgreSQL database.
Prompt 2
Write an MDL file that models a sales schema with customers, orders, and a revenue calculation, then query it in natural language.
Prompt 3
Show me how to expose WrenAI as a tool to a Claude or LangChain agent so it can answer questions over BigQuery.
Prompt 4
Compare WrenAI to Vanna and LlamaIndex's text-to-SQL for governed analytics on Snowflake.
Prompt 5
Use npx skills add to install WrenAI's agent skills and have Cursor handle the onboarding setup.

Frequently asked questions

What is wrenai?

WrenAI is an open-source context layer that lets AI agents write accurate, governed SQL across 20+ data sources by modeling tables, relationships, and rules once in MDL.

What language is wrenai written in?

Mainly Rust. The stack also includes Rust, Python, DataFusion.

What license does wrenai use?

Apache 2.0 for the core: use, modify, and redistribute freely including commercially, keep the notice, with a patent grant from contributors.

How hard is wrenai to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is wrenai for?

Mainly data.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub canner on gitmyhub

Verify against the repo before relying on details.