Summary
A walkthrough of Graphify, an open-source tool that compiles a folder of code, docs, PDFs and images into a queryable knowledge graph so an LLM agent can answer questions about a codebase without re-reading raw files every time. The tool is pitched as the practical implementation of Andrej Karpathy's "LLM Knowledge Bases" idea โ index your raw material once, then query the structured artefact. Eric Tech installs Graphify via uv, registers it as a Claude Code skill, builds a graph for his "Book Zero" bookkeeping app, and demos its path, explain, query, Obsidian-vault and MCP-server export features. The headline pitch is lower token usage (he cites a 27ร reduction on his own run), faster lookups and higher accuracy when an agent explores a code base. It matters because it targets a real friction point โ agents burning tokens repeatedly reading the same files โ though the cited reduction figures are project-generated benchmarks, not independently verified.
Key points
- Graph-as-cache for code: Graphify compiles a code base into a structured knowledge graph (nodes = files/components, edges = call/import/semantic relations) so an agent queries the graph instead of re-reading raw files โ the core token-saving mechanism.
- One-command install and skill registration: Install with
uv(orpipx), then rungraphify installto register it as a Claude Code skill โ it drops a skill into.claude/plus aCLAUDE.md. Supports Codex, OpenCode, OpenClaw and Hermes via a--platformflag. - Choose extraction depth to control cost: When building, you pick code-only, code+docs, or full extraction-with-images. Full extraction can cost 200kโ400k tokens โ use code-only for fast structural research, escalate only when docs or images matter.
- Three output artefacts: Each build produces
graph.html(interactive, toggleable visual graph),graph.reportandgraph.json(raw graph data) โ letting you isolate a subsystem (e.g. admin layouts + API routes) and see only its connections. pathandexplainfor navigation:pathfinds the shortest connection between two files/features (e.g. admin panel โ AI chat), revealing the linking file;explaindescribes how a concept (rate limiting, inbound vs outbound) works based on the graph.- Incremental updates over re-indexing:
graphify raw --updatere-extracts only changed files, so you don't rebuild the whole graph or add files one-by-one after editing 10โ20 files. - Multiple export targets: Beyond the graph, Graphify can generate an Obsidian vault, a wiki, SVG, a Neo4j-backed RAG system, or an MCP server so other LLMs can query the graph โ and you can scope it to a single folder (e.g. just
docs/) with a prompt. - Best for reading, not writing: The tool is aimed at people who "read more than write" โ researching existing functionality or onboarding onto an unfamiliar code base โ rather than active code generation.
Fact check
| Claim | Verdict | Notes | Source |
|---|---|---|---|
| "This repository is inspired from this X post that Andrej Karpathy wrote about the LLM knowledge base" | โ Confirmed | Graphify's origin is widely tied to Karpathy's "LLM Knowledge Bases" X post (April 1, 2026); it went viral ~48 hours later. | Threads, MindStudio |
| Andrej Karpathy "is the former director of AI at Tesla and a founding member of OpenAI" | โ Confirmed | Karpathy was Tesla's Director of AI and is a founding member of OpenAI โ accurate and well-documented. | VentureBeat |
| "This will reduce the large language model token usage by 70%" | โก Misleading | The project markets ~70โ79ร fewer tokens per query (not 70%); the speaker conflates the two. Independent testing on a real project (browser-use) found only ~7โ8% savings. | Steve Scargall, emelia.io |
| "We're saving 27 times token reductions for any questions" (his own run) | โ Unverified | This is the speaker's own benchmark output for his "Book Zero" code base; project examples cite 71.5รโ79ร, real-world tests far less. Per-run figures vary widely and aren't independently checkable. | Steve Scargall |
| Graphify supports Claude Code, Codex, OpenCode, OpenClaw and "Hermes agents" | โ ๏ธ Partially Confirmed | Multi-platform support is confirmed (Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, Aider). "OpenCode" and "Hermes" specifically are not corroborated in independent coverage. | Steve Scargall |
| Graphify requires Python 3.10+ and installs via uv or pipx | โ Confirmed | Standard install is pip install graphify / uv; Python 3.10+ is the documented prerequisite. |
GoPenAI |
| Graphify can generate an Obsidian vault, wiki, SVG, Neo4j RAG and an MCP server | โ Confirmed | Graphify's exports include an Obsidian vault, wiki/index.md, and MCP-server output; Neo4j is a documented graph target. |
Threads, Analytics Vidhya |
| Code-extraction uses no LLM / "your code never leaves your machine" (implied by graph build) | โ Confirmed | Graphify parses code locally with Tree-sitter (AST extraction, no LLM); only doc semantics use an LLM pass. No vector DB, no embeddings. | Steve Scargall |
| Graphify "crossed 22,000 GitHub stars" rapidly (context for the tool's traction) | โ Confirmed | Multiple sources report Graphify passing ~22,000 stars within ~10 days of its April 3, 2026 release. | Medium / Mehul Gupta |
Related resources
| Type | Name | URL | Notes |
|---|---|---|---|
| ๐ป | Graphify | https://github.com/safishamsi/graphify | Main tool demoed โ knowledge-graph builder for code bases |
| ๐ฐ | Karpathy "LLM Knowledge Bases" post | https://x.com/karpathy/status/2039805659525644595 | The X post that inspired Graphify (also a gist karpathy/442a6bf555914893e9891c11519de94f) |
| ๐ ๏ธ | uv | https://docs.astral.sh/uv/ | Python package manager used to install Graphify ("NPM for Python") |
| ๐ ๏ธ | pipx | https://pipx.pypa.io/ | Mentioned as an alternative installer to uv |
| ๐ฐ | Python | https://www.python.org/ | Prerequisite โ Python 3.10+ required |
| ๐ ๏ธ | Obsidian | https://obsidian.md/ | Graphify can export a code base as an Obsidian vault |
| ๐ ๏ธ | Neo4j | https://neo4j.com/ | Mentioned as a graph-database export target for a RAG system |
| product | Book Zero | https://bookzero.ai/ | The presenter's AI bookkeeping app used as the demo code base |
Transcript
(click to expand)
Auto-generated transcript โ may contain transcription errors.
If you're using large language model, here's how you do research on your project, then you definitely need to check out this repository called Graphify. And this repository is inspired from this ex post that Andrej Karpathy wrote about the LM knowledge base. And for those who don't know who Andrej Karpathy is, he is the former director of AI at Tesla and a founding member of OpenAI. And essentially what he's saying here is that we can index our raw file here to make a large language model here to query information and also be able to maintain it. And this repository here, you can see it does exactly that. For example, let's say if you have a folder here that contains code, documentations, you simply just using the Graphify command scale and it's going to convert it into a knowledge graph. And once you convert that into a knowledge graph, this will reduce the large language model token usage by 70%. So instead of having AI agent here to reading the raw files or documentations every single time, Graphify here is going to index it for you and compiles your code base into a structured knowledge graph so that the large language model here is going to be much more faster, consumes less tokens, and much more accurate when finding information from your local folders because it's already creating a graph. And honestly, this is mostly for people who wants to read more than write, especially for doing research or exploring new code bases. And that's why in this video, we're going to explore this Graphify repository and we're going to see how we can be able to install this onto a local machine, how we can be able to use it like converting our raw files here into a knowledge graph, and later on I'm going to show exactly how we can be able to add any informations, how we can query informations, how we can be able to add this to different large language model, extracting documentations, and so much more. So by the end of this video, your large language model here can have higher accuracy, lower token consumptions, and faster output. So with that being said, if that sounds interesting, let's get into the video. Now, before we continue, I recently launched our school community where I help you to master AI agents, automations, and so much more. And that's all coming from someone who used to work as a senior AI software engineer at companies like Amazon and Microsoft. And in this community, you're going to get over 100 plus video materials like templates and workflows that I personally built and sold over 100 plus times. On top of that, you're also going to get access to our weekly live calls. And just give you an idea, this week we're actually running a Claude Masterclass where we're going to dive into how to improve Claude's accuracy when we're going to use it to build the applications. Plus, you're also going to get full community support where you're going to get a chance to ask questions and get direct answers back. So, if you're ready to level up, make sure you jump right in and I'll see you in a community. All right. So, to get started, first we're going to do here is to install the prerequisites. So, right here you can see there's a couple of things we need. One is we need the Python onto your local machine, which is version 3.10 above. And simply just going to go to the python.org and just going to install it onto your local machine. The other one here is we have is UV. And we can also use the PIPX, but I'm just going to use UV for now. So, essentially we can do here is that you can just copy the repository and paste it to Claude Code or Codex and try to have your AI agent here to install it on your behalf. But, I'm just going to install this manually here so you can see here the first one we need to is to install the Python and UV onto your Mac OS. So, simply I'm just going to head over to a new terminal session, paste that command, and you can see it's going to install Python here and UV onto our local machine. And the next thing I'm going to do here, as you can see, we're going to use UV here to install the Graphile. Now, UV is kind of like NPM for uh Python, right? So, instead of having Node.js, which is using NPM, Python here is using UV. So, now if I were to clear terminal and just going to do the install for Graphile, and now you can see it's going to install the Graphile NPM or in this case the package onto our local machine. And then what's going to happen here is that we're going to register skills with our AI assistant by simply just going to run the Graphile install. This way we're going to have our skills added onto our project, which you can see here. So, we have our skill installed and also it's going to be living in this .claude folder. And then we also have the claude.md file, which rows on how to use the skill. And of course, if you're using different platforms, by default the installation here is going to install claw code, but if you're using code x, you can simply just going to do the platform code x. If you're using open code, there's also a command for that and open claw as well as the Hermes agents. So, there's tons of options if you're using different AI agents framework, so you can just follow that as well. Okay, so once we have this installed, the next thing we're going to take a look at is the commands. So, we scroll all the way down, you can see there's a common commands where we simply just going to do the graph by dots and it's going to build a graph for the current folder. Now, like I said, this is the bookkeeping application that I built. These are tons of folders that we have, tons of MD files or code files that we have here. And this is basically the platform that I built, which is book zero.ai and essentially what this platform does is using AI to help businesses here to manage receipts and bank statements. And here you can see there's bunch of code base, which has the app, the assets, the components, the content, docs, and so much more. And essentially, all I had to do here just going to do the {slash} graph by dots. And what's going to happen here is that it's going to take the current folder that we have, which is huge, huge code base, and I'm just going to do a {slash} graph by dots. And it's going to build a knowledge graph around this code base. So, in this case, what I'm going to do here is I'm going to wait for a bit until everything is set up. And then we're going to take a look at what the result look like. Okay, so now you can see it's asking us a question. In terms of the full map that we're trying to build, right, the full knowledge graph, should we only process the code only or the code plus documentations but skip images or the full extractions including the images. So, you can see that if we were to do the full extractions, that's going to take anywhere around 200k all the way to 400k tokens. But depends on what you're trying to do. If you're doing like research on the code base for existing functionalities, then my recommendation is just the first option, which is code only. If you're looking to go through the documentation as well, you can also do with the second option. But if images are anywhere that help you to do the research, then you can also do the full extraction as configured as well. But for my case here, I'm going to go with something that's much more quicker and just do the code only instead. So, in this case, I'm going to choose that option for now. Okay, so finally, you can see the graph here is fully generated and it has generated three things. One is the graph.html, which is an interactive knowledge graph that we can interact it with it, which I'll show you later on this video. And there's also the graph.reports, as well as the graph.json, which is basically the raw JSON for the graph data. So, there you can see we have uh 70,000 for nodes and 33 for the edges. So, edges is basically the connection between the nodes and nodes are basically the individual files or individual components that we have. And you can see that for the token cost here, this is how much it cost, and this is the benchmark. So, roughly, you can see we're saving 25 or sorry, 27 times token reductions for any questions that we're going to ask to large language model about our code base. So, this is the impact that we have here. And you can see that these are the got nodes. Got nodes are basically the edges that we have. They're basically the edge nodes that we have inside our graph. So, kind of like the children nodes, right? The which is which don't have any children itself. Uh furthermore, you can see these are the surprising connections, the suggested questions, and furthermore, you can see there's a bunch of stuff that it has find. And what we're going to do here is I'm going to navigate to the HTML, and you can see that this is the entire knowledge graph. I can simply just going to toggle on or off or just like let's say if I want to I'm very interested about the admin layouts, I can just toggle everything off and just show the admin layouts and the API routes, and I can be able to see all the edges, all the graph, all the nodes that are connected to that relations. And by doing so, this way is much more easier for me to understand the connections for all the files, all the code that we have in our code base. And this will help me to understand or speed up the process to make me understand the code base here much more faster. And furthermore, if I were to head over to the repository back really quickly, you can see that there's couple functionality that we can trigger. So, for example, there's one functionality called path. For example, let's say if I want to know the path between two files or two functionalities that we have. One is the admin panel and the other one is AI chat. And you can see here that it's going to trigger the graphify here. And by the end of it, you can see it's going to show us the shortest path between those two connections. So, one is the admin panel and the other one is AI chat. So, you can see that these are the files that I jump through, right? To see from going from the layout for the admin all the way to the AI page. And you can see that the connection between the two is actually from the index.ts, which is a file that calling both of those layouts or both of those TX files, right? So, you can see that's exactly the connection between the two. And here is the shortest path. And furthermore, there's also another functionality called explain. Like, let's say if I don't know the rate limiting or how does the AI chat functionality works in our application, right? So, for example, I wanted to ask and say, "Hey, let me Why don't you explain to me the inbound and outbound inside of our admin console." And you can see it's going to look through that and it's going to try to explain to you the concept based on the knowledge graph. And you can see this is the answer that it has found. So, the inbound versus the outbound and the main admin here, this is the dashboard and split by two sides of the sign-up they measure. So, one is the outbound analytics, which is where the visitor come from and where they drop off. The inbound here you can see is what users do after the sign-up and where they charm. So, you can see this is the entire difference between two and where they split. And you can see it gives you a clear definition of how it works. And furthermore, you can see there's also the query where let's say if you have any questions, you can also put your question here and ask about it, right? Let's say if you want to also adding additional, for example, information. Like, for example, I want to add a research paper onto this graph. I can also do that. But let's just say that you have added bunch of stuff. Let's say if you want to re-restructure only the changed files that you have. Let's Let's if you modify some files here on your local machine, you have a bunch of files, not just one, not just two, but like actually like 10 or 20. Instead of just adding them one by one, what you can also do here is that you can also do graph 5.raw {hyphen} {hyphen} update, which will re-extract only the changed files and add them onto your knowledge base. And that's how you can do it. There's also the Obsidian, which is really cool. Like you can also be able to generate the Obsidian vaults based on your code base. So for example, like let's say if you're interested about the docs that you have, I'm going to do this really quickly. So I'm just going to go to a new terminal and do the cloud again. And I'm just going to do the graph 5 here for the Obsidian. And this time I'm going to say I'm only interested for doing this inside for our doc folder. So I only want you to touch what we have in our docs folder, which is this path right here, and I want you to do this. So you can also be able to give it a prompt and let it try to do the Obsidian parts for the docs folder. So if you don't want to do this for the entire code base, you can also do this for the entire doc folder. You can put in that. And just mention that I want you to generate a Obsidian vault for this, right? So there's a lot of things you can do. There's also wiki, there's also SVG, um there's Neo, Neo for J, if you want to generate a like a rag system, right? So there's a lot of things you can do. There's also like you can generate a MCP server for this. So that any other large language model here can query for this. There's also a option for you to do that. So honestly here you can see the possibility here is endless, and I don't want to go over this in video, but you can see the core functionality here is you can use this to query information, to extract informations, to show the connection between the two, to help you to understand the code base here much more faster. And I'll make sure to drop this repository here in the links in the description below for you to check it out. And don't forget, if you're looking to up your level on how you can use Claude code or any other coding agent here to develop applications, because we do have courses and also weekly live calls that you can check it out. So with that being said, that you do find value in this video, please make sure to like this video, consider subscribing for more content like this. But with that being said, I'll see you in the next video.