ReadingResearchRadarInvestment framework
Sign in / Sign up
← Back to reading
NewsMaterial2 min readDisconfirmAI Editorial

Neo4j Product Lead: Load Git History as a Graph Database, So Coding Agents Can Find Unreferenced File Coupling in Source Code

The four security modules of FastAPI never import each other, but git history shows they frequently co-change—oauth2.py was modified alongside api_key.py 18 times, http.py 17 times, and open_id_connect_url.py 16 times. William Lyon, Neo4j’s product lead, used Relate’s git-to-graph extension to load commit history into a queryable graph and conducted a controlled experiment across three coding agents: when given only the source code tree, none of the agents mentioned these sibling modules; after connecting to the graph, all three found them.

2026-11-19 05:00 GMT+8

The security directory in FastAPI contains four modules: api_key.py, oauth2.py, http.py, and open_id_connect_url.py. They do not import each other, and there are no clues in the source code pointing to one another. However, git history reveals that among the 28 commits modifying api_key.py, oauth2.py changed in 18 of them, http.py in 17, and open_id_connect_url.py in 16. Every time someone added behavior to one security scheme—auto_error, description parameter, 401 status code, or WebSocket support—all four modules moved together.

William Lyon, Neo4j’s product lead, used Relate’s git-to-graph extension to import FastAPI’s 8,102 commits into a graph database, then used fs-to-graph to import the working tree, exposing it to coding agents via MCP in read-only mode. He tasked Codex, OpenCode, and Pi with two assignments under two conditions: adding an optional constructor argument to APIKeyHeader, and adding a keyword argument to APIRouter.add_api_route. For each task, the agent had to first answer which other files needed changing, which tests to run, and who should review. When able to read only the source code tree, none of the three agents mentioned the three sibling security modules; after accessing the graph, all three found them and provided specific counts.

This gap is not an isolated case. Lyon queried all file pairs within the FastAPI package that co-changed at least five times, finding 126 pairs, of which 42—about one-third—contained no textual reference to each other in their file contents. This means that regardless of following import chains or searching for filenames, a static source code tree cannot expose this coupling. A graph database turns historical patterns into questions answerable by Cypher queries: What files change along with mine? Has anyone made this kind of change before? Who recently touched these files?

Sign in / Sign up
ReadingResearchRadarInvestment framework

Boundaries to retain: This is a controlled test built, executed, and reported by Neo4j itself, constituting vendor self-testing without independent replication. The repository contained only FastAPI, and the model used was only gpt-6.1-sol. The count of 42 pairs is based on filename matching in text rather than a true import graph, and Lyon himself acknowledges this number is approximate. It proves that for three categories of problems—file coupling, change precedents, and reviewer identification—the answers exist in commit history rather than code text. The source code tree structure cannot provide this information not because it hides it, but because the code itself does not record who changed things together.

Sources

  • neo4j.comNeo4j Graph Intelligence Platform↗
Continue researching →