IntermediateAbout 13 min

    Semantic Layer

    Read the full article on Substack

    7 min read.

    Define a business metric once; a dashboard, a SQL API, and an LLM analyst all read the same governed definition. Change it once and every consumer updates — the source of truth for AI analytics.

    Think of it this way: 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.

    Dashboard
    KPI tile
    $880
    SQL or API
    SELECT net_revenue
    $880
    LLM analyst
    “net revenue?”
    $880
    Semantic layer: the one definition
    net_revenue =
      SUM(orders.amount)
      - SUM(refunds.amount)
    orders
    SUM(amount) = $1000
    SUM(tax) = $80
    refunds
    SUM(amount) = $120
    All three tools show $880: $1000 − $120 refunds.

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    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

    Quiz

    20 questions
    Question 1 of 20
    Score: 0

    What does a semantic layer centralize?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going