Blog
Articles
Context layer vs semantic layer vs code and data graph

Context layer vs semantic layer vs code and data graph

Articles
November 4, 2026
Team Foundational
Subscribe to our Newsletter
Get the latest from our team delivered to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Ready to get started?
Try It Free
Illustration of three layered platforms for metrics, meaning and a code graph, connected to systems below.

Three terms keep showing up in conversations about AI and context engineering. A semantic layer, a context layer and a code and data graph all give an AI agent more than raw tables. They answer different questions, though, and they're built from different sources. The easiest way to choose is to ask what your agent does: does it answer questions about data, or does it change the code that produces it?

Semantic layer: one definition per metric

A semantic layer defines business metrics once, such as revenue, active users or churn, so every dashboard and query computes them the same way. For an analytics or text-to-SQL agent, it's the difference between guessing at a formula and using the agreed one. It's built from metric definitions that people write and maintain.

Context layer: meaning and rules for analytics agents

A context layer widens that idea. Besides metric definitions, it adds descriptions, business glossary terms, ownership, quality signals and access rules, so an agent answering questions knows what a table means and whether it should use it. Several data vendors now use the term. Atlan describes its platform as an enterprise context layer, and Fivetran + dbt Labs introduced Fivetran Context Layer in September 2026. It's usually built from catalog metadata, documentation and the semantic layer.

Code and data graph: what a change touches

A code and data graph, sometimes called a context graph, is built from source code. It connects each table, column and dataset to the code that reads and writes it, across repositories and languages: application services, Spark and dbt jobs, mainframe programs and BI tools, with owners. A coding agent uses it before it edits: "What reads this column, across all our repos?" The answer comes from the code itself, not from metadata someone wrote down.

Side by side

Semantic layerContext layerCode and data graph
AnswersHow is this metric calculated?What does this table mean, and may I use it?What reads or writes this, and what breaks if I change it?
Built fromMetric definitionsCatalog metadata, docs, glossary, semantic layerSource code across repos and languages
Main userAnalytics and BI agentsAnalytics and question-answering agentsCoding agents and code reviewers
Typical momentWriting a queryChoosing a datasetChanging code

Which one do you need?

If your agents answer business questions, start with a semantic layer and add a context layer as the number of datasets grows. If your agents write and change code that other systems depend on, they need the code and data graph, because metadata doesn't show which program reads a column. Many teams will run more than one. They aren't competing for the same job.

How Foundational fits

Foundational Context of Code and Data is a code and data graph, served over MCP to the coding agents your engineers already use. Read how it helps AI coding agents, or connect it to Claude Code, Cursor or Codex.

FAQ

Is a context layer the same as a semantic layer?

No. A semantic layer defines metrics. A context layer usually includes those definitions plus descriptions, ownership and rules.

Can a context layer tell a coding agent what breaks?

Usually not on its own, because it's built from metadata, and the dependencies live in code.

Is a code and data graph the same as data lineage?

It's lineage built from source code, extended across application code and repositories, and exposed to agents.

code snippet <goes here>
<style>.horizontal-trigger {height: calc(100% - 100vh);}</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.8.0/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.8.0/ScrollTrigger.min.js"></script>
<script>
// © Code by T.RICKS, https://www.timothyricks.com/
// Copyright 2021, T.RICKS, All rights reserved.
// You have the license to use this code in your projects but not to redistribute it to others
gsap.registerPlugin(ScrollTrigger);
let horizontalItem = $(".horizontal-item");
let horizontalSection = $(".horizontal-section");
let moveDistance;
function calculateScroll() {
 // Desktop
 let itemsInView = 3;
 let scrollSpeed = 1.2;  if (window.matchMedia("(max-width: 479px)").matches) {
   // Mobile Portrait
   itemsInView = 1;
   scrollSpeed = 1.2;
 } else if (window.matchMedia("(max-width: 767px)").matches) {
   // Mobile Landscape
   itemsInView = 1;
   scrollSpeed = 1.2;
 } else if (window.matchMedia("(max-width: 991px)").matches) {
   // Tablet
   itemsInView = 2;
   scrollSpeed = 1.2;
 }
 let moveAmount = horizontalItem.length - itemsInView;
 let minHeight =
   scrollSpeed * horizontalItem.outerWidth() * horizontalItem.length;
 if (moveAmount <= 0) {
   moveAmount = 0;
   minHeight = 0;
   // horizontalSection.css('height', '100vh');
 } else {
   horizontalSection.css("height", "200vh");
 }
 moveDistance = horizontalItem.outerWidth() * moveAmount;
 horizontalSection.css("min-height", minHeight + "px");
}
calculateScroll();
window.onresize = function () {
 calculateScroll();
};let tl = gsap.timeline({
 scrollTrigger: {
   trigger: ".horizontal-trigger",
   // trigger element - viewport
   start: "top top",
   end: "bottom top",
   invalidateOnRefresh: true,
   scrub: 1
 }
});
tl.to(".horizontal-section .list", {
 x: () => -moveDistance,
 duration: 1
});
</script>

Want to see a code and data graph on your own code?

Book a demo and we'll walk through it with your stack.

Want to see a code and data graph on your own code?

Book a demo and we'll walk through it with your stack.

Want to see a code and data graph on your own code?

Book a demo and we'll walk through it with your stack.

Share this post
Subscribe to our Newsletter
Get the latest from our team delivered to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Ready to get started?
Try It Free

Governance that starts at the source.