A context graph is a dynamically assembled, narrow slice of a larger knowledge structure. It surfaces only the relationships, entities, and metadata that are relevant to a specific query, task, or moment in time. Unlike a knowledge graph (which maps a broad domain) or a semantic layer (which governs how data is queried by an application), a context graph is situational: it tells an AI system what matters right now.
Context Graph Definition
Context graphs sit in the low-structure, narrow-scope quadrant of the semantic data matrix, below the broad-domain world view of a knowledge graph and alongside the structured, schema-governed semantic layer. They are not meant to store everything; they are meant to deliver the right subset of knowledge at the right moment.
How Context Graphs Work
A context graph starts with a broader knowledge structure, such as a knowledge graph, a data catalog, or a metadata graph, and filters it dynamically at query time. The result is a purpose-built, temporary graph that contains only the nodes and edges relevant to the current operation.
In a RAG (retrieval-augmented generation) system, for example, the context graph determines which documents, tables, and relationships are retrieved and included in the model's context window for a given question. The full knowledge graph might contain millions of nodes; the context graph for a single query might contain dozens.
This dynamic filtering is what allows AI systems to reason accurately at scale. The model is not given everything; it is given exactly what it needs.
Context Graphs vs. Related Concepts
- Knowledge Graph: Broad-scope, instance-based web of entities and relationships. The context graph is a real-time subset of this, filtered to what is relevant now.
- Ontology: The formal rulebook that defines what a knowledge graph can contain. Context graphs inherit the structure of an ontology without exposing all of it.
- Semantic Layer: A highly structured, schema-governed translation layer between raw data and business terminology. It governs how data is queried for a specific application.
- Context Graph: Situational and dynamic. Not about storing data but about delivering the right slice of relational knowledge at the right moment.
Why Context Graphs Are Central to AI
AI systems need to reason, not just retrieve. Reasoning requires relationships: understanding that customer_id connects to subscription_status, which connects to churn_risk, which connects to a pending renewal. A context graph makes those connections explicit and machine-readable, so an AI agent does not have to guess.
Research on enterprise AI agent implementations shows that deep context engineering, including context graphs that encode business definitions, metric logic, and entity relationships, can deliver accuracy improvements of 5x or more compared to approaches that rely on raw SQL or flat metadata.
The bottleneck for enterprise AI is rarely the model. It's the context layer underneath it.
Context Graphs and Data Lineage
Data lineage is one of the most powerful inputs to a context graph. When an AI agent needs to understand how a metric is calculated, which tables feed a model, or whether a data source is trustworthy, lineage provides the relational structure that makes those answers queryable.
Foundational's approach to data lineage is designed to make this context machine-readable. It is not buried in documentation or fragmented across systems. It is captured at the code level and made available to the AI systems that depend on it.
<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>