Codebases as Knowledge Graphs: Building the AI-Native Context Layer with Graphify OSS

Devcon 8 · 5 Nov 2026 · 5:09

Raihan Khan, a Member of Technical Staff at Graphify Labs, explains why turning a codebase into a knowledge graph can help AI coding assistants. Raihan argues that plain vibe coding restarts every session, refills the context window and pays for input tokens, and that retrieval-augmented generation (RAG) finds similar chunks but misses how code is connected. In a graph, functions, modules and classes become linked nodes, so an agent can follow edges and see the blast radius of a change. The talk shows Graphify, an open-source Python package that outputs an HTML graph, a markdown report and a JSON file, and connects through MCP or commands to tools such as Claude Code and Cursor.

Speakers

Topics

From Devcon 8, hosted by Ethereum Foundation.

Transcript

[music] [music] >> Hi everyone. I see a lot of fun and energetic faces here and I totally understand because it's been a long day. So as the title suggests, it's going to be a lightning talk, pretty quick, pretty fast. How should I switch the slides? Okay, okay. No worries, no worries. It's totally fine. Okay, cool. So before we get started very quickly, how many of you know about what a knowledge graph is?

Anybody? Okay, very few faces. Cool. So today we're going to talk about what knowledge graph is and how it can help you assist in Vibe coding faster and more efficient, right? So again, you know about me. Let's get started. What happens when you do normal Vibe coding is you start every session from scratch, right? There's no context sharing between sessions and every time the context is refilled and you are paying for the input tokens that the LLM consumes, right? And this has three major problems. The first problem is that every time it reads all the tokens, the input tokens that is being consumed, you pay for it.

Second, the context fills up, right? It's it's reading all the files. It grips. In case you don't know what grep means, it looks for the symbol. It reads all the files where the symbol is present and it fills up in this context window. And finally, in the end, text has no structure. Everybody knows this. And the model is smart, but the problem is that it does not have a map. It does not have any plan. So now what used to happen is that the usual fix was previously rag. Everybody knows here I'm assuming what rag is. You chunk, you say embed and then semantically search retrieval and everything. But there's a problem with this and the problem is that similar is not equivalent to connected. If something is similar, it does not mean that it's connected, right?

If a function gets chunked from in between, that means the function loses its essence. It's not connected together, right? And relationships are invisible. And this I think rag is not very well for the code bases we used to do it before. Cursor used to do it a lot of companies but now they're moving away from it. And this is where a knowledge graph comes into play. So every single function, every single module, class, symbol, variable becomes a node and these nodes are connected with each other for forming a huge and beautiful graph like a map which gives your agent a visual understanding of what is connected how and if you change something what other edges or what other connections will get disrupted because of it. That's called the blast radius

here. Now when you ask about a question like let's say how is the auth module initiated in my initialized in my code base. So it's very simple it starts from the auth node and it starts walking to with all the edges to all the other nodes that's connected with it. So knowledge base or let's say a graph gives it a better understanding of how everything is connected together. With graphy fi OSS it's very simple it's just one simple Python package that you install.

You run this command and then three files are created one is graphy fi dot HTML that contains the visual code graph of your code base. Then there is the graphy fi graph report dot MD that contains the concepts and all of those in in a markdown format a report and finally a graph dot JSON for your agent to be able to understand how it's all connected and to be able to query and move faster. Now moving on to how graphy fi was won I'll keep it very simple Andre karpathy once tweeted that LLMs or agents in general need code knowledge graph as their memory and to give an analogy of that I'll quickly ask a question here I'm assuming everybody's here developer assuming again when you want to store data in your application what do where do you

store the data in a PDF file or in a database? Database right? Why? Because it's a structured piece of block built to store data and it can retrieve faster because it's structured and that is how knowledge graph helps instead of storing your code in a unstructured format you can store it in a structured way in a knowledge graph. So, when Andrej Karpathy said that 48 hours later Graphify was born, within two days we hit 6,000 stars and today's stats stand something like that. We have 142 K stars on GitHub. We are globally ranked at 75 on GitHub.

We yesterday hit a milestone of 10 million downloads on PyPI and mind it, we are just 5 months old and we are just getting started. 8 weeks back we also launched app.graphify.com a hosted version for more simplicity and auto indexing and everything. And we are compatible with all the agents and IDs out there. So you can feel free go use Claude code, Cursor, ChatGPT, doesn't really matter. It's simple. You either connect our MCP directly or you can use the commands to do it, right? [snorts] And that's it. Here's the GitHub repository link if anybody is interested how Graphify works and we'll be around. Our DevRel is also present here. Feel free to connect with us, ask any questions about knowledge graphs, vibe coding, Graphify, anything at all.

>> [music]