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.
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
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.
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.
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)
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.
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.
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.
Rung
Context type added
Accuracy
UC object
0
None — raw table
10.6%
Delta table
1
Column comments + PK/FK joins
10.8%
Column metadata
2
Metric views: paid / incurred / ultimate LR
28.5%
Metric View
3
Synonyms & display names
28.5%
Display names
4
Domains & subdomains
28.5%
UC Domain
5
Genie Pages — governed default: long-tail → ultimate LR
52.1% ▲
Genie Page
6
Certify source + deprecate legacy table
52.1% repeatable
Certification tag
7
Agent instructions: NEVER use paid_lr for profitability
Follow-ups correct
Agent instruction
8
Benchmark suite (30 trap questions)
52.1% provable
Genie 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.
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.
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 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 section
What it defines
Context engineering role
tables / base_table
Logical table mapped to a physical base table
Tells the model which tables are authoritative sources
Highest-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_performancedescription: Underwriting result metrics by accident year and line of businesstables:
- name: gld_fact_underwriting_resultdescription: Gold-layer monthly underwriting result — certified sourcebase_table: { database: ANALYTICS, schema: FINANCE, table: GLD_FACT_UW_RESULT }
measures:
- name: paid_loss_ratiosynonyms: [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_ratiosynonyms: [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: NUMBERverified_queries:
- name: wc_loss_ratio_prior_yearquestion: What is the loss ratio for Workers Compensation?verified_at: '2026-10-01'verified_by: Finance Analytics Teamuse_as_onboarding_question: truesql: |
-- 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.
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 element
Context engineering role
Copilot / agent support
Measures (DAX)
Named business calculations with business descriptions
Business meaning of each column, disambiguates synonyms
GA
Q&A synonyms
Alias 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 identity
GA — Copilot respects RLS rules
Copilot annotations
Free-text instructions for Copilot in the semantic model
GA
IQ Ontology
Formal ontology layer over the semantic model for agent reasoning
Preview — Decimal bug blocks financial use cases
DirectLake mode
Semantic model reads directly from OneLake Delta tables — no import
GA — 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.
Dimension
Current state (Nov 2026)
Goal
Formal ontology layer enabling agent reasoning rules over semantic model objects — not just retrieval, but inference
Status
Public Preview — not GA
Decimal bug
DECIMAL(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.
Workaround
Cast DECIMAL measures to FLOAT before exposing through IQ Ontology. Introduces rounding — not acceptable for regulatory reporting. Wait for GA fix.
Recommended path
Use 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.