What is a context graph?
A context graph is a way of storing facts. It also records the conditions under which each fact holds. Researchers in this field use the word context in a precise sense. It means the scope of truth, the circumstances where data counts as true. It does not mean general background.
That definition is more useful than it first sounds. Almost every fact in an enterprise is true with respect to something. A city has existed since a founding date. A route opened in a particular year. A record was accurate as of the moment a system was read. Ordinary data models leave all of that implicit, and an agent cannot act safely on an implication.
Academic work has formalised several versions. Contextual knowledge graphs add explicit context sets and context relations to the usual entities and relations. Domain-contextualised approaches promote the domain to a first-class argument in every fact rather than a tag on the side, and support hierarchical domains with enforced separation between them. Context metagraphs treat whole context sets as nodes, which is what opens the door to hypergraph structure.
The concepts here are established rather than new, which matters for how you position them. Contextual graphs, context metagraphs and temporal hypergraphs all have formal definitions and a research literature behind them. What is new is applying them as the reasoning substrate under an agent rather than as a modelling exercise. Treat the underlying structures as prior art to build on and cite, not as a category to claim.
How is it different from a knowledge graph?
A knowledge graph asserts that something is true. A context graph asserts that something is true under stated conditions. The practical difference is that the second can be checked for whether it still applies, and the first can only be believed or disbelieved.
The contrast is easiest to see on a single fact rather than in the abstract.
| Question | Knowledge graph | Context graph |
|---|---|---|
| What it records | Entities and the relations between them | The same, plus the conditions under which each relation holds |
| Is it still true | Unanswerable from the graph. The current state is the only state | Answerable. Validity intervals are part of the assertion |
| Who says so | Usually absent, or held in a separate lineage system | Provenance attached to the fact itself |
| Where does it apply | Not modelled. A fact is globally true or absent | Scoped, and hierarchically where domains nest |
| Who may rely on it | Enforced outside the graph, by filtering results | A property of the assertion, so it travels with the fact |
Two of those rows carry most of the value, and they are the two marked. Being able to ask whether a fact is still true, and who is permitted to rely on it, are the questions an agent has to answer before acting rather than after. A knowledge graph answers neither from its own structure.
Why do agents need the context and not just the fact?
Because an agent acts. A person reading a stale figure usually notices something is off, asks a colleague, or checks the source. An agent reading the same figure executes against it at full confidence, and a fact with no validity condition attached cannot be recognised as expired.
This is the practical case for context graphs and it holds even where the underlying data is perfectly accurate.
- The expired fact. A credit limit, a price, an entitlement or an address was correct when recorded and is not correct now. Without a validity interval the graph presents it as current, and the agent has no basis to doubt it.
- The contested fact. Two systems disagree, which is normal in any estate of scale. A context graph records both with their sources, so an agent can prefer the authoritative one or escalate. A knowledge graph forces a resolution at load time and hides that a disagreement existed.
- The out-of-scope fact. A rule that applies in one jurisdiction, product line or entity, applied everywhere because nothing recorded its boundary. Hierarchical domains with enforced separation exist in the literature precisely to prevent this.
- The fact the agent should not have seen. If permissions are applied by filtering after retrieval, a change in filter logic exposes everything. Modelling the permission on the assertion means the constraint travels with the fact wherever it is read.
That last point connects directly to the intersection rule described at agent identity: an agent's effective permissions should be the intersection of its own and the requesting user's. A permission modelled inside the graph is enforceable at the point of retrieval. A permission applied afterwards is a filter somebody can misconfigure.
Why hypergraphs rather than ordinary graphs?
Because real enterprise events connect more than two things at once, and an ordinary graph edge connects exactly two. Research on hypergraphs is explicit that converting a hypergraph into an ordinary graph loses the higher-order information, which is the technical case for the structure.
The distinction is formal rather than stylistic. An ordinary graph is a set of vertices joined by edges where each edge links a pair. A hypergraph joins vertices with hyperedges, where a single hyperedge can connect any number of vertices at once, so a relationship between five entities is one hyperedge rather than ten pairwise edges.
Why that matters for an enterprise: a contract is signed by a person, for a customer, covering a product, on a term, under a jurisdiction, at a moment. Those six things participate in one event. Flatten that into pairwise edges and each pair survives while the fact that they co-occurred as a single event does not. An agent can then reconstruct that a customer is linked to a product and cannot establish that the link came from this contract rather than another.
Adding time makes it a temporal hypergraph, formally a hypergraph with temporal attributes attached to the vertices, the edges, or the incidences between them. The literature also uses time intervals with a start and an end rather than single timestamps, which is what you need to express that something was true for a period rather than at an instant.
A word on how to talk about this externally. Temporal hypergraph is precise, established, and almost nobody outside research searches for it. Use it where technical accuracy matters, in architecture documents and analyst conversations, and lead with plainer language everywhere else. Higher-order relationships and validity intervals convey the same idea to a buyer who will not recognise the formal term.
Which context dimensions matter in a Context Graph?
Four earn their cost in almost every enterprise case: time, provenance, scope and permission. The literature offers more, and adding dimensions has a real price in modelling complexity and query cost, so the discipline is deciding which ones an agent will actually check.
Ordered by return, with the first two doing most of the work.
- 01
Time, as two clocksWhen the fact became true in the world, and when your system learned it. Both, as intervals rather than instants. What it enables: asking what was true on a given date, which is the question every audit and every dispute begins with.
- 02
ProvenanceWhich system or document asserted this, and when it was read. What it enables: preferring an authoritative source over a convenient one, and retaining disagreements instead of silently resolving them at load time.
- 03
ScopeThe jurisdiction, entity, product line or domain in which the fact applies, hierarchically where domains nest. What it enables: stopping a rule that is correct in one context from being applied in another where it is wrong.
- 04
PermissionWho may rely on this assertion, held on the assertion rather than applied afterwards. What it enables: a constraint that travels with the fact, so retrieval cannot return something the requester was never entitled to see.
Dimensions worth considering and not defaulting to: confidence, where a fact is inferred rather than asserted; and version, where a fact derives from a document that has editions. Both are useful in specific domains and both add query complexity that has to be paid for on every read.
How do you build one?
Mostly you do not build one from scratch, and that is the honest answer. The established pattern is a pipeline of acquisition, abstraction, storage, matching, reasoning and adaptation, and the decision that matters most is which context dimensions you commit to capturing at acquisition time.
The reason to be blunt about this is that a context graph project framed as a modelling exercise tends to produce a beautiful schema and no adoption.
-
Decide the dimensions before the schema
Which questions will an agent actually ask? If nobody will ever query as-of a date, the temporal dimension is cost without return. Pick the dimensions from the queries, not from the literature.
-
Capture context at acquisition, because you cannot add it later
Provenance and ingestion time are available for free at the moment data arrives and are effectively unrecoverable afterwards. This is the same argument made at data ingestion: what you fail to record at the boundary is gone.
-
Model the relationship at its true arity
Where an event genuinely involves several entities, model it as one higher-order relationship rather than a set of pairs. Flattening is easy and irreversible, so the default should be to preserve the arity and simplify at query time if needed.
-
Keep disagreements
Resist resolving conflicting assertions at load time. Retain both with their provenance and let the reasoning layer or the agent decide, because the fact that two systems disagreed is itself information an agent may need.
-
Make it queryable in the agent's loop, not in a batch job
A context graph that answers in seconds is a data asset. One that answers in milliseconds is part of the reasoning path. Agentic retrieval already carries a latency problem, covered at agentic RAG, and a slow graph compounds it on every iteration.
-
Start with one domain that has a real dispute problem
Entitlements, pricing, or anything where "what did we say and when" gets argued about. The value of context modelling is most visible where the absence of it currently costs somebody time, and that gives you an adoption case rather than an architecture diagram.
One honest caveat on where this sits. A context graph is a means rather than an end: it exists so an agent can establish whether a fact still holds and whether it may act on it. If your agents are failing for other reasons, and the reported failure causes are usually cost, unclear value and weak controls, a better graph will not change the outcome. See data intelligence for the broader question of what makes data usable by machines.