answering-natural-language-questions-with-dbt

Answer data questions by querying dbt's semantic layer or ad-hoc SQL.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/randoneering/nix-flake-mirror --skill answering-natural-language-questions-with-dbt-randoneering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: answering-natural-language-questions-with-dbt
Source: https://github.com/randoneering/nix-flake-mirror/tree/main/home/programs/opencode/skills/dbt/answering-natural-language-questions-with-dbt
Command: npx skills add https://github.com/randoneering/nix-flake-mirror --skill answering-natural-language-questions-with-dbt-randoneering

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writes and executes SQL queries against the data warehouse using dbt's Semantic Layer or ad-hoc SQL to answer business questions. Use when a user asks about analytics, metrics, KPIs, or data (e.g., "What were total sales last quarter?", "Show me top customers by revenue"). NOT for validating, testing, or building dbt models during development.

Core Features & Use Cases

  • Semantic-layer-driven question answering prioritizes existing marts and models to retrieve metrics and dimensions.
  • Fall back to ad-hoc SQL or compiled SQL when semantic layer coverage is incomplete.
  • Supports common analytics questions: revenue by region, top customers, quarterly trends, and KPI calculations.

Quick Start

Ask a business question like "What were total sales last quarter?" and the system will use the dbt semantic layer or SQL to provide an answer.

Frequently Asked Questions about answering-natural-language-questions-with-dbt

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I answer business questions using dbt's semantic layer?

To answer business questions with dbt's semantic layer, query existing metrics and dimensions to retrieve direct insights from your data warehouse. The system prioritizes the semantic layer for analytics requests like total sales or customer counts.

How do I query data warehouse metrics when the dbt semantic layer coverage is incomplete?

Query data warehouse metrics by falling back to ad-hoc SQL or compiled SQL when semantic layer coverage is incomplete. The system automatically transitions from semantic layer queries to compiled SQL to generate executable queries for missing metrics.

Can I use dbt to analyze KPIs and ad-hoc data inquiries like regional performance?

Yes, you can use dbt to analyze KPIs and ad-hoc data inquiries such as regional performance or quarterly trends. The system answers analytics questions by querying marts and models directly from the data warehouse.

What is the best way to get direct insights from a data warehouse using dbt?

The best way to get direct insights using dbt is applying a decision flow that prioritizes the semantic layer, then compiled SQL, model discovery, and manifest analysis. This approach ensures executable queries retrieve accurate analytics.

When should I not use dbt semantic layer queries for analytics?

You should not use dbt semantic layer queries for validating, testing, or building dbt models during development. This approach is strictly designed for answering analytics, metrics, KPIs, and data inquiries from existing data warehouse models.