WrenAI is the open-source generative BI (GenBI) engine. It gives the AI agents you already use (Claude Code, Cursor, MCP clients, LangChain) a governed semantic layer and an AI context layer, so they turn business questions into correct SQL, ship the answer as a shareable dashboard, and stay inside your guardrails.NL2SQLのカテゴリに入ると思いますが、セマンティック・レイヤーやAIコンテキスト・レイヤーをYAMLやMarkdown形式で保持し、AIエージェントにそれらのレイヤーの情報を提供した上で、NL2SQLを実行します。
Schemas tell an agent where data lives. Wren tells it what the data means: approved metric definitions, enums, units, joins, worked examples, and the tribal knowledge buried in docs and chat threads. All of it lives as reviewable YAML and Markdown in a repo you own.
sales_history % sqlcl -name local-26ai-sys
SQLcl: 金 10月 02 21:28:05 2026のリリース26.3 Production
Copyright (c) 1982, 2026, Oracle. All rights reserved.
接続先:
Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free
Version 23.26.3.0.0
SQL> @sh_install
Thank you for installing the Oracle Sales History Sample Schema.
This installation script will automatically exit your database session
at the end of the installation or if any error is encountered.
The entire installation will be logged into the 'sh_install.log' log file.
Enter a password for the user SH: ******
Enter a tablespace for SH [USERS]:
Do you want to overwrite the schema, if it already exists? [YES|no]:
Start time: 02-OCT-26 12.28.16.426810 PM +00:00
****** Creating COUNTRIES table ....
Table COUNTRIESは作成されました。
****** Creating CUSTOMERS table ....
Table CUSTOMERSは作成されました。
[中略]
End time: 02-OCT-26 12.28.29.116468 PM +00:00
1行が選択されました。
Installation verification
____________________________
Verification:
Table provided actual
_____________________________ ___________ _________
channels 5 5
costs 82112 82112
countries 35 35
customers 55500 55500
products 72 72
promotions 503 503
sales 918843 918843
times 1826 1826
supplementary_demographics 4500 4500
Thank you!
___________________________________________________________
The installation of the sample schema is now finished.
Please check the installation verification output above.
You will now be disconnected from the database.
Thank you for using Oracle Database!
Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free
Version 23.26.3.0.0から切断されました
sales_history %
mkdir wrenai-sales-history
cd wrenai-sales-history
Documents % mkdir wrenai-sales-history
Documents % cd wrenai-sales-history
wrenai-sales-history %
仮想環境を作成します。本記事では、macOSに標準でインストールされている3.14を使用しています。
uv python install 3.14
uv venv --python 3.14
source .venv/bin/activate
wrenai-sales-history % uv python install 3.14
Python 3.14 is already installed
wrenai-sales-history % uv venv --python 3.14
Using CPython 3.14.7
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
wrenai-sales-history % source .venv/bin/activate
(wrenai-sales-history) wrenai-sales-history %
WrenAIをインストールします。データベース接続をブラウザで設定できるように、追加パッケージのuiもインストールします。
wrenai-sales-history % uv pip install "wrenai[ui,oracle,memory]"
Resolved 78 packages in 306ms
Installed 78 packages in 672ms
+ annotated-doc==0.0.5
+ annotated-types==0.8.0
+ anyio==4.15.1
+ boto3==1.43.107
+ botocore==1.43.107
+ certifi==2026.7.22
+ cffi==2.1.1
+ charset-normalizer==3.5.2
+ click==8.5.0
+ cloudpickle==3.1.2
+ cryptography==50.0.2
+ deprecation==2.1.0
+ duckdb==1.5.6
+ filelock==4.0.9
+ fsspec==2026.9.0
+ h11==0.16.0
+ hf-xet==1.6.0
+ httpcore==1.0.9
+ httpx==0.28.1
+ huggingface-hub==1.33.0
+ idna==3.20
+ jinja2==3.1.6
+ jmespath==1.1.0
+ joblib==1.6.0
+ lance-namespace==0.13.0
+ lance-namespace-urllib3-client==0.13.0
+ lancedb==0.39.0
+ loguru==0.7.3
+ lxml==6.1.3
+ markdown-it-py==4.2.0
+ markupsafe==3.0.3
+ mdurl==0.1.2
+ mpmath==1.3.0
+ narwhals==2.26.0
+ networkx==3.7
+ numpy==2.5.3
+ opendal==0.47.10
+ oracledb==26.0.1
+ packaging==26.3
+ pandas==3.0.6
+ pyarrow==25.0.1
+ pyarrow-hotfix==0.7
+ pyasn1==0.6.4
+ pycparser==3.0
+ pydantic==2.13.5
+ pydantic-core==2.46.5
+ pygments==2.21.0
+ pyopenssl==26.4.0
+ python-dateutil==2.9.0.post0
+ python-dotenv==1.2.4
+ python-multipart==0.0.32
+ pyyaml==6.0.3
+ regex==2026.9.29
+ requests==2.34.2
+ rich==15.0.0
+ s3transfer==0.19.2
+ safetensors==0.8.0
+ scikit-learn==1.9.1
+ scipy==1.18.1
+ sentence-transformers==6.1.0
+ setuptools==84.0.0
+ shellingham==1.5.4
+ six==1.17.0
+ sqlglot==30.21.0
+ starlette==1.7.0
+ sympy==1.14.0
+ threadpoolctl==3.7.0
+ tokenizers==0.23.2
+ torch==2.14.1
+ tqdm==4.70.1
+ transformers==5.18.0
+ typer==0.27.2
+ typing-extensions==4.16.0
+ typing-inspection==0.4.4
+ urllib3==2.8.0
+ uvicorn==0.54.0
+ wren-core-py==0.8.0
+ wrenai==0.15.0
wrenai-sales-history %
データベースへの接続を構成します。接続先はローカルのコンテナで実行しているOracle AI Database 26ai Free、PDBはFREEPDB1、スキーマはSHです。
wren profile add my-db --ui
wrenai-sales-history % wren profile add my-db --ui
Opening browser... (press Ctrl+C to cancel)
npx skills add Canner/WrenAI
wrenai-sales-history % npx skills add Canner/WrenAI
███████╗██╗ ██╗██╗██╗ ██╗ ███████╗
██╔════╝██║ ██╔╝██║██║ ██║ ██╔════╝
███████╗█████╔╝ ██║██║ ██║ ███████╗
╚════██║██╔═██╗ ██║██║ ██║ ╚════██║
███████║██║ ██╗██║███████╗███████╗███████║
╚══════╝╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚══════╝
┌ skills
│
◇ Source: https://github.com/Canner/WrenAI.git
│
◇ Repository cloned
│
◇ Found 1 skill
│
● Skill: wren
│
│ Wren CLI for AI agents — a semantic SQL layer over 22+ databases (Postgres, MySQL, BigQuery, Snowflake, Spark, …). The actual workflow guides live inside the `wren` CLI itself; this is just a discovery stub. Use whenever the user asks a data question (how many, show me, top N, compare, trend, breakdown, metric, revenue, customers, orders), wants to install / set up Wren Engine, connect a new database, connect SaaS data via dlt (HubSpot, Stripe, Salesforce, GitHub, Slack), generate or regenerate an MDL project from a database schema, enrich a project with business context (enum meanings, units, cubes like ARR / DAU / churn), or turn a project's context layer into a shareable GenBI web app / dashboard and deploy it to Vercel or Cloudflare. Triggers: 'install wren', 'set up wren engine', 'connect database to wren', 'connect SaaS to wren', 'load hubspot / stripe / salesforce data', 'generate mdl', 'scaffold wren project', 'enrich wren context', 'augment my project', 'add cubes', 'build a dashboard', 'make a shareable analytics app', 'deploy my context layer as a web app', 'genbi app', 'wren onboarding', 'wren usage', 'wren generate mdl', 'wren dlt connector', 'wren enrich context', 'wren genbi'.
│
◇ 79 agents
◇ Which agents do you want to install to?
│ Amp, Cline, Codex, Cursor, Droid, Gemini CLI, GitHub Copilot, Kilo Code, Kimi Code CLI, OpenCode, Warp, Zed
│
◇ Installation scope
│ Project
│
◇ Installation Summary ─────────────────────────────────╮
│ │
│ ~/Documents/wrenai-sales-history/.agents/skills/wren │
│ copy → Amp, Cline, Codex, Cursor, Droid +7 more │
│ │
├────────────────────────────────────────────────────────╯
│
◇ Security Risk Assessments ──────────────────────────╮
│ │
│ Gen Socket Snyk │
│ wren Safe 0 alerts Low Risk │
│ │
│ Details: https://skills.sh/Canner/WrenAI │
│ │
├──────────────────────────────────────────────────────╯
│
◇ Proceed with installation?
│ Yes
│
◇ Installation complete
│
◇ Installed 1 skill ────────────────────────────────────────╮
│ │
│ ✓ wren (copied) │
│ → ~/Documents/wrenai-sales-history/.agents/skills/wren │
│ │
├────────────────────────────────────────────────────────────╯
│
└ Done! Review skills before use; they run with full agent permissions.
wrenai-sales-history %
これからはCodexにプロジェクトを作成し、作業を進めます。
「プロファイルmy-dbに構成されているOracle Databaseに接続して、Wrenによる問い合わせができるようにセットアップして。」
.venv/bin/wren --sql 'SELECT count(*) from sales'
wrenai-sales-history % .venv/bin/wren --sql 'SELECT count(*) from sales'
COUNT(*)
918843
# To save this query:
# wren memory store --nl '<natural language question>' --sql 'SELECT count(*) from sales'
wrenai-sales-history %





