Skip to content

Latest commit

 

History

History
222 lines (155 loc) · 10.5 KB

File metadata and controls

222 lines (155 loc) · 10.5 KB
WrenAI

The open context layer for AI agents over business data.

Your agent doesn't know what your data means. We fix that.

Docs · Discord · Vision · Blog

License: Apache 2.0 PyPI GitHub Release Discord Last commit Follow on X Made by Canner Stars

Canner/WrenAI | Trendshift

📣 2026-05-07 — Wren Engine has merged into this repo under core/. The previous Canner/wren-engine repo is archived. The previous WrenAI GenBI app is preserved on the legacy/v1 branch (tag v1-final). Read the announcement →


What WrenAI is

WrenAI is the open context layer that gives your agents what schemas don't: business semantics, examples, memory, governance, and — soon — the unstructured corporate knowledge that lives in your docs, wikis, and chat threads. Built for the agent frameworks you already use.

Wren AI architecture

Why agent builders pick WrenAI

  • Open by default — Open-sourced core, SDK, and skills through Apache-2.0 license.
  • Built for AI agents — Skills, agentic architecture, context retrieval are first-class. Ships as SDKs for the agent frameworks that engineers already use.
  • Correctness as primitives — rich schema retrieval, dry-plan validation, structured errors with hints, value profiling, eval runner. The agent orchestrates; the trace lives in the agent's reasoning.
  • Reviewable, reproducible context — every definition, example, and mapping is versionable and evidence-linked. Git-friendly.
  • Sits on top of your existing stack — warehouse, transformation pipelines, your existing semantic layer. Not another tool to maintain.

With & Without Wren AI

Agents are everywhere. Claude Code, Cursor, ChatGPT, Aider, LangChain pipelines, Pydantic AI flows, in-house copilots, customer-facing apps. None of them should have to rediscover your business logic from scratch. With Wren AI, "the context layer," they query through a standalone, shared interface usable by every agent and person, not gated behind a single vendor's UI and architecture.

before & after

Quickstart

WrenAI is agent-driven by design: install the CLI, install a one-file discovery stub for your AI client, then let your AI agent drive the rest. Workflow guides live inside the CLI itself and are served on demand, so content always matches the installed version.

1. Install the CLI

pip install wrenai                      # core (DuckDB included)
pip install "wrenai[postgres,memory]"   # add per-datasource and memory extras as needed

2. Install the discovery stub for your AI client

npx skills add Canner/WrenAI            # auto-detects Claude Code, Cursor, Cline, Codex, …

The stub is ~50 lines. It teaches your agent to fetch workflow guides via wren skills get <name> and shaped prompts via wren ask "<question>" --guided|--direct — everything else lives in the CLI.

3. Ask your agent to set things up

Open your agent in a project directory and say something like:

"Use Wren to set up my Postgres database."

The agent runs wren skills get onboarding, follows the guide step-by-step, checks your environment, creates a connection profile, scaffolds the project, and runs a first query.

4. (Optional) Enrich the project

Once onboarding finishes, ask:

"Enrich my Wren project with the business context in raw/."

The agent runs wren skills get enrich-context and follows the guide in grill mode (one question at a time) or auto-pilot mode (agent reads <project>/raw/ and proposes). Both modes write to MDL, instructions, queries, and memory — all reviewable, all Git-friendly.

5. Ask questions

"Who are our top 10 customers by sales this quarter?"

Your agent fetches MDL context, recalls similar past queries, writes governed SQL, and executes via wren query.

Want to try it without your own database? Ask your agent to use the bundled jaffle_shop sample dataset — same flow, querying a real warehouse end-to-end in a couple of minutes.

Two beats: scaffold fast, enrich deep

# Day 1 — agent-driven
wren skills get onboarding         # workflow guide: set up project + first query
wren skills get enrich-context     # workflow guide: add business context (cubes, units, enums)

# Day-to-day
wren query --sql '...'             # query through the MDL semantic layer
wren ask "<question>" --guided     # wrap a question for a weaker agent
wren ask "<question>" --direct     # wrap a question for a stronger agent

Fast at first. Deep when you need it. Always reviewable and Git-friendly.

What's Included

  • Modeling Definition Language (MDL) — models, columns, relationships, views, cubes, metrics, row-level / column-level access control (RLAC / CLAC)
  • Engine — Apache DataFusion based, 22+ data sources
  • Memory & examples — LanceDB-backed, hybrid retrieval, versionable
  • Agent SDKwren-langchain (LangChain / LangGraph), wren-pydantic; reference Python integration for other stacks
  • Governed execution primitives — functions, dry-plan, row limits, access control

What's next

  • Context enrichment skill/wren-enrich-context (grill + auto-pilot modes) hardened across MDL, instructions, queries, and memory
  • End-to-end correctness primitives — value profiling, rich retrieval, structured errors, golden eval runner
  • Agent-native distribution — first-class SDKs across major agent frameworks; see GitHub Discussions for what's prioritized next
  • Full governed execution — audit logs, rate limits, approval workflow, data-flow inspector

Full roadmap and design notes: see the vision paper.

Documentation

  • Quickstart — from skill install to first answer
  • Concepts — what context is, what MDL is, how memory works
  • Connect a database — Postgres, BigQuery, Snowflake, DuckDB, and more
  • Agent SDKs — what's shipping today, what's next

Community

  • 💬 Discord — chat with the team and other builders
  • 🐙 GitHub Discussions — design conversations, RFCs, longer threads
  • 🐦 Twitter / X — release notes and short updates
  • 🗞 Blog — vision, post-mortems, deep dives

Contributing

We build in the open. Issues, PRs, connector contributions, SDK integrations, docs fixes — all welcome.

Project structure — click to expand
core/
  wren-core/         Rust semantic engine (Apache DataFusion)
  wren-core-base/    Shared manifest types + MDL builder
  wren-core-py/      Python bindings (PyPI: wren-core)
  wren-core-wasm/    WebAssembly build (npm: wren-core-wasm)
  wren/              Python SDK and CLI (PyPI: wrenai)
  wren-mdl/          MDL JSON schema
sdk/
  wren-langchain/    Reference agent SDK integration
skills/              Agent skills for context authoring
docs/                Module documentation
examples/            Example projects

Contributors

WrenAI contributors

License

Apache 2.0. See LICENSE.


Come build the context layer with us.

If WrenAI helps you, drop a ⭐ — it genuinely helps us grow!

⬆️ Back to top