During my day to day job, I have seen how bad AI agents are when it comes to fixing code bases. AI agents treat majority of the code as raw text and barely try to infer any relation between the different code blocks.
This leads to the AI agents coming up with suboptimal plans for fixing a codebase. For example, while performing a log4j1 to v2 migration, the AI agents came up with 9 callsites which needed updating, while the total number was 54.
To solve for this, I built up a semantic code graph for AI agents which they can query using Cypher language and get precise understanding of the codebase. This graph when embedded to an AI agent through the usage of skills or exposed over MCP, enabled the AI agent to reach a significantly higher precision on the migration task, enabling the discovery of all 54 call sites and also optimizing on the effort by determining that 30 out of 54 call sites inherit from the same base class, so just modifying the base class is enough.
I have put up the reference implementation for Java:
Github: https://www.github.com/neuvem/java2graph
Please do let me know what you think and do share your thoughts, opinions or feedbacks
[link] [comments]


