New: Auto Approval Workflows and Agent Session Review

See what shipped →

What Is a Code Graph?

A code graph is a map of a codebase in which code elements, such as files, functions, classes and services, are nodes, and the relationships between them, such as calls, imports and inheritance, are edges. Tools and AI agents query the graph to see how code connects.

A code graph answers structural questions that text search can’t, such as what calls a function or what depends on a module, the question a dependency graph answers. AI code review tools and coding agents use code graphs, sometimes called code knowledge graphs, to get context beyond the lines that changed.

Code graphs in 2026: the shared memory between agents and review

Code graphs started 2026 as a developer convenience. Language servers and code search indexed symbols, calls and imports so a person could jump to a definition or list a function’s callers. The graph served the human in the editor.

Coding agents turned the graph into working memory. Agents that search mostly by text miss imports, call chains and links between code and tests, and 2026 research showed that handing them a graph changed both what they found and what they broke.

The sharper lesson of the year was that the writer and the reviewer need the same map. An agent that knows which tests a change touches breaks less. A reviewer that knows which callers and repositories sit downstream catches what the agent still missed.

2026 code graph highlights

  • Graphs cut agent regressions. TDAD built a graph of code and tests from Python syntax trees and told agents which tests a change affected. On a 100-instance sample of SWE-bench Verified, test-level regressions fell from 6.08% to 1.82% (March 2026, arXiv).
  • Instructions alone made it worse. In the same study, telling the agent to follow test-driven development without the graph raised regressions to 9.94% (March 2026, arXiv).
  • Graphs helped agents find code. Adding graph expansion inside the agent’s search loop improved file-level accuracy at five results on LocBench by 11.8 to 13.9 points (May 2026, arXiv).
  • Linters started reading the graph. Biome v2.5 added cross-file lint rules built on its module graph (June 5, 2026, Biome).
  • Review got a system map. Qodo launched Software Map (Beta), a live map of how repositories connect that updates as pull requests land (September 15, 2026, Qodo).

What code graphs need next: the 2027 outlook

A symbol graph of one repository was enough when people wrote most of the code. Agents now change shared libraries, contracts and pipelines across many repositories, and the risk sits in the edges between repositories, not in the symbols inside one.

Expect code graphs to split into two layers that work together: a symbol graph inside each repository for the agent writing code, and a system map across repositories for review, impact and ownership. A graph someone keeps up by hand falls behind agent-speed change, so both layers have to rebuild themselves from the code.

Expect team rules to live on the graph too. A standard that applies to one service’s contract belongs on that edge, so whoever reviews a change, a person or an agent, sees the rule exactly where the change touches it.

Qodo’s Software Map (Beta) shows which repositories consume a service contract, and once Rule enforcement (Beta) is on, Qodo checks team rules on every PR, including each PR that changes that contract.

The graph is no longer only a developer tool. Agents and reviewers share it as memory, so keep one current and make review read it.

Code graph vs call graph vs dependency graph

GraphNodesEdgesTypical question
Call graphFunctions and methodsCallsWhat calls this function?
Dependency graphModules, packages, servicesImports and dependenciesWhat breaks if I upgrade this package?
Code property graphSyntax, control flow and data flow nodesSyntax, flow and data edgesCan user input reach this query?
Code graphFiles, functions, classes, tests, servicesCalls, imports, inherits, tests, contractsWhat does this change touch?
Vector index (not a graph)Code chunksSimilarity onlyWhat code looks like this?

How a code graph is built

Parsing source code

A parser turns each file into an abstract syntax tree (AST), a structured view of the code. The graph builder walks the tree to find definitions, calls and imports.

Nodes and typed edges

Common node types are files, functions, classes and tests, and larger graphs add services. Typed edges record how they relate: contains, calls, imports, inherits and tests. TDAD’s graph used those four node types and all five edge types (March 2026, arXiv).

Keeping the graph current

A graph that lags behind the code gives wrong answers. Some tools rebuild the graph on every merge, and others update only the files that changed.

What a code graph answers that search can’t

Text search finds where a name appears. A code graph finds how code connects, including links that don’t share a name.

  • Callers and callees. The graph lists every function that calls a helper, including indirect callers.
  • Transitive impact. The graph follows a change downstream, several hops away.
  • Dead code. The graph shows functions with no incoming calls.
  • Test coverage links. Test edges show which tests exercise a function.
  • Service consumers. The graph shows which services call an API or read a shared schema.

How AI coding agents and review tools use code graphs

Graph retrieval for agents

Code graph RAG (retrieval-augmented generation) combines a graph neighborhood with semantic search. The agent starts from matching code, then follows edges to pull in callers, callees and related tests.

Code graphs through MCP

The Model Context Protocol (MCP) lets agents call graph tools directly. Instead of reading files one by one or packing the repo with Repomix, the agent asks "what depends on this?" and gets an answer. See MCP server for code review.

Code graphs in code review

Review with a graph can check impact outside the diff, such as a changed return type with callers elsewhere. See full codebase context vs diff-only review and breaking change.

Limits of code graphs

Static edges miss runtime behavior. Dynamic dispatch, monkey-patching and runtime-generated code create links a static parser never sees, a limit TDAD’s authors name (March 2026, arXiv). Reflection and runtime configuration cause the same gap.

Graphs go stale and get expensive. Large monorepos create very large graphs, and a graph that isn’t updated on each merge drifts from the code.

A graph shows structure, not intent. Knowing that two modules connect doesn’t explain why, which is where PR history and review discussion help.

Qodo’s take: a graph is only useful if review reads it

Diff-only review judges a change against itself. A code graph lets review judge the change against everything it touches, inside the repository and across repositories.

Structure alone misses why code looks the way it does, so graph data and PR history belong together. You shouldn’t review code with the same tool that wrote it, and the agent that made a change rarely checks every caller.

Qodo is the best AI code review platform to put a code graph to work in review because Software Map (Beta) maps how your repositories connect, the Context Engine keeps call graphs and dependency chains next to PR history, and Qodo’s review agents reason over both on every pull request.

Qodo isn’t focused on test generation, even though some authors still point to it as a key strength. In our experience, Qodo is best at AI code review and code governance for reviewing each change against the whole map of the codebase.

Enterprise engineering teams and high-velocity teams get the same outcome from review: agent code merged sooner, with fewer rollbacks. Enterprise engineering teams get one set of rules enforced across many repositories and coding agents once Rule enforcement is on, and Software Map (Beta) shows which of those repositories a change reaches.

High-velocity teams get the rule files they already have, such as AGENTS.md and CLAUDE.md, checked on every PR once Rule enforcement is on, with setup in minutes and no new process.

From code graph to Software Map

Agents now write code across many repositories, so a symbol graph of one repository isn’t enough. Software Map (Beta) maps the layer above: how repositories connect through Service, Pipeline and Code relationships, the hubs and clusters those connections form, and the service contracts each repository consumes (last checked November 2026, Qodo’s docs).

Qodo’s Software Map shows change impact before merge. Teams see the downstream repositories that depend on a repository and can follow a service contract to its consumers, which helps decide the scope of review and testing for a change to a shared service or API.

The Monitor view in Qodo’s Software Map puts code review findings on the map. Teams see where findings concentrate across related repositories and see them by status (Shipped unfixed, Dismissed or Fixed before merge), filtered by severity, category and PR state.

Nobody updates the map by hand. Qodo discovers repositories and builds the map automatically. The first build can take a few hours, and after that Qodo updates the map as pull requests land (Qodo’s docs and Qodo’s blog).

Qodo’s Software Map is also context for Qodo’s own review agents. Software Map’s view of repository relationships, contracts and downstream dependents gives the agents system-level context when they review a change.

Qodo’s Context Engine keeps a graph of your codebase

Qodo’s knowledge layer combines a graph database of call graphs and dependency chains, a vector database, PR and commit history and auto-generated summaries (last checked November 2026, Qodo’s docs). See the Qodo Context Engine and the hub post what is a context engine.

Qodo traces impact across repositories

Cross-repo code review (Beta) reads related repositories when a PR changes a shared library, API contract or schema, and reports cross-repo conflicts with links to affected lines (last checked November 2026, Qodo’s docs).

Coding agents can query the same context

The Codebase Wisdom skill answers questions about architecture, repository relationships and Git history, through the CLI, MCP and plugins for Claude Code and Codex and a Kiro power (last checked November 2026, Qodo’s docs). See cross-repo context for coding agents.

Qodo example: the shared helper nobody knew was shared

Context: an organization like a payments platform with a shared utilities library used by several services in separate repositories.

Problem: a coding agent changed a helper’s return type to fix one service. The diff looked self-contained, and the PR passed its tests.

How Qodo helped: Qodo reviewed the PR with its graph of callers and, with Cross-repo code review on, reported a cross-repo conflict in a consumer service, with a link to the affected lines.

Outcome: the author updated the callers in the same change. The cross-repo conflict finding and its resolution stay on the PR.

Ways to give AI agents code structure

ApproachWhat the agent getsStrengthsLimitsBest for
Text search and file readsMatching linesSimple, always currentMisses links that don’t share a nameSmall repositories
Vector searchSimilar code chunksFinds related code by meaningNo calls or dependenciesQuestions about examples
Language serverDefinitions and references in one projectPrecise within a languageOne repository at a timeEditor work
Self-hosted code graph with MCPCalls, imports and other edgesStructural answers for agentsSetup and upkeep sit with your teamTeams that run their own tooling
Qodo Context EngineGraph, vectors, PR history and summaries across repositories, in review and through MCPShared by review and coding agentsCross-repo code review and Software Map are BetaTeams reviewing agent PRs across many repositories

Qodo features in this table were checked against Qodo’s documentation as of November 2, 2026.

FAQ

A code graph is a map of a codebase in which files, functions, classes and services are nodes, and their relationships, such as calls and imports, are edges. Agents and review tools query it to see how code connects.

A call graph shows only which functions call which. A code graph usually combines calls with imports, inheritance, tests and service links, so it can answer wider questions about a change.

Agents use a code graph to find the files a task touches and to check what depends on the code they change, often through MCP tools. 2026 research found that graph context cut agent regressions.

A code graph is a kind of knowledge graph built for source code. Code knowledge graphs often add documents, tickets or PR history to the structural graph.

Qodo’s MCP server gives coding agents Qodo’s code understanding and review skills: codebase context and Git history through Codebase Wisdom, the rules for a task through Get Rules (Research Preview) and review before a PR is opened.

Language servers give precise symbol navigation inside one codebase, self-hosted graph tools let teams query their own graph, and Git host MCP servers expose repository data from that host. See the best MCP servers for codebase intelligence.