The Difference Between a Code Graph, a Knowledge Graph, and a Change Graph

Ashrey Ignise

June 10, 2024

Understand the difference between code graphs, knowledge graphs, and change graphs—and why change graphs are built to explain software blast radius and impact.

There is no shortage of graphs in enterprise software.

  • Code graphs.

  • Dependency graphs.

  • Knowledge graphs.

  • Context graphs.

  • Service graphs.

  • Architecture graphs.

They can start sounding like different names for the same thing. They aren't.

A code graph can tell you that one function calls another.

A knowledge graph can tell you that a service is owned by a particular team.

Neither, by itself, necessarily answers the question an engineer actually cares about before making a change:

If I change this, what else might be affected — and why?

That is the problem a change graph is designed around.

The distinction matters because these graphs aren't primarily differentiated by what technology is used to build them. They're differentiated by the questions they're meant to answer.


Start with the code graph

A code graph is the most concrete of the three.

It represents the structure and relationships inside software. Take a repository with something like:




A static-analysis system can go much deeper than the file structure. It might identify:




It can also capture relationships such as:

  • a file imports another file

  • a function calls another function

  • a class inherits from another class

  • a method references a symbol

  • a module exports an interface

  • a file defines a class

The result is a graph.

FIGURE 01 — A simple code graph




This is already much more useful than looking at a repository as a directory tree. The directory tells us where things live. The graph begins to tell us how they behave together.


What can a code graph answer?

A good code graph can answer questions like:

  • Where is this function used?

  • Which classes implement this interface?

  • What imports this module?

  • Which functions call this method?

  • What does this service depend on?

  • If this symbol disappears, which references might break?

These are important questions.

And for software change intelligence, code is an unusually strong place to start because many of these relationships can be derived directly from machine-readable evidence.

You don't need an engineer to remember that Function A calls Function B. The call exists in the source code. But a code graph has an obvious boundary.

It knows the software. It does not necessarily know why the software exists.


The graph gets harder when you ask “why?”

Imagine you find this code:




A code graph can tell you where the function is called. It might tell you which services ultimately depend on it. But suppose you ask:

Why does this condition exist?

The answer may live outside the repository.

Maybe:




Now we have moved beyond the code graph. This is where knowledge graphs become useful.


What is a knowledge graph?

At the simplest level, a knowledge graph represents entities and the relationships between them.

Those entities do not have to be code.

They might include:




And relationships might look like:




Now we're representing knowledge across the organization rather than just software structure.

FIGURE 02 — From code graph to knowledge graph




That is much richer. We can start connecting technical reality to organizational reality.


Knowledge graphs solve a broader problem

A knowledge graph is not necessarily concerned with change. Its purpose is usually to represent knowledge in a structured, connected form. That makes it useful for questions like:

  • Who owns this service?

  • Which features belong to this product?

  • Which customers use this capability?

  • Which regulations apply to this requirement?

  • Which documents describe this architecture?

  • What is related to this entity?

Those are powerful capabilities. But there is a subtle distinction here.

Imagine we have a perfect graph of every important entity in the organization. That still doesn't automatically tell us:

What happens if this changes?

Knowing that two things are related is not the same as knowing how change propagates between them.


A relationship does not automatically imply impact

This is important. Suppose a graph contains:




If Service X changes, does that mean Team A is impacted? Probably relevant, yes.

But compare that with:




If Service X changes its API contract, Service Y may be technically affected.

Those two relationships carry very different meanings. Now consider:




Does every change to Service X require that document to change? Not necessarily.

Or:




Does changing Service X affect the old incident? Obviously not.

A general knowledge graph can tell us that relationships exist. A system reasoning about change needs to understand which relationships can transmit impact, in which direction, under which conditions.

That is the beginning of a change graph.


What is a change graph?

A change graph is a graph organized around a specific question:

If this changes, what might be affected?

  • It can use information from a code graph.

  • It can use information from a knowledge graph.

But it adds something important—change semantics.

In other words, it understands that different relationships behave differently when a change occurs. Consider this small graph:

FIGURE 03 — Relationships have different change semantics




Now imagine PaymentService changes.

The graph might reason:




That distinction is fundamental. A blast radius is not simply:

Show me everything connected to this node.

If it were, sufficiently connected enterprise graphs would eventually tell us that everything affects everything.

That is useless.

A change graph needs rules for how impact can propagate.


The simplest way to understand the three

Think about the questions each graph optimizes for.

CODE GRAPH

How is the software connected?




KNOWLEDGE GRAPH

How is organizational knowledge connected?




CHANGE GRAPH

If this changes, where could the consequences travel?




The first describes software structure.

The second describes relationships.

The third reasons about change across those relationships.


A change graph doesn't need to be a completely separate graph

This distinction is conceptual as much as architectural.

You do not necessarily need three different databases. A sufficiently rich underlying graph can contain code, requirements, services, tests, ownership, customers, and other entities.

The change graph can emerge from applying change-specific semantics to that underlying structure.

For example, Artus might know:




That is a code relationship.

It might also know:




That is organizational knowledge.

Now a proposed modification to Function B creates another layer of reasoning:




Same underlying entities.

Different interpretation.


This matters because not all edges are equal

Imagine we want to calculate the blast radius of changing PaymentValidator.

The graph contains:




A naive graph traversal might return every connected node.

A useful change graph instead asks:

  1. Can impact propagate through this relationship?

  2. In which direction?

  3. How strong is the evidence?

  4. How far away is the dependency?

  5. What kind of impact are we predicting?

That might produce:




as the likely technical blast radius.

And separately surface:

as context to review, rather than pretending the documentation itself will break.

That seems like a small distinction. In practice, it is the difference between an actionable impact analysis and a giant graph visualization.


Confidence matters too

Real systems aren't perfectly observable. Some relationships can be known with high confidence.

For example:

If a static parser directly resolves the call.

Others may be inferred. Perhaps a dynamic framework makes the exact runtime target ambiguous. Or a ticket appears to describe a feature but isn't explicitly linked to its implementation.

A useful change graph should represent that uncertainty.

For example:




Now an engineer doesn't just see what might be affected. They can see how certain the system is.

That becomes particularly important once AI agents start using the graph to make decisions.


The graph should be able to explain itself

Suppose Artus tells an engineer:

Changing PaymentValidator may affect SubscriptionUpgrade.

The obvious next question is:

Why?

The system should be able to show the path.

FIGURE 04 — Explainable blast radius




And ideally, every edge should point back to evidence.




This matters because a change graph should not be an oracle. Engineers don't need another black box telling them something is risky.

They need a system they can interrogate.


Where tests fit

Tests are a good example of why a change graph needs richer semantics.

Suppose:




If RefundService changes, the test isn't exactly downstream in the same sense as a service consumer.

But the relationship is still valuable. The change graph can interpret it differently:




Now the graph isn't just listing dependencies. It is helping construct a change plan.

That's a much more interesting product.


Where requirements fit

Requirements behave differently again.

Consider:




If PaymentValidator changes, Requirement R42 may not itself be "affected."

Instead, it tells us something crucial:

This code exists to satisfy this requirement.

The graph can therefore ask:

Does the proposed change still satisfy R42?

This is particularly important in industries where traceability matters.

  • Automotive.

  • Aerospace.

  • Healthcare.

  • Banking.

Industrial systems.

There, understanding a code change may require tracing upward into requirements as well as downward into technical dependencies.

FIGURE 05 — Change travels in more than one direction




Downstream traversal tells us what might break.

Upstream traversal tells us what constraints the change still needs to satisfy.

A useful change graph needs both.


Why this becomes important for AI agents

Today's coding agents are increasingly capable of finding code and modifying it. But imagine an agent asked:

Replace this authentication library.

  • A code graph can help it identify imports and references.

  • A knowledge graph can help it find ownership and documentation.

A change graph can help it reason:




and:




and:




Now the agent can construct something closer to:




That is very different from:




The intelligence isn't just in the model. It is also in the representation of the environment the model is operating inside.


Why we're starting with the code graph at Artus

The obvious question is:

If the real goal is a change graph, why start with code?

Because code gives us some of the strongest evidence available.

A repository contains machine-readable relationships that can often be derived automatically:

  • definitions

  • imports

  • references

  • function calls

  • class membership

  • inheritance

  • interfaces

That means we can start constructing the technical structure without asking an organization to manually document everything.

FIGURE 06 — The path from code graph to change graph




The code graph is the foundation.

The knowledge graph makes it richer.

Change semantics make it actionable.


A change graph is not just an enterprise knowledge graph with a new name

This distinction matters.

There are already systems designed to connect knowledge across organizations.

That is useful.

But Artus is not trying to build a graph merely so people can explore everything related to everything else.

The graph has a job.

Given a proposed change, help answer:

  • What could be affected?

  • Through which dependency path?

  • How far downstream?

  • How confident are we?

  • Which tests should be examined?

  • Which requirements constrain the change?

  • Which owners need to know?

  • Where is the graph incomplete?

  • What needs human review before execution?

That orientation changes how the graph should be built.

  • It changes which edges matter.

  • It changes how relationships are weighted.

  • It changes how information is presented.

And ultimately, it changes what the system is for.


Code graphs describe. Knowledge graphs connect. Change graphs reason about consequences.

The terminology will continue to evolve.

People will use "knowledge graph," "context graph," "dependency graph," and other terms in overlapping ways. The label matters less than the underlying distinction.

A code graph gives us a machine-readable model of software structure.

A knowledge graph connects that technical structure to the broader knowledge of the organization.

A change graph uses those relationships to reason about what happens when something changes.

Or put more simply:

A code graph tells you how the system is built.

A knowledge graph tells you how things are connected.

A change graph tells you where a change might go next.

For Artus, that last question is the one that matters.

Because before an engineer — or an AI agent — changes something important, the system should be able to answer:

What could this break, and why?

Background

Every change has consequences. Know them first.

Background

Every change has consequences. Know them first.

Background

Every change has consequences. Know them first.