# Code Graph

> A map of a codebase as dots and lines: its parts and how they link.

**Field:** Software Development  
**Category:** Code Intelligence  
**Also known as:** Codebase Graph, Code Knowledge Graph, Code Property Graph

## Think of it like

It is like a family tree. But it shows the parts of a program and how they link.

## Definition

A code graph is a map of a codebase drawn as dots and lines. Each dot is a part of the code, such as a file, a class or a function. Each line is a link between two parts, such as calls, imports or extends. Tools build it from the code itself, so it stays true to what is there. People and AI agents walk the graph to answer questions a text search cannot.

## Example

An AI agent asks the code graph what uses the User class. It follows the lines and gets 3 services and 11 functions.

## Why it matters

Most questions about code are about links. What breaks if I change this? Where does this data go?

## Common mistake

Building it once and never again. A graph that misses last week's changes gives answers that sound sure and are wrong.

## Three principles

- **Dots are parts.** Files, classes and functions.
- **Lines are links.** Calls, imports, extends.
- **Walk to answer.** Follow the lines to find out.

## Related terms

- [Call Graph](https://learn.benibix.com/term/development/call-graph)
- [Dependency Graph](https://learn.benibix.com/term/development/dependency-graph)
- [Control Flow Graph (CFG)](https://learn.benibix.com/term/development/control-flow-graph)
- [Graph (Data Structure)](https://learn.benibix.com/term/development/graph)
- [Code Intelligence](https://learn.benibix.com/term/development/code-intelligence)
- [Knowledge Graph](https://learn.benibix.com/term/ai/knowledge-graph)

![A call graph of six functions joined by arrows, each arrow meaning calls. The function parseDate is lit up as changed. The two functions that call it, and the one that calls those, are marked affected. Off to one side, a function called oldFormat has no arrows pointing to it and is marked never called, dead code.](https://learn.benibix.com/diagrams/dev4-call-graph.svg)

---

Source: https://learn.benibix.com/term/development/code-graph
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
