Skip to content
Maestro

Data Modeling for AI Agents

Ask your agent a revenue question and get the number finance gets.

You go at your own pace, with your Maestro beside you, 1:1, through the whole course: ask it anything, and it asks you questions too.

21 skills · 6 modules

$69

Comes with your Maestro, 1:1, for the whole course.

Ask your Maestro something now

What will you be able to do?

Each box is a skill. The base is at the bottom, recognizing and explaining, and you work your way up to building something of your own and judging what works and why.

  1. Evaluate

    • Review a model an agent built against its grain, the business rules, its tests and the evidence for every number it reports

      Where I teach it: Build it with Claude Code · How do you review a model your agent built?

      Builds on:

      • Write dbt data tests (unique, not_null, relationships, accepted_values) and read a failing test as a query that returns the bad rows
      • Detect fan-out when a join repeats an order-level value on every line, and fix it by aggregating to the grain before joining
      • Join a fact to a type 2 dimension on the date of the event, so each row gets the attribute it had then
      • Write a CLAUDE.md that hands an agent a project's layers, business rules and the checks a model must pass

      Your Maestro asks you to judge when it fits and why and saves it as evidence when you do.

  2. Synthesize

    • Plan a modeling task for an agent: what it builds, what you decide, and which checks must pass before you accept it

      Where I teach it: Build it with Claude Code · What do you hand to your agent, and what do you keep?

      Builds on:

      • Decide when an agent should query a governed metric and when it should write SQL against the marts
      • Write a CLAUDE.md that hands an agent a project's layers, business rules and the checks a model must pass

      Your Maestro asks you to build something of your own with it and saves it as evidence when you do.

  3. Analyze

    • Detect fan-out when a join repeats an order-level value on every line, and fix it by aggregating to the grain before joining

      Where I teach it: Grain, facts and dimensions · Why does shipping double when you join orders to order lines?

      Builds on:

      • State the grain of a table in one sentence and check it with a count of distinct keys

      Your Maestro asks you to break a problem down with it and saves it as evidence when you do.

    • Classify measures as additive, semi-additive or non-additive, and compute a ratio from its summed parts

      Where I teach it: Grain, facts and dimensions · Which numbers can you add up, and which can't you?

      Builds on:

      • Build a fact table and its dimensions as a star schema with SQL

      Your Maestro asks you to break a problem down with it and saves it as evidence when you do.

    • Choose between overwriting a changed attribute (type 1) and keeping its history (type 2) from the question the business asks

      Where I teach it: Dimensions that change · When a customer moves, should old orders move with them?

      Builds on:

      • Tell facts (events with measures) from dimensions (the context you group and filter by)

      Your Maestro asks you to break a problem down with it and saves it as evidence when you do.

    • Decide when an agent should query a governed metric and when it should write SQL against the marts

      Where I teach it: The semantic layer · When should your agent query a metric, and when should it write SQL?

      Builds on:

      • Define simple and ratio metrics and their dimensions in a semantic layer
      • Explain why an agent querying raw tables can return a plausible but wrong number: business rules and definitions are not in the data

      Your Maestro asks you to break a problem down with it and saves it as evidence when you do.

  4. Apply

    • State the grain of a table in one sentence and check it with a count of distinct keys

      Where I teach it: Grain, facts and dimensions · What is the grain of a table, and how do you prove it?

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

    • Build a fact table and its dimensions as a star schema with SQL

      Where I teach it: Grain, facts and dimensions · What is a star schema, and why do agents query it better?

      Builds on:

      • Tell facts (events with measures) from dimensions (the context you group and filter by)
      • State the grain of a table in one sentence and check it with a count of distinct keys

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

    • Build a type 2 dimension with valid_from and valid_to from a change log

      Where I teach it: Dimensions that change · How do you build a type 2 dimension from a change log?

      Builds on:

      • Tell facts (events with measures) from dimensions (the context you group and filter by)

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

    • Join a fact to a type 2 dimension on the date of the event, so each row gets the attribute it had then

      Where I teach it: Dimensions that change · How do you join an order to the address it shipped to?

      Builds on:

      • Build a type 2 dimension with valid_from and valid_to from a change log
      • Build a fact table and its dimensions as a star schema with SQL

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

    • Find fact rows whose key has no dimension row and keep them with an unknown member

      Where I teach it: Dimensions that change · Where did the missing $110 go, and how do you keep it?

      Builds on:

      • Build a fact table and its dimensions as a star schema with SQL

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

    • Organize a dbt project into sources, staging and marts connected with ref()

      Where I teach it: ELT and dbt · What is dbt, and what does a dbt project look like?

      Builds on:

      • Explain ETL and ELT and where the transformation logic lives in each
      • Build a fact table and its dimensions as a star schema with SQL

      Your Maestro asks you to use it on a new case and saves it as evidence when you do.

  5. Understand

    • Explain why an agent querying raw tables can return a plausible but wrong number: business rules and definitions are not in the data

      Where I teach it: Why your agent needs a model · Why does your agent's revenue number differ from finance's?

      Your Maestro asks you to explain it in your own words and saves it as evidence when you do.

    • Describe the layers between raw data and an agent (raw, staging, marts, semantic layer) and what each one is for

      Where I teach it: Why your agent needs a model · Where should a business rule live: raw, staging, marts or metrics?

      Builds on:

      • Explain why an agent querying raw tables can return a plausible but wrong number: business rules and definitions are not in the data

      Your Maestro asks you to explain it in your own words and saves it as evidence when you do.

    • Tell facts (events with measures) from dimensions (the context you group and filter by)

      Where I teach it: Grain, facts and dimensions · What is a star schema, and why do agents query it better?

      Your Maestro asks you to explain it in your own words and saves it as evidence when you do.

    • Explain ETL and ELT and where the transformation logic lives in each

      Where I teach it: ELT and dbt · ETL or ELT: where should the transformations run?

      Builds on:

      • Describe the layers between raw data and an agent (raw, staging, marts, semantic layer) and what each one is for

      Your Maestro asks you to explain it in your own words and saves it as evidence when you do.

    • Explain a semantic layer: entities, dimensions and metrics defined once and compiled to SQL for every tool and agent

      Where I teach it: The semantic layer · What is a semantic layer, and why do agents need one?

      Builds on:

      • Describe the layers between raw data and an agent (raw, staging, marts, semantic layer) and what each one is for
      • Tell facts (events with measures) from dimensions (the context you group and filter by)

      Your Maestro asks you to explain it in your own words and saves it as evidence when you do.

Who is this course for?

Analysts and analytics engineers who already write SQL (joins, GROUP BY, CTEs, window functions) and use Claude Code or another coding agent on their warehouse.

Ask your Maestro

Your Maestro is an AI that knows each course, page by page. Try it here free, in the free course "A Dashboard People Actually Use (and How to Ask Your AI for One)".

Example

You: Where do I start?

Your Maestro: From what you already know. Tell me what you've done with data, and I'll start this page from there.

Asking about: Answers from the page "How do you define a KPI? Write its definition sheet"

Only this browser keeps what you ask here. How it works

What we'll cover

  1. Why your agent needs a model

    1. Why does your agent's revenue number differ from finance's?
    2. What couldn't the agent know from the raw tables?
    3. Where should a business rule live: raw, staging, marts or metrics?
  2. Grain, facts and dimensions

    1. What is the grain of a table, and how do you prove it?
    2. Why does shipping double when you join orders to order lines?
    3. What is a star schema, and why do agents query it better?
    4. Which numbers can you add up, and which can't you?
  3. Dimensions that change

    1. When a customer moves, should old orders move with them?
    2. How do you build a type 2 dimension from a change log?
    3. How do you join an order to the address it shipped to?
    4. Where did the missing $110 go, and how do you keep it?
  4. ELT and dbt

    1. ETL or ELT: where should the transformations run?
    2. What is dbt, and what does a dbt project look like?
    3. How do dbt tests work, and which ones should every model have?
    4. What should a model's description tell an agent?
  5. The semantic layer

    1. What is a semantic layer, and why do agents need one?
    2. How do you define a metric so every agent computes it the same way?
    3. When should your agent query a metric, and when should it write SQL?
  6. Build it with Claude Code

    1. What goes in the CLAUDE.md for a dbt project?
    2. How do you review a model your agent built?
    3. What do you hand to your agent, and what do you keep?

How long does it take?

5 to 7 hours

A guide: you go at your own pace, and the course waits where you left off.

Common questions

Do I need to install dbt or Claude Code?
No. Every exercise runs in your browser: SQL in DuckDB, and a small semantic layer in a terminal on the page. The last module shows how to do the same work with dbt and Claude Code on your own warehouse, if you have them.
How much SQL do I need?
You should be comfortable with joins, GROUP BY, CTEs and window functions such as LEAD. The course teaches modeling, not SQL syntax.
Which version of dbt does it use?
dbt v2, the current version, and the latest semantic layer YAML spec. The project you read in the course was built and tested with dbt 2.0.9 and validated with MetricFlow.
Is the data real?
It's a made-up US coffee roaster, Ridgeline Coffee Roasters, with online and wholesale orders. The problems in it are the ones real company data has: header values that fan out, test accounts, customers who move, refunds in their own table, and products deleted from the catalog.

What you get

  • 6 modules and 21 pages, open whenever you want them.
  • Your Maestro for the whole course, who always knows which page you're on: you open it from there.

  • It works from this course's skills, the ones above.

  • Ask it how you're doing, and it tells you what you've already shown and what comes next.

Who's teaching you

Sergio Sánchez

I'm Sergio, chekos online. I'm a data architect, and I've spent more than ten years working with data in the Bay Area, mostly at mission-driven organizations: policy research first, then education, and now early childhood services. I grew up in Tijuana. In 2018 I started tacosdedatos to share what I was learning, and since then it's been a blog, a podcast, courses, guides, and a community. These days I spend a lot of my time building with AI agents and writing about how I organize my work around them. I share what I've learned; you take what's useful and make it yours.

See you in the course

Data Modeling for AI Agents