AI-ENGINEERING
    intermediate

    Semantic Layer

    AI Engineer path · lesson 68 of 124
    The idea
    The semantic layer is the official recipe card for 'Net Revenue'. The dashboard chef, the SQL chef, and the AI chef all cook from the same card — change the card and every kitchen serves the new dish.
    How to use
    Edit the metric definition and watch every downstream query and chart update to match.
    BI Dashboard
    KPI tile
    $880
    SQL / API
    SELECT net_revenue
    $880
    LLM analyst
    “net revenue?”
    $880
    Semantic Layer — governed metric
    Net Revenue =
      SUM(orders.amount)
      - SUM(refunds.amount)
    orders
    SUM(amount)=$1,000
    SUM(tax)=$80
    refunds
    SUM(amount)=$120

    Key insight

    Toggle the definition once and the dashboard, SQL API, and LLM analyst all change together — one governed definition, zero drift. Raw tables flow up through the layer; consumers never touch them directly.

    Where the semantic layer sits

    Schematic

    Fill in the missing stages between the warehouse and the answer.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    "What was revenue?"

    one shared definition
    generated, not hand-written

    Warehouse tables

    same for every consumer
    3 pieces left to place

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    What does a semantic layer centralize?

    The short version

    The semantic layer is the official recipe card for "Net Revenue". The dashboard chef, the SQL chef, and the AI chef all cook from the same card — change the card and every kitchen serves the new dish.

    Interview Questions

    Snowflake
    dbt Labs
    Google
    dbt Labs
    Snowflake
    dbt Labs
    Cube
    Snowflake
    dbt Labs
    Databricks
    Perplexity

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required