Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 54 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ AI agents can already call tools, browse docs, and write code. What they still s

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](https://a16z.com/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.

<p align="center">
<img width="920" height="638" alt="without_wren_engine" src="https://github.com/user-attachments/assets/3295dde5-ce41-4e56-a8ad-daff6a0c3459" />
</p>
Expand All @@ -59,6 +61,8 @@ This is the open source context engine for teams building the next generation of

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.

The a16z post captures this shift well: the market is moving beyond text-to-SQL and toward a living context layer that combines semantic meaning, system structure, governance, and human refinement.

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:
Expand All @@ -78,14 +82,52 @@ Wren Engine turns business data into agent-usable context.
At a high level:

1. You describe your business domain with Wren's semantic model and MDL.
2. Wren Engine analyzes intent, models, relationships, and access rules.
3. It plans and generates correct queries across your underlying data sources.
2. Wren Engine captures the context agents need: models, metrics, relationships, and access rules.
3. It analyzes intent and plans correct queries across your underlying data sources.
4. MCP clients and AI agents interact with that context through a clean interface.
5. 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use hyphenated compound adjective at Line 90.

“open source” should be hyphenated here because it modifies “path.”

✏️ Proposed copy edit
-This is the practical open source path from text-to-SQL toward context-aware data agents.
+This is the practical open-source path from text-to-SQL toward context-aware data agents.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
This is the practical open source path from text-to-SQL toward context-aware data agents.
This is the practical open-source path from text-to-SQL toward context-aware data agents.
🧰 Tools
🪛 LanguageTool

[grammar] ~90-~90: Use a hyphen to join words.
Context: ...tems evolve. This is the practical open source path from text-to-SQL toward cont...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 90, The phrase "open source path" in the README sentence
"This is the practical open source path from text-to-SQL toward context-aware
data agents." should use a hyphenated compound adjective; update it to
"open-source path" wherever that exact sentence or the fragment "open source
path" appears in README.md so the adjective correctly modifies "path."


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?"

## Where Wren Engine Fits Compared To Other Approaches

Teams sometimes ask how Wren Engine differs from connecting an agent to a catalog service such as DataHub through MCP, or from other tools that already expose metadata, BI models, or text-to-SQL access.

The short answer is: many tools help agents discover data or generate queries, while Wren helps agents reason over business meaning and execute governed data access through a semantic layer.

| Approach people often compare | Examples | What it is great at | What is still typically left unresolved for the agent | How Wren Engine differs |
| --- | --- | --- | --- | --- |
| Data catalog service via MCP | DataHub, similar catalog and metadata platforms | Metadata discovery, lineage, ownership, documentation, asset search | Choosing trusted metrics, resolving joins correctly, and turning metadata into governed runtime query behavior | Wren adds semantic models, relationships, metrics, and runtime query planning |
| Database connector or schema browser | Direct warehouse/database MCP servers, JDBC-style access, raw schema inspection tools | Fast access to tables, columns, and SQL execution endpoints | Business meaning is mostly implicit, so agents still have to infer intent from physical schema | Wren gives agents a business layer above raw tables and columns |
| BI or semantic tooling | Semantic layers, metrics layers, BI modeling tools | Defining curated metrics and business-friendly entities for analytics consumers | Many are designed first for dashboards or analyst workflows, not as an open runtime context layer for MCP-native agents | Wren is designed to expose semantic context directly to agent workflows through MCP and APIs |
| Text-to-SQL or SQL agent tooling | NL-to-SQL assistants, generic SQL copilots, LLM agents with database tools | Turning questions into SQL quickly when schema is simple or well-known | Accuracy drops when business definitions, joins, governance, or ambiguity matter | Wren reduces guessing by grounding generation in explicit semantic definitions |
| Knowledge base or documentation retrieval | Wiki search, docs search, RAG over data docs | Retrieving written explanations, runbooks, definitions, and usage notes | Retrieved docs may be stale, inconsistent, or not executable at query time | Wren operationalizes business context so it can be used consistently during planning and execution |

Another way to frame it:

| Dimension | Many adjacent tools | Wren Engine |
| --- | --- | --- |
| Primary role | Discovery, retrieval, documentation, or raw access | Semantic modeling, query planning, and governed execution context |
| What the agent mainly sees | Tables, columns, lineage, tags, owners, descriptions, docs, or SQL endpoints | Models, metrics, relationships, business definitions, and access rules |
| Main question it answers | "What data exists, and how can I inspect or query it?" | "What business concept or trusted metric should I use to answer this question correctly?" |
| SQL generation | Often left to the agent or a generic LLM layer | Built around translating intent through a semantic layer into correct queries |
| Join logic | Agent often has to infer joins from schema, lineage, or examples | Relationships are modeled explicitly so joins are not guessed ad hoc |
| Metric consistency | Definitions may exist in docs or dashboards, but enforcement is indirect | Metrics are defined in the semantic model and reused consistently |
| Governance at query time | Often visible as metadata or policy hints | Designed to carry governed business context into runtime query planning |
| Runtime role in an agent workflow | Helps the agent find, read, or access candidate data assets | Serves as the context and execution layer the agent uses to answer questions |

In practice, many teams may want multiple layers working together:

- a catalog service to inventory and govern the data estate
- documentation and lineage tools to help humans understand the environment
- Wren Engine to turn that estate into a semantic, agent-ready context layer

If you only give an agent metadata, docs, or raw database access, it may still need to guess which joins, filters, and metric definitions are actually correct. Wren exists to reduce that gap between discovery and trustworthy execution.

## Built For Agent Builders

Wren Engine is especially useful for the open source community building agent-native workflows in tools like:
Expand All @@ -107,6 +149,8 @@ Use it to power experiences like:
- 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.

## Why Open Source

We think agent infrastructure should be composable.
Expand All @@ -121,6 +165,8 @@ Wren Engine is open source so the community can:
- build opinionated agent products on a transparent foundation
- help define what a real context layer for AI should look like

We want that context layer to be inspectable, composable, and community-owned, not trapped inside a single proprietary interface.

## Architecture At A Glance

```text
Expand All @@ -139,6 +185,8 @@ Core ideas:
- `ibis-server` provides the execution and connector-facing API layer
- `mcp-server` makes Wren easy to use from MCP-compatible agents

That last point matters: context only helps agents when it is available at runtime. Wren is built to expose that layer over MCP and APIs.

## Repository Map

This repository contains the core engine modules:
Expand Down Expand Up @@ -171,10 +219,10 @@ Current open source support includes connectors such as:
- MySQL
- Oracle
- PostgreSQL
- Redshift
- SQL Server
- Snowflake
- Trino
- Redshift

See the connector API docs in the project documentation for the latest connection schemas and capabilities.

Expand All @@ -196,9 +244,10 @@ The MCP server includes:
### Learn the concepts

- [Quick start with Wren Engine](https://docs.getwren.ai/oss/engine/get_started/quickstart)
- [What is semantics?](https://docs.getwren.ai/oss/engine/concept/what_is_semantics)
- [What is context?](https://docs.getwren.ai/oss/engine/concept/what_is_context)
- [What is Modeling Definition Language (MDL)?](https://docs.getwren.ai/oss/engine/concept/what_is_mdl)
- [Benefits of Wren Engine with LLMs](https://docs.getwren.ai/oss/engine/concept/benefits_llm)
- [Your Data Agents Need Context](https://a16z.com/your-data-agents-need-context/)
- [Powering Semantic SQL for AI Agents with Apache DataFusion](https://getwren.ai/post/powering-semantic-sql-for-ai-agents-with-apache-datafusion)

### Developer entry points
Expand Down Expand Up @@ -239,5 +288,6 @@ If you are building with agents today, this is a great time to get involved.
- Open a [GitHub issue](https://github.com/Canner/wren-engine/issues)
- Explore [Wren AI](https://github.com/Canner/WrenAI) to see the broader product vision
- Read our mission piece: [Fueling the Next Wave of AI Agents](https://getwren.ai/post/fueling-the-next-wave-of-ai-agents-building-the-foundation-for-future-mcp-clients-and-enterprise-data-access)
- Read the market thesis from a16z: [Your Data Agents Need Context](https://a16z.com/your-data-agents-need-context/)

Wren Engine is for builders who believe AI needs better context, not just better prompts.
Loading