Skip to content
    Semantic layer vs ontology: a metrics file with two active customer definitions, each with an owner and a why. Knowledge layer for data agents.

    What a Knowledge Layer for Data Agents Actually Needs (and When a Semantic Layer Is Overkill)

    November 30, 2026
    9 min read
    0 views
    Semantic layer
    Ontology
    Knowledge layer
    Data agents

    Semantic layer vs ontology for a data agent. A metrics layer calculates the number. A knowledge layer adds the owner and the why.


    TL;DR

    A semantic layer tells a data agent how to calculate a number. An ontology maps the things those numbers are about. That is the semantic layer vs ontology split.

    What the agent still misses is the why. Who owns the definition. Why it was written that way. Which rows it must leave out.

    Without that, a correct formula still produces a confident wrong answer. I have watched the SQL come out clean and the edge case still get blown, because the definition had no owner and no reason.

    On this page:


    Access is not understanding

    Giving an AI agent a warehouse login is not the same as helping it understand the data.

    A glossary of metric names is not a knowledge layer either. The agent can see the word. It still does not know which meaning you meant, or which rows to throw out.

    Data agent accuracy usually fails on something boring. A missing definition. A test account nobody excluded. Two teams counting the same word differently. The model is rarely what fails.

    On a reference run I published in Data Factory, the visible checks passed on the first build. I am quoting the README I checked on 25 November 2026, not a client's books. Hidden checks still caught 1,132 duplicated invoices that overstated revenue by 46%, and 3 internal test accounts that made a drop look 76% bigger and blamed the wrong customers. One rework loop later, every number matched finance, to the dollar.

    Access got the agent to the rows. It did not tell the agent which rows were lies.

    Semantic layer vs ontology

    People use these names as if they were one product. They are three jobs. Vendors do not draw the lines in the same place. The links below are each vendor's own docs, checked 25 November 2026.

    A semantic layer for AI and LLMs

    A semantic layer for AI agents, including a semantic layer for LLMs, answers one question: how do we calculate this number the same way every time?

    That is a metrics layer. The agent stops inventing a new formula in the same breath as the answer.

    dbt Semantic Layer, powered by MetricFlow, is dbt Labs' version. The docs say you define metrics in the dbt project, and a change there refreshes everywhere the metric is invoked. You need a dbt Starter or Enterprise-tier account to define and query them. The same page says Claude (Anthropic) and ChatGPT (OpenAI) can connect through the dbt MCP server, so the answer uses the governed metric instead of guessing at raw tables.

    Snowflake Semantic Views are a schema-level object. You model entities, relationships, facts, dimensions, and metrics, and you can query the view. Snowflake's Business Ontology page calls Semantic Views the executable metric layer for a domain.

    An ontology

    An ontology answers: what are the things in the business, and how do they relate?

    The Palantir Ontology in Palantir Foundry is an operational layer on top of the datasets in the platform. The semantic elements are object types, properties, and link types. The kinetic elements are action types and functions. I am not calling that a semantic layer. That page does not call it one either.

    Snowflake Business Ontology is the governed meaning layer in Horizon Catalog. The docs say it complements Semantic Views and Cortex Sense. It does not replace either of them. You get a glossary plus typed concepts: term, metric, entity, dimension, and policy, with ownership and an approval state. Only approved nodes are served.

    Support for Business Ontology is currently not in production and is available only to selected accounts. The considerations section calls that a private preview, and says it is not listed in the public documentation navigation.

    Databricks calls the product Genie, the AI experience for users, and still uses the name AI/BI for dashboards inside it. Genie Ontology is the unified context layer for Genie One and Genie Code. Modeled knowledge is what you define and certify: Unity Catalog metric views, domains, Pages, and certification. Those metric-view docs call that the core of Unity Catalog semantics: define the metric once, and the query engine groups it at runtime. Learned knowledge is snippets Genie pulls from assets you already have, and Genie treats the modeled kind as more authoritative when they conflict. Other agents can read it through the Genie One MCP server, with Unity Catalog permissions.

    A knowledge layer, or context layer for AI agents

    A knowledge layer for AI agents is the context layer I want queried. Which definition applies to this question? Who approved it? What should be excluded, and why?

    People also search semantic layer vs context layer. A semantic layer can make two tools share one formula. A context layer picks which formula, and which rows, belong to the question in front of the agent.

    The Model Context Protocol (MCP) is an open-source standard for connecting an AI application to external systems. It is not a metric layer. The Genie One MCP server is Databricks' implementation. The dbt MCP server is dbt Labs'. Neither knows what "active customer" means until you write it down.

    LayerQuestion it answersUnit of workWhat still breaks
    Semantic layerHow do we calculate this number the same way every time?A metric and its formulaTwo valid formulas. The agent will not know which question you asked.
    OntologyWhat are the things, and how do they relate?An entity, a link, an approved definitionYou can name the thing and still compute it two ways.
    Knowledge layerWhich definition applies here, who owns it, and why?A metric card with an owner and a short whyA stale card. Someone still has to keep it true.

    Snowflake, dbt Labs, Databricks, and Palantir do not use these three labels the same way. The rows are the jobs. The labels overlap.

    The longer split of data context, business context, and usage context is in The 3 Context Layers for Accurate AI Analytics. The build steps are in How to Implement Context Layers. How much of that context fits in one session is in Mastering the Context Window. I am not redoing those here.

    The formula is not the why

    A formula tells the agent how to count. It does not tell the agent when to refuse.

    Two teams can both be right about "active customer." RevOps counts customers with a completed order. Marketing counts logins. Collapse those into one metric and you erase a real disagreement. The agent then ships one number and sounds sure.

    Keep both definitions visible. Each one needs a department, a checked SQL reference, an owner, and a short why, including what to exclude.

    RevOps counts completed orders, because a login is not a purchase. Marketing counts logins, because they are measuring who showed up. Both exclude internal test accounts.

    The model will not book the meeting where those two teams disagree. You still have to. Until someone does, the agent picks one card and calls it the business.

    Do you need a semantic layer?

    Sometimes a semantic layer is overkill. Five files in a repo get you most of the way, this week, with no platform project.

    1. A table ID card for every table the agent touches. What a row means. Which fields answer the question. What to leave out: test accounts, historical columns, staging tables.
    2. A metrics file. Metric, department, definition, a checked SQL reference, an owner, and a short why, including what to exclude.
    3. A bank of verified queries. Questions you already trust, with the SQL saved next to them.
    4. A short note on how the data flows and where it lies. Which table is late. Which column looks live and is not.
    5. An access boundary. What the agent may touch, and what it may not.

    Here is the shape of one metrics entry. It is a file, not a vendor feature.

    metric: active_customer
    department: RevOps
    definition: A customer with a completed order.
    sql: orders where status = completed
    owner: RevOps lead
    why: A login is not a purchase. Exclude internal test accounts.
    

    Write the Marketing entry beside it. Do not merge them to make the file look clean.

    A public playbook you can point at those files is Data Analytics Skills (repo). When I checked the GitHub API on 25 November 2026, the repo had 557 stars and 93 forks. The skills do not replace the five files. How skills, MCP, and agents stack is in Skills vs MCP vs Agents for Data Teams.

    Start here. Do not wait for a platform rollout to write down what "active customer" means.

    When you need more than files

    A semantic layer starts to earn its keep when more than one tool has to return the same metric. A YAML file in one repo does not help the BI tool, the spreadsheet, and the agent if each compiles its own SQL. That is the job of Snowflake Semantic Views and the dbt Semantic Layer.

    An ontology starts to earn its keep when the same real thing has different names in different systems. Account in the warehouse. Company in the CRM. Customer in billing. A file can list the aliases. It gets brittle once many owners have to agree, and the agent has to follow the link before it computes.

    Snowflake's docs draw this split cleanly. I am using it as a worked example, not a product review.

    • Semantic Views stay the executable metric layer for a domain.
    • Business Ontology is the steward-approved meaning layer. It carries ownership and approval, and it points at the Semantic View that implements a definition. It complements Semantic Views and Cortex Sense. It does not replace them.
    • Cortex Sense is the AI-derived context layer for data that is not fully modeled. The page title says Private Preview. The banner says support is currently not in production and is available only to selected accounts. Same banner as Business Ontology.

    A Cortex Agent can use approved Business Ontology content. The docs say it finds the approved node, reads the Semantic View bound to it, and queries that view. That page is also a private preview, with the same not-in-production banner, and it is available only to selected accounts.

    On Databricks the same fork is Genie Ontology plus Unity Catalog metric views. If you only let Genie learn from old queries, a popular wrong snippet can outrank the definition you meant. You still have to write it.

    This is a judgment call, not a maturity badge. Files are the right stack until two tools, or two names for one thing, force your hand.

    The setup that puts a written metric in front of a query, then checks the number, is the one I use in How to Use Claude for Data Analysis. The difference between a chatbot and a data agent is in Data Agents for Analytics Teams.

    How I build the layer

    On a production AI system I built for a growing company, the first answer did not come in week one.

    Weeks of knowledge work came first. In discovery we mapped what people actually do, what data they use, the gray areas, and where the agent needs a tight leash. Out of that came a company brain, the working procedures, the gaps where data was missing, and the semantic layer.

    Maintenance hooks keep the cards fresh. If a definition changes and the card does not, the agent is back to guessing, only now with a file that looks official. A stale card is worse than no card, because the agent trusts it.

    3 things to do tomorrow

    1. Pick your five most-used metrics. Write each as a YAML entry: metric, department, definition, a checked SQL reference, an owner, and a short why, including what to exclude. If two teams disagree, keep both entries.
    2. Write a table ID card for every table those metrics read. What a row means. Which fields answer the question. What to leave out, including test accounts and historical columns.
    3. Have a person approve those definitions before the agent queries them. Tomorrow, ask the agent a question it usually gets wrong and see whether the why changes the answer.

    If you want to talk through your setup, grab 30 minutes: https://calendar.app.google/BPzZ7yuQicry4u7B7

    Questions people ask

    What is the difference between a semantic layer and an ontology?

    A semantic layer tells a data agent how to calculate a number the same way every time. An ontology maps the things those numbers are about, and how they relate. Vendors do not use the words the same way. I am following each vendor's own docs.

    Do I need a semantic layer?

    Not on day one. Five files in a repo get you most of the way. A semantic layer starts to earn its keep when more than one tool has to return the same metric.

    What is a knowledge layer or a context layer for AI agents?

    It is the layer the agent should query: which definition applies to this question, who owns it, what to exclude, and why. A semantic layer can share one formula. It does not pick which formula the question meant.

    What does a metrics layer change about text-to-SQL accuracy?

    A metrics layer keeps the calculation stable. Text-to-SQL accuracy still fails when the definition has no owner and no why. The SQL can be valid and the number still wrong.

    What belongs on an active customer definition?

    The metric, the department, the definition, a checked SQL reference, an owner, and a short why, including what to exclude. If one team counts completed orders and another counts logins, keep both.