A code knowledge graph for Claude
Give Claude a map of the codebase, not the whole codebase.
A pipeline reads the repositories once, extracts exact facts, and lets Claude agents explain them, checked against the code. Claude then answers questions across many services through a retrieval server over MCP, with a citation for every claim.
- Employer
- i2c Inc.
- Role
- Designed and built, end to end
- Stack
- Python
- Claude Agent SDK
- MCP
- Neo4j
- Qdrant
- Kotlin
- PostgreSQL
- Read the code: The pipeline clones each service and static analysis extracts exact facts: calls, endpoints, tables, every branch.
- Explain it: Claude agents explain the business meaning, with the tickets, wiki pages and live QA data behind it.
- Check every claim: Each claim is validated against the code facts. Anything that does not match is refused.
- Publish: Verified knowledge goes into a versioned graph, with embeddings for vague questions.
- Answer with citations: Claude asks over MCP; the retrieval server walks the graph and returns a cited answer.
The problem
Once Multi-Manager gave Claude access to our repositories, it could answer questions about the code, but only by reading it. A simple question meant opening dozens of files. The answers were good, and slow.
Across many repositories and microservices it got worse. Claude lost track of which service owned what, and its answers started to drift.
The idea
Do the reading once, carefully, and keep the result. Instead of rereading code for every question, build a knowledge graph of the system and let Claude query that.
How it learns a service
- Static analysis on the IntelliJ platform extracts the hard facts: calls, endpoints, database tables, configuration and every branch of a decision.
- A team of agents built on the Claude Agent SDK explains what the code does in business terms, each worker starting with a fresh context.
- The agents link that to the Jira tickets, Confluence pages and commits behind it, and can check live data on QA servers through Multi-Manager.
- After the first run, only code that changed is learned again.
How it stays honest
- The list of what must be explained comes from the code, not from the model. Training is not finished until every item is covered.
- Every claim an agent writes is checked against the extracted facts before it is stored. The graph holds no unchecked guesses.
- Knowledge is published in versions; a failed publish rolls back.
How it answers
A retrieval server, used by Claude over MCP, turns a question into an intent and entities, walks the graph in Neo4j and, for vague questions, finds starting points with semantic search in Qdrant. It returns a compact answer with citations to the exact code and documents.
What I learned
Bigger context windows do not fix confusion; structure does. Give the model verified facts and a map, and it stops guessing.