dbt Core integration
Your dbt Core semantic layer defines the metric. KPI Tree explains the movement, names the owner and proves the fix.
Upload the semantic manifest your dbt Core project already compiles.Upload the semantic manifest your dbt Core project already compiles. KPI Tree renders every dbt Semantic Layer metric as MetricFlow SQL in your warehouse’s own dialect, runs it against the models you already build, keeps each definition exactly as written and creates a child metric for every dimension value you care about. Above that it adds the layer dbt never carried: which metrics drive which, with statistical confidence, who is accountable when one moves, and whether the last action worked. No dbt Cloud account in the loop.
semantic_manifest.json
compiled from models/marts/metrics.yml
metrics:
- name: revenue
label: Revenue
type: simple
type_params:
measure: order_total # agg: sum
filter: {{ Dimension('order__status') }} = 'complete'
Revenue
Synced from dbt£1.28m
Month to date · vs £1.51m last month
Aggregation
sum · day, week, month, quarter
Primary driver
Conversion rate · lag 3d
Accountable
Last action
Checkout rollback · verified
Governed in dbt Core. Explained in KPI Tree. One manifest, the whole loop.
A dbt Core project is the cleanest definition of a metric a business can have: version-controlled YAML, one calculation, reviewed in a pull request. KPI Tree treats it as the source of truth. It reads semantic_manifest.json straight from your target directory, renders the SQL with an in-process MetricFlow engine, and runs it on the warehouse your models build into. Nothing is re-declared, re-mapped or copied into a second semantic layer, and no dbt Cloud API sits in the path. No other dbt Semantic Layer integration on dbt's own list reads a dbt Core manifest directly.
What the dbt Semantic Layer does not know is why Revenue fell, who owns Conversion, or whether Monday's release moved it. That is the layer KPI Tree adds: a causal metric tree re-tested every night, RACI ownership on every node, action plans measured against a forecast, and Canopy, the business context layer that hands all of it to your people and to the agents they already use over MCP. Your dbt project stays the single source of truth for how a metric is calculated. KPI Tree becomes the source of truth for what to do about it.
Every definition, as written, nothing re-declared
Metrics, dimensions, entities, measures, labels and descriptions come across intact. Sum, average, first and last are read from the definition, so weekly and monthly rollups behave the way your YAML says.
Choose metrics to sync
4 of 5 selectedRevenue
dimensions: region, channel
Orders
dimensions: region, channel, plan
Average order value
dimensions: region
Active customers
dimensions: plan
Cumulative bookings
dimensions: none
Aggregation read from each definition. Nothing re-declared.
One query per metric, everything else in memory
Each metric is one aggregation query at day grain. Comparisons, rollups, breakdowns and the nightly correlation and causality sweep run in KPI Tree’s own engine, so the warehouse bill stays flat as the tree grows.
Warehouse queries · last sync
4 total0 warehouse queries for
period comparisons, weekly and monthly rollups, dimension breakdowns, nightly correlation and causality tests. All computed in memory from those four results.
Dimension metrics, created automatically
Switch on Create Dimension Metrics and every dimension you chose becomes a child metric per value: Revenue (Region: EMEA), Revenue (Region: APAC), and so on. Each child gets its own owner, baseline and nightly driver tests, so you see which region moved and who owns it. No YAML changes.
Revenue
Create Dimension Metrics · ondimensions: region, channel · 5 child metrics created
Each child has its own owner, baseline and nightly driver tests. No YAML changes.
Re-sync as a diff, trees and owners untouched
Every upload is compared with the last. New metrics appear, changed ones update in place, removed ones retire with their history kept. Ownership, trees and action history stay exactly where you left them.
Sync summary
Completed 06:1442
Found
3
Created
38
Updated
1
Archived
0
Skipped
customer__customer_id skipped: 48,211 values, above the 50 value limit
Trees, owners and action history preserved · gross_margin renamed in place
Connected in three steps. The manifest you already build, the warehouse you already run.
Link the warehouse the models build into
- Snowflake, BigQuery, Databricks, Redshift and PostgreSQL
- Read-only, scoped credentials, encrypted at rest
- No dbt CLI, adapter or profile needed on our side
dbt Core Semantic Layer
ConnectedUpload the semantic manifest
- dbt Core 1.6 onwards: the measures-based spec and the modernised spec are both read
- Up to 50 MB per artifact or ZIP
- Sync runs automatically on every upload
~/analytics % dbt build
Running with dbt=1.12
Found 84 models, 12 sources, 41 metrics, 9 semantic models
Completed successfully. Artifacts written to target/
~/analytics % cd target && zip dbt_artifacts.zip semantic_manifest.json manifest.json run_results.json sources.json catalog.json
adding: semantic_manifest.json (deflated 91%) ... catalog.json (deflated 88%)
~/analytics % curl -X POST -H "Authorization: Bearer $KPITREE_API_KEY" -F "artifacts=@target/dbt_artifacts.zip" "https://acme.kpitree.co/api/connections/$KPITREE_CONNECTION_ID/semantic_layer/dbt/artifacts"
202 Accepted · sync started · 41 metrics found
Keep it in sync from CI
- One repository secret: an API key scoped to semantic layer uploads
- Workspace domain and connection ID travel as workflow variables
- Swap the adapter line for your own warehouse
name: dbt Build and Sync to KPI Tree
on:
push:
branches: [main]
env:
KPITREE_DOMAIN: acme.kpitree.co
KPITREE_CONNECTION_ID: 9f2c…c41a
jobs:
dbt-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install dbt-core dbt-snowflake
- run: dbt deps && dbt build
- name: Upload artifacts to KPI Tree
run: |
zip -j target/dbt_artifacts.zip target/*.json
curl -X POST -H "Authorization: Bearer ${{ secrets.KPITREE_API_KEY }}" \
-F "artifacts=@target/dbt_artifacts.zip" \
"https://${{ env.KPITREE_DOMAIN }}/api/connections/${{ env.KPITREE_CONNECTION_ID }}/semantic_layer/dbt/artifacts"
What comes across from a dbt Core semantic layer. And what stays exactly where it is.
Metrics simple, ratio, cumulative, derived, conversion
Dimensions and entities child metrics created for you
Aggregation and rollups read, inferred, or declared
Five artifacts, one ZIP. The context behind every number.
Include the rest of the target directory and every metric gains its own lineage, column context, build history and freshness. An assistant can then check whether a movement is a business change or a stale source before anyone acts on it.
semantic_manifest.json
Metric definitions
requiredMetrics, semantic models, measures, dimensions and entities. Starts the sync.
manifest.json
Model lineage
optionalModels, seeds and sources with their dependencies. Unlocks data model exploration in the app and over MCP.
catalog.json
Column context
optionalEvery warehouse column with its real data type, merged over the descriptions you wrote.
run_results.json
Build history
optionalLast build status and timing on every model, and each metric’s refresh cadence worked out from your run history.
sources.json
Source freshness
optionalFreshness status and loaded-at times, so stale upstream data shows on the metric itself.
Artifacts arrive through the upload endpoint from your own pipeline, up to 50 MB each. Tests and exposures are not read, and lineage is kept at model level.
Ask an agent the same question twice. Once on the dbt Semantic Layer, once on Canopy above it.
A dbt Core team usually already has an agent on the warehouse, or MetricFlow running locally, and it comes back with a governed number. The fair question is what Canopy adds. The pair below shows the shape of the difference, and the benchmark beneath it measures it on eight real business questions.
The semantic layer alone
A correct number, and a dead end.
Every consumer of the dbt Semantic Layer, dbt’s own MCP server included, gets the same governed figure. None of them gets the cause, the owner or the follow-up, so the question goes back to the data team.
Canopy on top of dbt
The driver, the owner, the build check and the next step.
Canopy reads the causal tree, the RACI, the build history from your dbt artifacts and the open tasks, so the first answer is the one people act on.
We measured it. Eight business questions toOpus 5, three ways in: Snowflake over MCP, raw SQLSnowflake Cortex Analyst, a governed semantic modelCanopy withSnowflake Semantic Views
One shared dataset, the same model, the same questions. The Cortex Analyst arm is the closest stand-in for an agent on the dbt Semantic Layer or the dbt MCP server: governed definitions and correct numbers, but no causal model, no owners and no record of what was tried. All three arms say what moved. Only the Canopy arm says why, who owns it and what is already being done, first time, without a week of follow-up questions.
August was a good month. The alarming numbers on the dashboard right now are September-to-date, not August — the health report's "EBITDA -21.8% MoM" is 1–9 Sep vs 1–9 Aug. Read on the full month, August looks like this:
| Aug 2026 | Jul 2026 | Aug 2025 | |
|---|---|---|---|
| Revenue | £378,621.99 | £364,535.26(+3.9%) | £368,140.79(+2.8%) |
| EBITDA | £111,351.63 | £99,888.10(+11.5%) | £114,655.61(-2.9%) |
| Gross margin % | 60.2 | 59.7 | 68.5 |
| COGS % | 39.8 | 40.3 | 31.5 |
| Labour cost % | 22.1 | 23.5 | 14.5 |
The finding: August sold more than last August and earned less. Revenue was up £10,481.20 year on year, yet EBITDA was down £3,303.98. That is not a demand problem — it is entirely a cost-structure problem. COGS is running 8.3 points higher than last August and labour 7.6 points higher.
I'm quoting those as percentage points rather than converting to a cash bridge: the margin metrics aggregate daily rates and don't reconcile cleanly against the P&L lines, so a pounds figure would be spurious.
KPI Tree's Canopy business context layer explains both halves of that.
Why August beat July:
- The King's Head kitchen refit finished ahead of schedule, so the venue reopened a full week early and caught the bank holiday trade that had been written off.
- The Sunday roast menu relaunched across all London venues with sharing boards and a fixed-price family option.
- At Shoreditch, moving quiz night from Tuesday to Thursday lifted revenue per labour hour — Thursdays were dead and the kitchen was already staffed.
Why the year-on-year margin is gone:
- Menu re-costing came back showing produce inflation at about 9%, steeper than budgeted, with beef and dairy the worst offenders.
- The draught supplier raised keg prices 6%, affecting every venue on the same contract.
- Leadership chose to re-engineer the menu rather than raise prices — protecting the headline price going into a soft quarter, but absorbing the inflation into margin. August is what that decision costs.
Two other recorded items shape the read: the area manager is on leave through the bank holiday fortnight (cover split between two senior venue managers, until 22 Sep), and the new till system is blocked on payment provider approval, so the faster table-ordering flow is still switched off at the pilot sites.
All four venues beat July. Against last August, only one is ahead:
- Canary Wharf £24,832.15 — +3.9% (+£934.15) — the only venue up
- Liverpool Street £26,658.84 — -3.9% (-£1,085.55)
- Paddington £26,977.50 — -4.4% (-£1,241.53)
- Shoreditch £32,883.14 — -5.5% (-£1,911.05)
Canary Wharf being the outlier lines up with the recorded decision to hold its staffing flat through the quarter despite the labour cost target, on the grounds that the lunch trade is too volatile to cut cover. On these numbers that call is paying.
Both funded initiatives are aimed squarely at this and both are working month-on-month:
- Menu engineering programme (Rachel Morrison, £45,000 budget, £18,500 spent, 33% progress) targets COGS % down — COGS fell 40.3 → 39.8 July to August.
- Rota optimisation rollout (Michael Patel, £30,000 budget, £12,000 spent, 33% progress) targets labour cost % down — labour fell 23.5 → 22.1. Canopy confirms it went live at the pilot venue with demand-based templates.
So the levers are moving in the right direction; they just haven't clawed back the year-on-year gap yet. Two departmental objectives sit on this — "Reduce labour cost percentage to below 28%" (Oliver Blackwood) is at risk, and "Improve gross margin to 68% across all venues" (Thomas Williams) is nominally on track at 34% outcome progress but only 16.7% execution progress.
One thing August does not explain. The quarterly EBITDA goal of £950,000 (Thomas Williams and Oliver Blackwood, due 30 Sep) stands at £239,950.11 — that is July £99,888.10 + August £111,351.63 + Sep 1–9 £28,710.38, and it reconciles exactly. With 21 days left and August's best-in-quarter month at £111,351.63, that target cannot be reached. Q3-to-date is 44.3% below the same span of Q2 (£430,770.18), so Q2 ran at roughly £143k/month against Q3's ~£105k. That gap is seasonal or structural and predates August; it is not caused by anything in the August numbers.
- Take the keg and produce increases to the P&L, not just the menu. Rachel Morrison owns COGS % and the menu engineering programme. The decision to re-engineer rather than re-price was made before produce inflation came back at 9% — that's a materially different input than when the call was made, and it's Thomas Williams' and Oliver Blackwood's decision to revisit as EBITDA owners.
- The one check that settles it: whether the draught contract is open to renegotiation or a second supplier. Every venue is on the same contract, so it's a single conversation with a group-wide 6% effect. Nobody in Canopy is recorded as owning that — Rachel Morrison is the right person to open it.
- Unblock the till rollout. The payment provider approval is holding the faster table-ordering flow off the pilot sites. That is a phone call to the provider, not an analysis, and it's the one recorded blocker with no owner attached.
- Reset the £950k quarterly target. It is arithmetically unreachable and it is currently making a company objective read as on-track at 29.3%. Thomas Williams and Oliver Blackwood are Responsible.
- Look again on 1 October, when September closes and gives a clean full-month read on whether the two initiatives keep pulling COGS and labour down.
What would change this conclusion: if the August revenue lift was mostly the King's Head reopening early rather than the Sunday roast relaunch, then the underlying like-for-like trade is flatter than +2.8% and the cost story is worse than it looks. I can't separate those — there's no King's Head metric in the tree; the EBITDA search returned only Canary Wharf, Shoreditch, Liverpool Street and Paddington. That's a measurement gap worth closing.
Two things I can do on your say-so: Canopy has a pointer saying the full autumn menu push context — promo dates and first-wave venues — is in the #marketing channel, and I can pull that thread in. I can also record the "revenue up, EBITDA down year on year, cost-driven" finding against EBITDA so it's there next month. Both need your go-ahead — ingesting reads the whole channel and can adopt the Slack workspace as a context source.
Each surface is judged on whether its answer drew on the business context recorded for this question. The judge saw the answers unlabelled, and saying plainly that the data is not there counts in a surface's favour. The judge's own term and specifics count sit under each answer.
Part of the dbt Semantic Layer integration. One connection for dbt Core, one for dbt Cloud, the same layer above.
The hub page covers what the dbt Semantic Layer is, what KPI Tree adds above it, the benchmark and the security posture. The dbt Cloud page covers the Semantic Layer API path with a service token.
Common questions
Do I need a dbt Cloud account?
No. KPI Tree reads semantic_manifest.json from your dbt Core project and renders the metric SQL itself with an in-process MetricFlow engine, so there is no dbt Cloud account, Semantic Layer API or service token in the path. If you later move to dbt Cloud, the dbt Cloud integration connects through the Semantic Layer API instead.
Which versions of dbt Core and which YAML spec are supported?
dbt Core 1.6 onwards, which is when MetricFlow and the semantic manifest arrived. KPI Tree reads both manifest shapes: the measures-based spec from dbt Core 1.6 to 1.11 and the modernised spec from 1.12 onwards, where simple metrics replace measures. The manifest is what MetricFlow itself reads, so the connection follows your project through the spec migration.
Where does the metric SQL run?
On your own warehouse. A dbt Core connection holds definitions and never executes anything itself. KPI Tree renders each metric as MetricFlow SQL in the dialect of the linked warehouse and runs one aggregation query per metric at day grain. Period comparisons, weekly and monthly rollups, dimension breakdowns and the nightly correlation and causality tests are all computed in KPI Tree’s own in-memory engine from those results.
Which warehouses can a dbt Core connection run on?
Snowflake, BigQuery, Databricks, Redshift and PostgreSQL. The linked connection should point at the database and schema your dbt models build into. Azure SQL and Google Sheets connections cannot be linked to a dbt Core connection.
How do I upload the manifest and keep it current?
Four ways, shown as tabs in the connection wizard: upload the file or a ZIP of the target directory in the browser, post it with curl, run the Python script the wizard provides, or commit the GitHub Actions workflow it generates. The workflow runs dbt build on every push to main and posts the artifacts with an API key scoped to semantic layer uploads. Every upload starts a sync automatically. Artifacts and ZIPs can be up to 50 MB each.
What happens when my dbt project changes?
Each upload is compared with the previous one and the sync report lists what was created, updated, retired and skipped. New metrics appear, edited definitions update in place, and metrics removed from the project or deselected for sync are retired rather than deleted, with their history and recorded context kept. Trees, ownership and action history are preserved. A metric whose name changes in dbt is treated as a new metric.
Which metric types come across?
Simple, ratio, cumulative, derived and conversion metrics, as long as the metric can be queried at day grain. Metrics defined only at weekly or coarser grains are listed as skipped in the sync report rather than guessed at. Every other grain, from week to quarter, is computed by KPI Tree from the daily series.
How does KPI Tree decide whether to sum or take the last value across a week or a month?
It reads the aggregation from the definition first: sum, count, average, min and max map straight from the measure, a ratio or cumulative metric rolls up as its last value, and a non-additive dimension marks a stock that takes its first or last value. Where the definition leaves it open, the metric type and name decide, and the sync report says which rollups were declared and which were inferred. To settle it yourself, add meta.kpi_tree.aggregation to the metric or measure in your YAML and the derivation never overrides it.
Can I choose which metrics and dimensions to sync?
Yes. The Metrics tab lists every metric in the manifest and you choose the dimensions for each one. KPI Tree probes the distinct values of a chosen dimension on your warehouse and creates a child metric per value, so Revenue with a Region dimension gains a node for each region with its own owner and tracking. The default limit is 15 values per dimension, adjustable between 2 and 200 at connection, dimension or metric level, and any dimension above its limit is skipped with the reason shown in the sync report.
What do manifest.json, catalog.json, run_results.json and sources.json add?
manifest.json brings model lineage, so every metric can be traced to the models and sources that produce it, in the app and over MCP. catalog.json adds every warehouse column with its real data type. run_results.json records each model’s last build status and timing and works out how often each metric’s data refreshes. sources.json adds source freshness, so a metric whose upstream source has gone stale says so on the metric itself. Only semantic_manifest.json is required.
Are saved queries, exports, tests or exposures read?
Not at present. KPI Tree syncs the metrics themselves and you choose dimensions per metric, so saved queries are not imported. Exports land as tables in your warehouse, and an export table can be tracked as a SQL metric on the warehouse connection. dbt tests and exposures are not read, and lineage is kept at model level rather than column level.
Does KPI Tree write to my dbt project or my warehouse?
No. The connection reads a manifest and runs SELECT statements with scoped, read-only credentials. Nothing is written back to the project, no jobs are triggered and no models are touched.
Is this the dbt metrics layer?
The dbt Semantic Layer is the successor to the dbt metrics layer. It keeps the idea of metrics defined once in YAML and adds semantic models, entities and MetricFlow, which compiles the SQL. KPI Tree reads the semantic manifest MetricFlow produces, so it works with the current spec rather than the retired metrics package.
Can I combine several dbt projects on one tree?
Yes. Each dbt project is its own connection with its own manifest, and metrics from several projects sit on the same tree with their own calculation sources. The tree carries the drivers, owners, targets and actions across them.
Can dbt metrics share a tree with metrics from other sources?
Yes. Metrics from several dbt projects, from Snowflake Semantic Views or Databricks Unity Catalog, from SQL on a warehouse connection and from spreadsheets all sit on the same tree. Each keeps its own calculation source while the tree carries the drivers, owners, targets and actions across them.
How do AI agents use the dbt connection?
Through Canopy, KPI Tree’s business context layer, over MCP. An assistant such as Claude, ChatGPT, Gemini or Copilot can analyse a metric with its drivers, owners and recorded context, explore the dbt data model behind it, see the last build and source freshness, and, with editor access, run read-only queries on the linked warehouse to test an explanation.
Should I use this or the dbt Cloud integration?
Use this one if you run dbt Core without dbt Cloud, or if you want the SQL to run on your own warehouse with no dbt Cloud usage. If you have a dbt platform plan with the Semantic Layer, the dbt Cloud integration reads your catalogue live through the Semantic Layer API with no uploads.
Related guides. Frameworks and metrics in depth.
dbt semantic layer and metric trees: how they fit together
dbt is the plumbing, the metric tree is the application above it
Semantic layer vs business context layer
A semantic layer settles what a metric is. It cannot settle how metrics drive each other, who owns them, or what happens when one moves.
How to build a metric tree
A step-by-step metric tree and KPI tree template from North Star to daily levers
Related integrations. More sources that work with KPI Tree.
You governed the definition. Now govern the decision.
Connect your dbt Core project and see your own metrics as a causal tree with named owners and verified actions, in a demo on your data.
The guide
dbt semantic layer and metric trees: how the two layers fit together, and where each one stops.
Read the guide



