Context Engineering — Databricks · Snowflake · Microsoft Fabric · Nov 2026

Concepts
Databricks
Snowflake
Microsoft Fabric
Semantic Layer vs Context Layer — A Critical Distinction

An emerging and increasingly well-grounded distinction: the semantic layer and the context layer are not the same thing. Both derive from a shared ontology, but they serve different consumers and encode different kinds of knowledge. The context layer is the superset — it wraps and enriches the semantic layer with operational intelligence that only AI agents need.

Ontology Shared conceptual model Context Layer for AI agents ▸ Governance rules ▸ Decision precedents ▸ Lineage & ownership ▸ For AI autonomy ▸ Delivers via MCP, APIs, context graphs + contains Semantic Layer definitions Semantic Layer for human analysts (+ agents) ▸ Metric definitions ▸ Business glossary ▸ Dimension relationships ▸ For BI consistency ▸ Delivers via SQL, BI tools, MCP dbt MetricFlow · LookML · Semantic Views Primary: human analysts Primary: AI agents (via MCP, context graphs)
Dimension Semantic Layer Context Layer
Primary consumer Human analysts via SQL & BI tools AI agents via MCP, APIs, context graphs
Core question answered "What does this metric mean?" "How, when, and under what rules can an agent use it?"
Contains Metric defs, dimensions, business glossary, relationships, certified sources Governance rules, decision precedents, lineage, ownership, compliance constraints, temporal validity
Relationship Component inside the context layer Superset — wraps and enriches the semantic layer with operational intelligence
Delivery mechanism SQL, LookML, dbt MetricFlow, YAML semantic models MCP servers, Genie Pages, context graphs, vector + graph retrieval
Blurring boundary dbt MetricFlow, Snowflake Semantic Views now explicitly serve AI agents too Snowflake engineering blog (Nov 2025): "internal context layer for AI agents"
Platform examples dbt Semantic Layer · Looker LookML · Snowflake Semantic Views · Power BI semantic model Databricks Genie Ontology · Snowflake Cortex Context · Atlan Context Layer · Neo4j Context Graph
Caveat: "Context layer" is not yet a vendor product category — it is an architectural concept gaining traction. Databricks calls theirs "Genie Ontology / Enterprise Context." Snowflake calls it "Cortex Context." The term is used more by catalog/governance vendors (Atlan, Alation, Collibra) than by the lakehouse platforms themselves. The semantic layer boundary is blurring fast as metric definitions become agent-facing too.

The Architecture — From Semantic Layer to Context Graph

The two layers don't sit side by side — they form a progressive architecture. Taxonomy and semantic definitions flow into an ontology (schema layer) and a knowledge graph (instance layer), from which a context graph is derived at query time for the agent's specific decision.

Taxonomy is-a hierarchy Semantic Layer analytical definitions Ontology Schema Layer · TBox Knowledge Graph Instance Layer · ABox derives Context Graph decision-specific slice derived for agent reasoning Neo4j · IBM · Thoughtworks dynamic · task-scoped · not the full KG TBox = types & rules · ABox = facts about individuals
Component What it is OWL term Examples
Taxonomy Named class hierarchy and synonyms. "LR" = "Loss Ratio". Informs ontology structure. SKOS Business glossary, subject-area tree
Semantic Layer Analytical definitions — metric expressions, dimension relationships, certified sources. Feeds both ontology and KG. — dbt MetricFlow, LookML, Snowflake Semantic Views, Power BI semantic model
Ontology (Schema Layer) Class definitions, properties, inference rules — the vocabulary and logic of the domain. TBox OWL 2, SHACL, Genie Ontology schema
Knowledge Graph (Instance Layer) Actual entity instances, relationships, facts — the populated store conforming to the ontology schema. ABox Neo4j, Stardog, Databricks Unity Catalog graph, Atlan graph
Context Graph A decision-specific slice of the KG retrieved dynamically for a single agent query. Temporal edges, superseded facts invalidated. Not the full graph. Derived Thoughtworks Tech Radar · Neo4j Context Graph · IBM · Microsoft GraphRAG
The chain: Taxonomy + Semantic Layer → build Ontology (schema) + populate Knowledge Graph (instances) → retrieve a Context Graph (task-scoped slice) for each agent decision. This is the architecture Neo4j, IBM, and Thoughtworks describe for agentic AI systems. Databricks Genie Ontology and Snowflake Cortex Context are both implementations of this pattern.

The 5-Layer Context Stack

Context engineering operates across five layers. Each layer adds structure that narrows the solution space for the model — reducing the chance of a plausible-but-wrong answer.

0
Raw Storage
Tables, columns, raw values. No business meaning. The model guesses based on column names. Accuracy floor.
Parquet / Delta
1
Taxonomy
Named classes and synonyms. "LR" = "Loss Ratio" = "loss_ratio_pct". Reduces naming mismatch errors. Informs ontology structure.
SKOS
2
Semantic Layer
Named measures with SQL expressions, dimensions, relationships, certified sources. The agent reads definitions instead of guessing SQL. Serves BI analysts and AI agents. Feeds the ontology (TBox) and knowledge graph (ABox).
YAML / LookML
3
Ontology + Knowledge Graph
Ontology = Schema Layer (TBox): class hierarchy, properties, inference rules — OWL 2. Knowledge Graph = Instance Layer (ABox): entity facts conforming to that schema. Together they power rule-based reasoning and graph traversal.
OWL 2 / RDF
4
Context Graph
A decision-specific slice derived from the KG for the agent's current task. Dynamic, task-scoped, temporally valid. Agent instructions, governed defaults, Genie Pages, Cortex verified queries. Highest leverage per token of context window.
Context Graph
Why Context Beats More Model
The 10.6% → 52.1% proof
Databricks Genie on insurance data. Same LLM. Same data. Adding Genie Pages (Rung 5: governed default "long-tail lines → use ultimate_lr") moved accuracy from 10.6% to 52.1%. No model fine-tuning. No new data. Context alone.
Snowflake +86.3%
Cortex Analyst with a semantic model YAML vs without. The semantic model encodes which columns are measures vs dimensions, their business names, relationships, and verified example queries. The model stops guessing joins and aggregations.
Model upgrades are free
A well-engineered context layer is model-agnostic. When GPT-4o → o3 or Sonnet → Opus, the semantic definitions stay correct. Teams that invested in prompt engineering have to re-tune. Teams that invested in context engineering get the upgrade for free.
Latency budget
Context engineering reduces context window size. A compact, governed semantic model (500 tokens of YAML definitions) outperforms a 10,000-token few-shot prompt that describes the same schema in prose. Smaller context = faster, cheaper inference.
Platform Comparison — Semantic Context Layer
Databricks Genie
Format: YAML metric views in Unity Catalog
Governed defaults: Genie Pages — set rules like "long-tail → ultimate_lr"
Agent instructions: NEVER use paid_lr for profitability
Benchmark suite: 30 trap questions (Rung 8)
Accuracy: 10.6% → 52.1% (insurance)
Status: Public Preview Sep 2026
Snowflake Cortex
Format: YAML semantic model (tables, measures, dimensions, verified_queries)
Governed defaults: verified_queries block — curated Q&A pairs
Agent instructions: filter_relationships and expr fields enforce business rules
Benchmark suite: Cortex Analyst evaluation suite
Accuracy: +86.3% task success with semantic model
Status: GA
Microsoft Fabric
Format: Power BI semantic model (measures, relationships, RLS)
Governed defaults: Default measure labels and descriptions in semantic model
Agent instructions: Q&A synonyms, Copilot annotations
Benchmark suite: No published standard benchmark
Accuracy: No published lift figure
Status: GA (Copilot) · Preview (IQ Ontology)
The practitioner rule: build the semantic layer first (metric definitions, dimensions, business glossary) — it delivers accuracy gains fine-tuning costs weeks to match, and it survives the next model generation. Then extend it into a context layer: add governance rules, decision precedents, lineage, and temporal validity. That extension is what turns a BI-serving semantic layer into an AI-ready context layer.
Sources
● Databricks Genie Ontology
52.1%
Accuracy with Genie Pages (Rung 5)
Up from 10.6% on the same model and data. Same LLM · same Delta tables · governed context added. Source: Viral M Desai insurance implementation.
Genie Ontology informs Genie Ontology Enterprise Context Business Meaning · Relationships · Rules Unified context layer fed to all Genie agents authoritative context inferred context Modeled Knowledge Governed & Authoritative Metric Views · Genie Pages Domains · Certifications Learned Knowledge From Existing Assets Query History · SQL Snippets Dashboards · dbt · Authority Scores governed definitions usage patterns Unity Catalog Semantics · Governance · Access The governed foundation — owned by Data Engineering & Governance teams source assets mined from your data estate Dashboards </> SQL Queries Notebooks ⚡ Genie Agents Other Assets Modeled = governed by humans · Learned = auto-inferred from usage · Together = Genie Ontology Source: Databricks Genie Ontology — Practical Guide (Vipul Choudhary · linkedin.com/pulse)
Unity Catalog as the Context Store

Unity Catalog is Databricks' governed metadata layer — not just a table registry but the context store that feeds Genie agents. Every object has a certified owner, a lineage graph, and machine-readable definitions. The 9-rung ladder lives entirely inside Unity Catalog: each rung adds a new type of governed context without touching the underlying Delta tables.

RungContext type addedAccuracyUC object
0None — raw table10.6%Delta table
1Column comments + PK/FK joins10.8%Column metadata
2Metric views: paid / incurred / ultimate LR28.5%Metric View
3Synonyms & display names28.5%Display names
4Domains & subdomains28.5%UC Domain
5Genie Pages — governed default: long-tail → ultimate LR52.1% ▲Genie Page
6Certify source + deprecate legacy table52.1% repeatableCertification tag
7Agent instructions: NEVER use paid_lr for profitabilityFollow-ups correctAgent instruction
8Benchmark suite (30 trap questions)52.1% provableGenie Benchmark
Metric View YAML — The Semantic Layer Definition

A metric view is a YAML file checked into version control and registered in Unity Catalog. It is the canonical definition of every named measure the agent can use. No bare column access — agents reference measures by name.

Unity Catalog · Metric View YAML · v1.1
version: 1.1
source: catalog.schema.gld_fact_underwriting_result_monthly

measures:
  - name: paid_lr
    expr: SUM(source.ay_paid_loss) / NULLIF(SUM(source.earned_premium), 0)
    display_name: 'Paid Loss Ratio'
  - name: incurred_lr
    expr: SUM(source.ay_case_incurred) / NULLIF(SUM(source.earned_premium), 0)
    display_name: 'Case-Incurred Loss Ratio'
  - name: ultimate_lr
    expr: SUM(source.ay_ultimate_loss) / NULLIF(SUM(source.earned_premium), 0)
    display_name: 'Ultimate Loss Ratio'

# Deliberately NO bare 'loss_ratio' — forces variant selection
# Genie Page (Rung 5) sets: long-tail lines → MEASURE(ultimate_lr)
Genie Pages — Governed Defaults

A Genie Page is the highest-leverage context object in Databricks. It encodes a governed default: a rule that resolves ambiguity before the LLM sees the question. The page does not change the model — it changes what the model is allowed to assume.

Default measure rules
Set which measure variant to use for a given context. "When line_of_business IN ('WC','GL','Med Mal') → use ultimate_lr". The LLM never chooses — the page has already decided.
Agent instructions
Free-text rules that constrain reasoning: "NEVER use paid_lr as a proxy for profitability — it understates loss for long-tail lines." Applied before every query. Effectively a system prompt grounded in the data model.
Certification + deprecation
Certify the gold-layer source and mark the legacy table as deprecated. The agent's search space shrinks — it cannot accidentally query the wrong source even if the column names match.
Benchmark suite (Rung 8)
30 trap questions specific to the domain. Run as a regression harness: an ontology YAML change triggers re-run. 52.1% is not a ceiling — it is a floor that must hold after every future change.
MCP & Agentic Context Injection

Databricks exposes Unity Catalog context via MCP (Model Context Protocol). An external agent — Claude, GPT, a custom LangGraph workflow — can call the Databricks MCP server to retrieve certified metric definitions, table schemas, and Genie Page rules at query time. This means context engineering done in Unity Catalog is available to agents outside the Genie UI.

Databricks context engineering summary: Unity Catalog is the context store. Metric Views define the semantic layer. Genie Pages encode governed defaults. Agent instructions constrain reasoning. The 9-rung ladder is a repeatable implementation recipe — apply it in any domain, not just insurance.
Viral M Desai — Genie Insurance Walkthrough ↗ Databricks Genie docs ↗ Metric Views ↗
● Snowflake Cortex · Business Ontology
24% → 86%
Cortex Sense accuracy lift — vendor internal benchmark
Vanilla frontier coding agent: 24.1% task success. Same agent grounded with Cortex Sense: 86.3%. Average query cost: $1.76 → $0.59. Source: Snowflake internal evaluation (private preview, Jul 2026). Not independently validated.
Three Strengths. One Informed Agent.

Snowflake's context engineering model positions three complementary capabilities — not sequential steps — that together ground the Cortex Agent. Each can be used independently; the accuracy gains compound when used together.

Cortex Sense Infers context across the estate. Schemas Queries Dashboards Transformations Business Ontology Approves and owns business meaning. Customer Revenue Region Time Product ✓ Approved Semantic Views Execute governed calculations. ⟶ Σ 📈 ❄ Cortex Agent Inferred context Approved definitions Computed metrics Promote selected concepts Representations Complementary capabilities, not required setup steps. · Source: Snowflake Engineering Blog — Business Ontology & Context
Cortex Analyst — Semantic Model as Context

Cortex Analyst is Snowflake's natural-language-to-SQL agent. Its accuracy is determined almost entirely by the quality of the semantic model passed at query time. Two formats are supported: a YAML file staged on Snowflake (original format) and a Semantic View — a first-class catalog object created with CREATE SEMANTIC VIEW that supports grants and lineage tracking. New work should use Semantic Views.

Model sectionWhat it definesContext engineering role
tables / base_tableLogical table mapped to a physical base tableTells the model which tables are authoritative sources
dimensionsCategorical/time columns: name, synonyms, expr, descriptionResolves naming ambiguity; "LR" → loss_ratio_pct; forces correct GROUP BY
measuresNamed aggregation expressions + default_aggregationAgent uses measure names; never writes raw SQL aggregation
relationshipsJOIN conditions (many_to_one, join keys)Prevents incorrect or missing joins
verified_queriesCurated question → validated SQL pairs; verified_at, verified_byHighest-confidence path — exact match bypasses LLM SQL generation entirely. Also used as the evaluation set for Cortex Analyst Evaluations.
verified_queries gotcha: SQL in a verified query must reference logical table and column names from the semantic model — not the physical dataset names. A verified query that uses the physical column name silently degrades accuracy; Cortex Analyst will not use it as a match even when the question is identical.
Semantic View — Example Structure
Snowflake · Semantic View (new format) · CREATE SEMANTIC VIEW
name: underwriting_performance
description: Underwriting result metrics by accident year and line of business

tables:
  - name: gld_fact_underwriting_result
    description: Gold-layer monthly underwriting result — certified source
    base_table: { database: ANALYTICS, schema: FINANCE, table: GLD_FACT_UW_RESULT }
    measures:
      - name: paid_loss_ratio
        synonyms: [paid LR, cash loss ratio]
        description: Paid losses / earned premium. Use for cash settlement analysis only.
        expr: SUM(AY_PAID_LOSS) / NULLIF(SUM(EARNED_PREMIUM), 0)
        data_type: NUMBER
      - name: ultimate_loss_ratio
        synonyms: [ultimate LR, developed LR]
        description: Ultimate developed losses / earned premium. Use for profitability and long-tail lines.
        expr: SUM(AY_ULTIMATE_LOSS) / NULLIF(SUM(EARNED_PREMIUM), 0)
        data_type: NUMBER

verified_queries:
  - name: wc_loss_ratio_prior_year
    question: What is the loss ratio for Workers Compensation?
    verified_at: '2026-10-01'
    verified_by: Finance Analytics Team
    use_as_onboarding_question: true
    sql: |
      -- Use LOGICAL names (gld_fact_underwriting_result.ultimate_loss_ratio)
      -- NOT physical column names — required for Cortex Analyst matching
      SELECT ultimate_loss_ratio FROM gld_fact_underwriting_result
      WHERE line_of_business = 'WC'
      AND accident_year = YEAR(CURRENT_DATE) - 1
Cortex Sense — Runtime Context Inference

Cortex Sense is distinct from the semantic model. Where the semantic model defines what things mean, Cortex Sense infers context at runtime — scanning schemas, queries, dashboards, and transformations across the data estate to build a contextual understanding that is passed to the agent. It is the left ellipse in the Three Strengths diagram: broad context inferred from usage patterns, not curated by humans.

What Cortex Sense infers
Which tables are actually queried together (not just joined by FK). Which columns appear in dashboard filters. Which transformations produce which derived columns. Usage patterns that reveal implicit business meaning the semantic model hasn't yet encoded.
Promote → Business Ontology
Inferred concepts can be promoted (by a human approver) into the Business Ontology — the right ellipse. This creates a governed feedback loop: usage patterns become approved definitions. The two-step approval prevents noise from becoming governing truth.
Status
Private Preview as of Jul 2026. The 24.1% → 86.3% accuracy stat and $1.76 → $0.59 cost reduction are from Snowflake's internal evaluation — not independently validated. Treat as directional, not benchmarkable against Databricks or Fabric figures.
Context Engineering as practice
Snowflake formally defines context engineering as "how applications determine how instructions, data, memory, tools and prior state are selected, organized and maintained for a model or agent." dbt Labs has an OSS dbt_context_engineering package using Snowflake AI functions as building blocks.
Cortex Search — Hybrid Retrieval

Cortex Search handles unstructured context — documents, notes, PDFs. It uses Arctic Embed M for vector retrieval combined with lexical search and a reranker. Internal NDCG@10 benchmark: Lexical 0.22 → Vector 0.49 → Hybrid 0.53 → Hybrid + reranker 0.59. Cortex Agents automatically route structured questions to Cortex Analyst and unstructured questions to Cortex Search.

Snowflake context engineering summary: Three complementary layers — Cortex Sense (inferred context), Business Ontology (approved definitions), Semantic Views (computed metrics) — converge on the Cortex Agent. The Semantic View's verified_queries block is the highest-confidence path; exact question matches bypass LLM SQL generation entirely. Accuracy tracks semantic model quality more than the underlying model — documented cases show 0% → 100% on a benchmark after adding domain rules and global filters.
Snowflake — Business Ontology & Context ↗ Cortex Analyst docs ↗ Semantic View spec ↗ Snowflake — Context Engineering ↗ Cortex Search ↗ Analyst + Search integration ↗ dbt context engineering ↗
● Microsoft Fabric · Power BI Semantic Model
Known gap — IQ Ontology Decimal bug: The Microsoft Fabric IQ Ontology feature (Preview) has a known issue with Decimal data types used in financial calculations. Ratio and percentage measures stored as DECIMAL(18,4) return incorrect values when surfaced through the ontology layer. This blocks use in regulated financial reporting contexts until patched. Track: Microsoft Fabric Ideas forum and release notes.
The Power BI Semantic Model as Context Layer

Microsoft Fabric's context engineering story is built on the Power BI semantic model — a mature, widely-deployed layer that predates the AI-native platforms by over a decade. Every measure definition, table relationship, row-level security rule, and display name in the semantic model becomes context that Copilot agents can consume. The strength is breadth of enterprise adoption. The gap is that the model was designed for human dashboards, not agent reasoning chains.

Semantic model elementContext engineering roleCopilot / agent support
Measures (DAX)Named business calculations with business descriptionsGA — Copilot reads measure names and descriptions
Table relationshipsJOIN topology — prevents incorrect cross-table aggregationsGA — respected in AI-generated queries
Column descriptionsBusiness meaning of each column, disambiguates synonymsGA
Q&A synonymsAlias mapping: "LR" → "Loss Ratio Measure"GA — used by both Q&A and Copilot
Row-level security (RLS)Restricts what data the agent can see per user identityGA — Copilot respects RLS rules
Copilot annotationsFree-text instructions for Copilot in the semantic modelGA
IQ OntologyFormal ontology layer over the semantic model for agent reasoningPreview — Decimal bug blocks financial use cases
DirectLake modeSemantic model reads directly from OneLake Delta tables — no importGA — reduces data staleness in context
DirectLake — Live Context Without Import

Traditional Power BI import mode copies data into an in-memory engine on a schedule. DirectLake reads Delta Parquet files from OneLake directly — no copy, no schedule, no staleness lag. For context engineering this matters because an agent that reads last night's import and answers a question about "current reserve adequacy" is producing contextually stale output. DirectLake makes the semantic model a live context source.

Copilot Context Engineering

Fabric Copilot in Power BI uses the semantic model as its primary context. The quality of Copilot answers is directly proportional to the quality of the semantic model. Teams that have invested in measure descriptions, Q&A synonyms, and Copilot annotations get measurably better Copilot output — the same mechanism as Databricks Genie Pages and Snowflake verified_queries, expressed in Power BI tooling.

Measure descriptions as context
Every DAX measure should have a business description that tells Copilot when to use it. "Use this measure for underwriting profitability analysis. For cash settlement analysis use Paid Loss Ratio instead." This is the Fabric equivalent of Genie Agent Instructions.
Q&A synonyms
Map business vocabulary to semantic model objects. "loss ratio", "LR", "combined ratio less expense" → [Loss Ratio Measure]. Prevents the agent from guessing column names from raw table schema. Same role as the synonyms field in Snowflake's YAML.
Real-Time Intelligence
Eventstream + KQL querysets provide live event context — catastrophe alerts, claims FNOL events, premium payment events. Agents in Fabric can subscribe to these streams and add time-sensitive context to their answers. No equivalent in Databricks or Snowflake today.
Microsoft Purview integration
Purview data classification (PII, sensitive, regulated) surfaces in Fabric as a context signal — agents know which columns carry regulatory risk. Certified and endorsed data assets are promoted automatically. The governance metadata layer is deeper than Snowflake Horizon for Microsoft-stack organisations.
IQ Ontology — What It Is and Where It Stands

IQ Ontology is Microsoft's attempt to add a formal ontology layer over the Power BI semantic model — enabling OWL-style class reasoning on top of DAX measures. It is in Public Preview and not production-ready for financial services.

DimensionCurrent state (Nov 2026)
GoalFormal ontology layer enabling agent reasoning rules over semantic model objects — not just retrieval, but inference
StatusPublic Preview — not GA
Decimal bugDECIMAL(18,4) financial measures return incorrect values through the ontology layer. Affects ratio calculations (loss ratio, expense ratio, combined ratio). Blocks insurance and financial reporting use cases.
WorkaroundCast DECIMAL measures to FLOAT before exposing through IQ Ontology. Introduces rounding — not acceptable for regulatory reporting. Wait for GA fix.
Recommended pathUse the Power BI semantic model (Q&A synonyms + Copilot annotations + measure descriptions) as the context layer today. Revisit IQ Ontology at GA.
Fabric context engineering summary: The Power BI semantic model is a mature, widely-deployed context layer — invest in measure descriptions, Q&A synonyms, and Copilot annotations now. DirectLake makes it live. Purview adds governance depth. IQ Ontology is the future formal ontology layer but is not production-ready for financial calculations. Real-Time Intelligence is a unique capability — live event context — with no current equivalent on Databricks or Snowflake.
Copilot in Fabric ↗ DirectLake overview ↗ Real-Time Intelligence ↗ Q&A tooling (synonyms) ↗