Skip to content

Semantic layer vs context layer

A semantic layer defines how your metrics are calculated, so every tool computes revenue the same way. A context layer includes the semantic layer and adds what your business means: which definition applies, which rules hold, where each one comes from and who approved it. Most companies have built the semantic layer and stopped there.

Updated October 2026 5 min read

AI & BI tools

CopilotClaudePower BITableau

Context layer

What it means
DefinitionsBusiness rulesData-quality rulesSources & approvals

Semantic layer

How it's calculated
MetricsDimensionsJoins

Your data

SAPSalesforceSnowflake

Documents

PoliciesWikis
Fig. 1The semantic layer sits inside the context layer, which adds the meaning and rules around it.
On this page

What is a semantic layer?

A semantic layer sits between your data and the tools that query it. It gives tables and columns business-friendly names, defines metrics and dimensions once (revenue, margin, region), and specifies how tables join. BI tools and AI assistants query the semantic layer instead of raw tables, so they compute the same number the same way. Examples include Power BI semantic models, dbt's semantic layer, Databricks metric views and Snowflake semantic views.

Fig. 2Define revenue once, and every tool that queries it returns the same number.

What is a context layer?

A context layer contains the semantic layer, plus the business knowledge the semantic layer assumes is already settled:

  • Metric and KPI calculations, and how business terms map to tables and fields in every system (the semantic layer)

    Semantic layer
  • Definitions in plain language, such as what counts as an active customer

  • Business rules, such as “discounts above 10% need a manager's approval” or “intercompany sales are excluded from revenue”

  • Data-quality rules, such as “every supplier needs a valid VAT number”

  • Where each item came from (a policy, a procedure, a system) and who approved it

Key point

Most of what sits outside the semantic layer was never in your data. It lives in procedures, policies, wikis and people's heads.

What does a context layer add?

  • Answers

    Semantic layer

    How do we calculate this?

    Context layer

    How do we calculate it, what does it mean, and which rule applies?

  • Contains

    Semantic layer

    Metrics, dimensions, joins

    Context layer

    The semantic layer, plus definitions, business rules, data-quality rules, sources and approvals

  • Comes from

    Semantic layer

    Your data model

    Context layer

    Your data model, documents, systems, regulations and people

  • Built by

    Semantic layer

    Data engineers and analysts

    Context layer

    Business owners decide; data teams curate

  • Format

    Semantic layer

    Query logic (SQL, YAML, DAX)

    Context layer

    Query logic plus plain-language definitions, linked to data

  • Breaks when

    Semantic layer

    Two tools return different numbers

    Context layer

    AI uses the wrong definition, or data breaks a rule nobody checks

Why does AI need a context layer?

AI finds and reads data through names, descriptions and sample values. When the same customer is KUNNR in SAP, CustomerID in your CRM and client_no in a spreadsheet, it can't tell they're the same thing. When a column called status holds the values 1 to 5, it has to guess what they mean. And it can't see the rules at all, because they live in documents and people's heads.

Fig. 3Without context, three names for one customer look unrelated. With a context layer, they point to one agreed term.

A semantic layer fixes part of this. It tells the AI how to calculate revenue, but it doesn't say that finance excludes intercompany sales, that two subsidiaries count customers differently, or which of two discount rules still applies. The AI then gives an answer that fits everything it could see and is still wrong for your business, and it has no way of knowing.

Does a context layer replace your semantic layer?

It can. The calculation for net revenue and the fields it uses sit inside the context layer, next to the definition the business agreed and the rules that apply to it. Keeping them together means a definition and the metric built on it can't drift apart: when finance changes what counts as net revenue, every metric that depends on it follows. The context layer can run the queries itself, or hand the definitions to the semantic layer and BI tools you already use. Either way, the numbers rest on the agreed definition and on data that follows your rules.

Fig. 4Change the agreed definition once, and every metric built on it follows, wherever the numbers are calculated.

How do you start building a context layer?

  1. 01

    Pick one domain that causes pain, such as customer, supplier or product.

  2. 02

    Collect what already exists: definitions in your systems, procedures, policies and regulations.

  3. 03

    Find where they disagree.

  4. 04

    Have the business owner decide, starting with the definitions behind your most important reports and processes.

  5. 05

    Link each agreed definition to the fields behind it, and check the data against the rules.

  6. 06

    Make the result available to your AI tools and semantic layer, and re-check it when sources change.

Frequently asked questions

Is a context layer the same as a data catalog?
No. A data catalog inventories your data assets and who owns them. A context layer holds what the business means and the rules it runs on, filled from documents as well as data. Many catalogs can store definitions. Building a context layer is the work of finding them, getting them agreed and keeping them current.
Is a context layer the same as a knowledge graph?
A knowledge graph is one way to store a context layer. The context layer is the content itself: agreed definitions and rules, linked to their sources and to your data.
Metagem

How Metagem builds a context layer

Metagem's context layer includes your semantic layer and runs queries on it, so your agents get answers calculated on the definitions the business agreed. It keeps metric and KPI definitions, and their mapping to fields in every system, next to the business definitions and rules they depend on. It reads your documents and data, proposes definitions and rules using a ready-made model, and sends conflicts to the owner who should decide. You can query through Metagem directly, or sync the metric definitions to the BI tools and platforms you already run.

Last updated October 2026.

Keep learning

More from Learn

All guides
  • 5 min read

    Context engineering for enterprise data

    Context engineering is deciding what information an AI model sees before it answers: instructions, retrieved documents, data, tools and memory.

    Read the guide
  • 4 min read

    Active context

    Active context is business context that keeps itself current.

    Read the guide