Skip to content

feat: MetricFlow semantic layer for financial and economic metrics (#85)#97

Merged
C00ldudeNoonan merged 2 commits into
mainfrom
feat/issue-85-dbt-semantic-layer
Jun 12, 2026
Merged

feat: MetricFlow semantic layer for financial and economic metrics (#85)#97
C00ldudeNoonan merged 2 commits into
mainfrom
feat/issue-85-dbt-semantic-layer

Conversation

@C00ldudeNoonan

Copy link
Copy Markdown
Owner

Summary

  • Adds MetricFlow semantic_models: for 10 dbt models across markets, commodities, government, and signals domains
  • Defines 35 metrics covering equity returns, annualized volatility ratio, CPI/PCE/breakeven inflation gauges, Sahm Rule, job openings tightness, quits rate, and FRED indicator value/MoM change
  • Adds 6 saved_queries: for common agent questions: equity performance ranking, sector rotation, inflation dashboard, labor market dashboard, FRED series scan, commodity overview

Key design decisions

Semantic models map to analysis/signal models (not raw/staging) — these are the final grain-clean, documented models agents should query. Entities use composite string keys (symbol|exchange) to avoid ambiguous primary keys in multi-exchange data.

Metrics focus on what agents ask — trailing returns (1mo, 3mo, 6mo, 1yr), annualized volatility ratio (std/price), inflation momentum spread, Sahm Rule, and labor tightness ratio. All cross-reference FRED literature and Fed policy frameworks.

Saved queries are agent-ready — each query maps to a natural language question an LLM agent would ask (e.g., "which sectors are outperforming?", "is inflation re-accelerating?").

Test plan

  • dbt parse passes once BigQuery adapter is available in CI
  • Run dbt sl list metrics to confirm all 35 metrics are registered
  • Run dbt sl query --metrics cpi_yoy --group-by inflation_month__signal_date to smoke test inflation dashboard
  • Run dbt sl query --metrics sahm_rule_indicator --group-by labor_month__signal_date to smoke test labor dashboard
  • Verify saved queries execute without errors via dbt sl query --saved-query equity_performance_by_symbol

Closes #85

🤖 Generated with Claude Code

C00ldudeNoonan and others added 2 commits June 10, 2026 21:03
#85)

Implements phase 1 of the dbt semantic layer across four domains:

- markets/semantic_models.yml: S&P 500, sector, currency, fixed income daily prices
- commodities/semantic_models.yml: input, energy, and agriculture commodity prices
- government/semantic_models.yml: FRED monthly economic indicators
- signals/semantic_models.yml: inflation (CPI/PCE/breakeven) and labor market signals

metrics.yml defines 35 metrics covering equity returns, volatility, inflation
gauges (CPI YoY, core PCE, breakeven spreads), and labor market indicators
(Sahm Rule, JO/unemployed ratio, quits rate).

saved_queries.yml provides 6 pre-built agent queries for equity performance,
sector rotation, inflation dashboard, labor market dashboard, macro series scan,
and commodity prices.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@C00ldudeNoonan
C00ldudeNoonan merged commit 78aeae3 into main Jun 12, 2026
2 checks passed
@C00ldudeNoonan
C00ldudeNoonan deleted the feat/issue-85-dbt-semantic-layer branch June 12, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement dbt semantic layer with MetricFlow for AI-ready metrics

1 participant