Analytics Engineeringis ETM.
ETL ends at Load. Dex is built for what comes after: explore your data, transform it into models and semantic layers, and maintain them as sources change.
Writing SQL is one part of analytics engineering.
Your agent also needs to:
- 1understand the schema without starting from scratch every session,
- 2find the relevant tables among thousands,
- 3account for what a query costs,
- 4keep personal data out of its context,
- 5keep models and metric definitions coherent as their sources change.
Dex gives the agent a repeatable explore, transform, maintain loop, with guardrails enforced in the engine.
Explore
/dex:exploreMake sense of your data.
Stop running SELECT * LIMIT 10 by hand. Dex intelligently profiles columns, infers relationships, and builds a comprehensive draft map of your tables, cached locally. PII is automatically flagged, never surfaced.
Find the tables that matter, profile their columns, and verify joins before writing SQL. Answer ad-hoc questions through a query firewall that checks for personal data, read and query the semantic layer, and map relationships as a Mermaid ER diagram. Exploration needs no dbt project.
Read-only · writes only the .dex/ cache
| Command | What it returns |
|---|---|
dex explore map | Inventory every table: grain, joins, PII flags, data-quality findings |
dex explore profile | Column profiles: types, shapes, nulls, distinct counts |
dex explore relationships --verify | Joins checked against the data, not guessed from names |
dex explore query | Ad-hoc SQL through the query firewall and cost guard |
dex explore semantic | Read and query the semantic layer the repo declares |
dex explore diagram | The relationships as a Mermaid ER diagram |
Transform
/dex:transformBuild models and semantic layers.
Ask for a metric, and Dex writes the reviewable diffs. It authors dependency-aware dbt SQL models, schema tests, and the semantic layer on top, in MetricFlow, Apache Ossie, SLayer, Cube, Snowflake Semantic Views, or Databricks Metric Views. Validate against dev targets with built-in cost guards before anything runs.
Build and refactor dbt models from staging to marts, with tests, docs, and declared grain and population. Define semantic models and metrics over them, or work with a native semantic layer without a dbt project. Review each stored plan before applying it, then build and verify on a dev target.
Reviewable diffs · dev-target builds only
| Command | What it returns |
|---|---|
dex transform init | Bootstrap a dbt project |
dex transform plan | A change as a reviewable diff with a plan id; nothing is written |
dex transform apply | Write a reviewed plan to the repository |
dex transform build --verify | Build on dev, cost-quoted first, and check the result against its declaration |
dex transform declare | Propose declarations for models that have none |
dex transform test | Run the project's tests on dev |
Maintain
/dex:maintainDetect drift before it breaks.
Sources change. Business definitions drift. Run /dex:maintain against your .dex/ snapshot to instantly detect schema, grain, and semantic drift. Dex proposes the exact edits needed to keep your project correct.
Compare database schemas and profiles, the dbt project, and the semantic layer with the last snapshot. See which models and metrics a change affects and review the proposed edits. maintain verify also checks a project as it stands, with no baseline needed.
Drift as findings · fixes as diffs
| Command | What it returns |
|---|---|
dex maintain verify | Check the project as it stands, no baseline needed |
dex maintain snapshot | Record the baseline in .dex/snapshot.json |
dex maintain check | Schema, volume, grain and semantic drift against the snapshot |
dex maintain reconcile | The edits that bring the project back in line, as diffs |
dex maintain coverage | Which models have no tests |
dex maintain incidents · diagnose | Test failures as incidents, taken to a cause |
The demo is broken (on purpose!)
A first run that reports a clean bill of health doesn't teach much, so the demo ships with real defects. No database, no credentials, no cloud warehouse: every query runs against a local DuckDB file.
uv tool install "exmergo-dex-core[duckdb]"
dex init analytics --mode demo
dex explore map
7 tables · 29,512 rows · 5 joins inferred · 6 columns flagged as personal data · 6 data-quality findings
- Broken grainA batch was loaded twice, so order_item_id is unique for only 92.9% of rows. Dex leaves the grain unknown rather than guessing a key.
- Mixed idssku is 90% numeric, 10% md5-shaped. Cast it to a number and you silently drop 10% of products.
- False joinweb_events.customer_id shares a name with the CRM's key, but 100% of its values have no match.
- RefusedThe query firewall will not put customers.email into context. count(distinct email) runs, because a statistic is not a value.
What Dex will never do.
Enforced in the engine, on every step of the loop.
Write to your source data.
Dex's own SQL is SELECT-only. The only data writes are the dbt builds you confirm, on a dev target.
Put personal data in your agent's context.
PII is flagged by column, category and confidence, and never surfaced. Only a human clears a flag.
Spend before quoting.
A metered scan returns an estimate and runs only with your confirmation and a budget.
Change your project behind your back.
Every edit is a diff, and a human edit made since planning is never overwritten.
Build anywhere but dev.
Prod-looking targets are refused outright.
Reads your warehouse. Writes your semantic layer.
The loop, measured.
- 80%
- on dbt Labs' ADE-bench with Claude Sonnet 5.5
- 57.3%
- resolved on Snowflake’s 103-task data-eng-bench
Go deeper into the loop.
Dex Semantics
Every model your agent builds carries a declaration of what it means. Dex checks the built data against it, and the meaning flows to tests, semantic models and the next session.
Dex Telemetry
Every run recorded, your rules checked on every run, failures folded into incidents, and your agent sent to find the cause.
Explore, Transform, Maintain: frequently asked questions
Q01What is ETM?
Explore, Transform, Maintain: the loop of analytics engineering that comes after ETL ends at Load. Explore is understanding the data that landed, Transform is building models and semantic layers on it, and Maintain is keeping them correct as sources and definitions change. Dex ships each step as an agent skill: /dex:explore, /dex:transform and /dex:maintain.
Q02Does Dex replace my coding agent?
No. Dex runs inside the agent you already use, such as Claude Code, OpenAI Codex, Cursor or Gemini CLI. The skills point the agent at the exmergo-dex-core engine, which holds the logic and the guardrails, and every command answers with one sanitized JSON envelope.
Q03Do I need a dbt project to start?
No. Explore is read-only and needs no dbt project. dex transform init bootstraps one when you are ready, and Dex can also author a native semantic layer (Apache Ossie, SLayer, Cube, Snowflake Semantic Views or Databricks Metric Views) with no dbt project in the path.
Q04What does Dex write, and where?
Only reviewable files in your repository: dbt models, tests, docs and semantic-layer definitions, each proposed as a diff with a plan id and written only on transform apply. Dex's cache and snapshots live in .dex/. Dex's own SQL against your data is SELECT-only, and the only data writes are the dbt builds you confirm, on a dev target.
Q05How is drift detected?
dex maintain snapshot records a baseline in .dex/snapshot.json. dex maintain check compares the warehouse, the dbt project and the semantic layer with it on four axes (schema, volume, grain and semantic) and names the models and metrics each change affects. dex maintain reconcile proposes the edits as diffs, and never overwrites hand-written work. dex maintain verify checks a project as it stands, with no baseline.
Let your agent build your analytics.
The full loop is free and open source under Apache 2.0.
npx skills add exmergo/dexCodex, Gemini CLI, Cursor, and others, via AGENTS.md.