Meta Context Schema
A practical framework for encoding business knowledge directly in dbt semantic layer YAML. Five layers, 36 fields, three tiers. Your semantic layer tells the LLM how to query. Meta context tells it how to think about what comes back.
The empty row in the data stack
There’s no shortage of articles about why we need a “context layer.” The trillion-dollar platform opportunity. Context graphs. AI needs business context. Everyone agrees the layer is missing. Nobody has published a practical framework for filling it in.
| Layer | System of Record | Solved By |
|---|---|---|
| Storage | The warehouse | Snowflake, BigQuery, Redshift |
| Logic | Transformations + metrics | dbt, MetricFlow |
| Intelligence | ??? | ??? |
The intelligence — what analysts actually get paid to produce — has no system of record. It lives in Slack threads, Confluence pages, onboarding sessions, and the heads of people who might leave next quarter. LLMs are the first consumer that can use structured interpretive knowledge programmatically. This schema gives them what they need.
Your semantic layer tells the LLM how to query. Meta context tells it how to think about what comes back.
# Layer 1: Context
meta:
context:
purpose: ""
business_question: ""
owner: ""
# Layer 2: Expectations
expectations:
healthy_range: [min, max]
warning_threshold: null
critical_threshold: null
seasonality: ""
# Layer 3: Investigation
investigation:
causal_dimensions:
- name: ""
why: ""
priority: 1
investigation_path: ""
# Layer 4: Relationships
relationships:
correlates_with:
- metric: ""
relationship: ""
affected_by:
- event: ""
impact: ""
# Layer 5: Decisions
decisions:
when_this_drops:
- threshold: null
action: ""
business_rules:
- ""
last_validated: ""
schema_version: "1.0"
meta: property — dbt preserves
it all the way through to the compiled manifest. Zero new tooling. Zero new dependencies."meta": {
"context": {
"purpose": "Measures the share of OCT disbursement transactions
that are declined by the receiving bank or processor.",
"business_question": "Are OCT disbursements being rejected at an
abnormal rate, and if so, by which failure reason?",
"owner": "Analytics Team"
},
"expectations": {
"healthy_range": [0.02, 0.08],
"warning_threshold": 0.10,
"seasonality": "No strong seasonal pattern. Decline rates are
processor-dependent, not calendar-driven."
},
"investigation": {
"causal_dimensions": [
{
"name": "program_code",
"why": "Different BaaS programs have different decline profiles.
A spike in one program does not indicate system-wide failure.",
"priority": 1
},
{
"name": "global_fund_transfer_status_reason",
"why": "Status reason codes distinguish BIN ineligibility from
limit exceeded from issuer decline — different root causes.",
"priority": 2
}
]
}
}
From manifest.json after dbt parse — OCT decline rate metric, disbursements pipeline.
meta: block.I'm enriching the dbt semantic layer metric [metric_name] with structured
business context. Extract the following from the attached documents into YAML:
Layer 1 — Context:
purpose: What does this metric measure? Scope-bounded.
business_question: What decision does this inform?
owner: Who's responsible?
Layer 2 — Expectations:
healthy_range: Normal operating range (empirical, not guessed).
warning_threshold / critical_threshold: Attention vs escalation values.
seasonality: Time patterns with magnitude ("Q4 +20-30%", not "higher in Q4").
Layer 3 — Investigation:
causal_dimensions: Which dimensions explain variance? {name, why, priority}
investigation_path: Conditional tree — "IF system-wide, check X. IF single segment, check Y."
Layer 4 — Relationships:
correlates_with: What moves with this? Type the relationship (inverse, leading indicator).
affected_by: External events with impact magnitude.
Layer 5 — Decisions:
when_this_drops: Action at each threshold.
business_rules: SLAs/policies. If none, state "No formal SLA documented."
Output valid YAML starting at the "meta:" key. Only include fields where
the docs provide evidence — leave others out rather than guessing.
dbt parsemeta: block under your metric definition. The placement is simple
— it’s a sibling of type:, label:, etc. dbt preserves it as-is without
parsing the contents.# Placement — meta: is a sibling of type/label on the metric:
metrics:
- name: my_metric
type: simple
label: My Metric
agg: sum
expr: my_column
meta: # <-- add here
context:
purpose: "..."
business_question: "..."
owner: "..."
expectations:
healthy_range: [0.90, 0.99]
warning_threshold: 0.88
seasonality: "..."
investigation:
causal_dimensions:
- name: segment
why: "..."
priority: 1
decisions:
when_this_drops:
- threshold: 0.88
action: "..."
business_rules:
- "..."
That’s it. Run dbt parse to verify YAML validity. The nested structure is preserved all the
way through compilation into the manifest and is accessible via the Semantic Layer API.