Connect Enterprise Data with Semantic Understanding
Wren Engine gives AI agents a semantic context layer over business data - models, metrics, and governed query planning.
wren-v0.4.0Add to Favorites
Why it matters
Enable AI agents and MCP clients to access enterprise data with semantic understanding, business logic, and governance. Provides context-aware data access across multiple sources.
Outcomes
What it gets done
Connect to 11+ data sources including BigQuery, PostgreSQL, and Snowflake.
Understand data models with business context and definitions.
Enforce user-based permissions and access control.
Perform reliable calculations and aggregations for reporting.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-wren-engine | bash Overview
Wren Engine MCP Server
Wren Engine gives AI agents a semantic context layer over business data, using MDL to define models, metrics, and relationships, then planning governed queries across 15+ connected data sources instead of raw SQL. Use it when agents need consistent, governed business definitions rather than raw schema access; this repository is archived and now maintained as the core/ directory of Canner/WrenAI.
What it does
Wren Engine is an open source context engine that turns raw business data into agent-usable context. Instead of an AI agent guessing which raw table to query or how to write a join, Wren Engine lets you define business models, metrics, relationships, and access rules using its Modeling Definition Language (MDL), then plans correct queries across your underlying data sources based on that semantic layer. Its MCP server exposes this context to MCP-compatible clients so agents reason over trusted business definitions instead of ad hoc SQL.
Note: this repository is archived. It has been merged into Canner/WrenAI under the core/ directory; new issues, PRs, and development happen there.
When to use - and when NOT to
Use this when your AI agent needs to answer questions using consistent business definitions - what counts as "net revenue" or "active customer" - rather than inventing SQL against raw schemas each time. It fits governed enterprise data access, natural-language analytics, and agent-native tools like Claude Code, Cursor, or Claude Desktop. It is not useful for simple cases where raw schema access is enough, and it is not itself a data catalog - it's a semantic and execution layer that sits above whatever catalog or schema documentation you already have, and typically complements rather than replaces one.
Capabilities
- Semantic modeling via MDL to capture business models, metrics, relationships, and access rules.
- Query planning that translates natural-language intent into correct, governed queries across connected data sources.
- MCP server exposing this context to AI agents and MCP-compatible clients, including a local Web UI for connection and MDL setup, read-only mode for safer agent usage, manifest deployment/validation tools, and remote schema discovery.
- Connectors for 15+ data sources including PostgreSQL, Snowflake, BigQuery, Redshift, Databricks, ClickHouse, DuckDB, MySQL, Oracle, SQL Server, Trino, Apache Spark, Athena, and S3/GCS/MinIO/local files.
How to install
Follow the installation guide for the MCP server:
cd mcp-server
# see module README for uv-based setup
Full setup steps, including a quick-start walkthrough ("Chat with jaffle_shop using Wren Engine + Claude Code"), are documented at docs.getwren.ai/oss/engine/get_started/installation. The core Rust engine (wren-core) can be built independently with cargo check --all-targets, and the connector server (ibis-server) with just install && just dev.
Who it's for
Teams building agent-native data tools - AI copilots, natural-language analytics, or code assistants - who need agents to reason over trusted business definitions and governed query planning instead of raw schema dumps or invented SQL.
Source README
Wren Engine - Archived
This repository has been merged into Canner/WrenAI under the
core/directory and is now archived (read-only).New issues and PRs → Canner/WrenAI
Full migration details (path mapping, archived modules, rationale) → discussion #1592
The open context engine for AI agents
Wren Engine is the open foundation behind Wren AI: a semantic, governed, agent-ready context layer for business data.
https://github.com/user-attachments/assets/037f2317-d8e5-41f2-9563-1e0bce4ef50c
Why Wren Engine
AI agents can already call tools, browse docs, and write code. What they still struggle with is business context.
Enterprise data is not just rows in a warehouse. It is definitions, metrics, relationships, permissions, lineage, and intent. An agent that can connect to PostgreSQL or Snowflake still does not know what "net revenue", "active customer", or "pipeline coverage" actually mean in your company.
This is not just our thesis. In Your Data Agents Need Context, a16z argues that data agents break down when they only have connectivity and SQL generation, but lack business definitions, source-of-truth context, and the operational knowledge that explains how a company actually runs.
Wren Engine exists to solve that gap.
It gives AI agents a context engine they can reason over, so they can:
- understand models instead of raw tables
- use trusted metrics instead of inventing SQL
- follow relationships instead of guessing joins
- respect governance instead of bypassing it
- turn natural language into accurate, explainable data access
This is the open source context engine for teams building the next generation of agent experiences.
The Vision
We believe the future of AI is not tool calling alone. It is context-rich systems where agents can reason, retrieve, plan, and act on top of a shared understanding of business reality.
Wren Engine is our open source contribution to that future.
It is the semantic and execution foundation beneath Wren AI, and it is designed to be useful well beyond a single product:
- embedded in MCP servers and agent workflows
- connected to modern warehouses, databases, and file systems
- expressive enough to model business meaning through MDL
- robust enough to support governed enterprise use cases
- open enough for the community to extend, integrate, and build on
If Wren AI is the full vision, Wren Engine is the open core that makes that vision interoperable.
What Wren Engine Does
Wren Engine turns business data into agent-usable context.
At a high level:
- You describe your business domain with Wren's semantic model and MDL.
- Wren Engine captures the context agents need: models, metrics, relationships, and access rules.
- It analyzes intent and plans correct queries across your underlying data sources.
- MCP clients and AI agents interact with that context through a clean interface.
- Teams keep refining the model as business logic and systems evolve.
This is the practical open source path from text-to-SQL toward context-aware data agents.
That means your agent is no longer asking, "Which raw table should I query?"
It is asking, "Which business concept, metric, or governed slice of context do I need to answer this task correctly?"
Built For Agent Builders
Wren Engine is especially useful for the open source community building agent-native workflows in tools like:
- OpenClaw
- Claude Code
- VS Code
- Claude Desktop
- Cline
- Cursor
If your environment can speak MCP, call HTTP APIs, or embed a semantic service, Wren Engine can become the context layer behind your agent.
Use it to power experiences like:
- natural-language analytics with trusted business definitions
- AI copilots that can answer questions across governed enterprise data
- agents that generate dashboards, reports, and workflow decisions
- code assistants that need real business context, not just schema dumps
- internal AI tools that should be grounded in semantic models instead of ad hoc SQL
This is especially important in developer-facing agent environments, where the assistant may understand your codebase but still lacks the business context required to answer data questions correctly.
Supported Data Sources
Wren Engine is built to work across modern data stacks, including warehouses, databases, and file-based sources.
Current open source support includes connectors such as:
- Amazon S3
- Apache Spark
- Apache Doris
- Athena
- BigQuery
- ClickHouse
- Databricks
- DuckDB
- Google Cloud Storage
- Local files
- MinIO
- MySQL
- Oracle
- PostgreSQL
- Redshift
- SQL Server
- Snowflake
- Trino
See the connector API docs in the project documentation for the latest connection schemas and capabilities.
Get Started
Use Wren Engine through AI Agents
If you want to use Wren Engine from a Claude Code or other AI Agents, start here:
- Installation
- Quick start: Chat with jaffle_shop using Wren Engine + Claude Code
- Understanding Wren AI project structure
The MCP server includes:
- a local Web UI for connection and MDL setup
- read-only mode for safer agent usage
- manifest deployment and validation tools
- metadata tools for remote schema discovery
Learn the concepts
- What is context?
- What is Modeling Definition Language (MDL)?
- Benefits of Wren Engine with LLMs
- Your Data Agents Need Context
- Powering Semantic SQL for AI Agents with Apache DataFusion
Wren Engine vs. Other Data Tools
People often compare Wren Engine to catalog services like DataHub, raw database MCP servers, BI semantic tools, or text-to-SQL agents.
The simple difference is:
- those tools usually help an agent find data or generate SQL
- Wren Engine helps an agent understand business meaning and produce the right query through a context engine
| Tool type | What it gives the agent | What Wren Engine adds |
|---|---|---|
| Data catalog services | Tables, columns, lineage, owners, descriptions | Business models, metrics, relationships, and governed query planning |
| Raw database or schema access | Direct access to schemas and SQL execution | A business layer above raw tables so the agent does not have to guess intent |
| BI or semantic tools | Curated metrics and entities for analytics workflows | An open context layer designed for MCP and agent workflows |
| Text-to-SQL agents | Fast SQL generation from natural language | Better accuracy by grounding generation in explicit business definitions |
Many teams will want both:
- a catalog to inventory and document the data estate
- Wren Engine to turn that data into agent-ready context
Why that matters:
- more accurate answers because joins and metrics are defined instead of guessed
- more consistent answers because every agent uses the same business definitions
- safer data access because governance can be carried into query planning
- less prompt engineering because the context lives in the engine, not in the prompt
Without Wren, an agent may know where the data is but still not know how to answer the question correctly.
Repository Map
This repository contains the core engine modules:
| Module | What it does |
|---|---|
wren-core |
Rust context engine powered by Apache DataFusion for MDL analysis, planning, and optimization |
wren-core-base |
Shared manifest and modeling types |
wren-core-py |
PyO3 bindings that expose the engine to Python |
ibis-server |
FastAPI server for query execution, validation, metadata, and connectors |
mcp-server |
MCP server for AI agents and MCP-compatible clients |
Supporting modules include wren-core-legacy, example, mock-web-server, and benchmarking utilities.
Developer entry points
Local Development
Common workflows:
# Rust context engine
cd wren-core
cargo check --all-targets
# Python + connector server
cd ibis-server
just install
just dev
# MCP server
cd mcp-server
# see module README for uv-based setup
Project Status
Wren Engine is actively evolving in the open. The current focus is to make the context engine, execution path, and MCP integration stronger for real-world agent workflows.
If you are building with agents today, this is a great time to get involved.
Community
- Join our Discord community
- Open a GitHub issue
- Explore Wren AI to see the broader product vision
- Read the market thesis from a16z: Your Data Agents Need Context
Wren Engine is for builders who believe AI needs better context, not just better prompts.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.