Wink Pings

Someone Implemented Karpathy's Idea in Just 48 Hours

A tool called Graphify builds knowledge graphs for entire codebases, papers, and screenshots. Query token consumption is reduced to 1/71.5 of the original, so AI no longer needs to plow through entire folders every time.

Andrej Karpathy just said two days ago, "Someone should do this," and someone actually did it in 48 hours.

This is an AI programming assistant feature called Graphify. The operation is simple: type `/graphify [any folder]` in Claude Code, and it automatically generates a complete set of things for you—knowledge graph, Obsidian vault, and Wiki pages.

It supports 13 programming languages, and can handle PDFs and images using Claude Vision.

The most striking number is token consumption: a single query only uses 1/71.5 of the original. What does that mean? If you throw a bunch of code, papers, and screenshots at the AI, it used to have to re-read everything every time, but now it can just query the knowledge graph.

The working principle is two rounds. The first round uses AST for structured extraction, directly pulling out code classes, functions, imports, call graphs, docstrings, etc., without using an LLM. The second round uses an LLM to process documents and images, extracting concepts and relationships. The results of the two rounds are merged into a NetworkX graph, and community detection is done using the Leiden algorithm.

What's interesting is its tag mechanism. Each edge is labeled EXTRACTED (directly discovered from the source code), INFERRED (reasonable inference with a confidence score), or AMBIGUOUS (marked for review). You know which parts are AI guesses and how confident it is, so you don't have to fully trust its output.

Installation is just one line: `pip install graphifyy && graphify install`.

Someone in the comments asked: What's the difference between this and having Claude Code first process the code documentation and then asking it directly?

There is indeed a difference. Traditional code documentation is linear text; if you ask an architectural question, the AI has to search for keywords in the documentation itself. A knowledge graph is structured—it knows that Class A calls Class B, Class B implements Interface C, and the design motivation for this interface comes from a certain chapter of a paper. It can answer questions like "Why is this designed this way," not just "What does this code do."

Someone else in the comments mentioned DocMason, which does similar things—turning various formats of documents (PDF, PPT, emails, markdown) into structured knowledge bases. It seems many people are targeting this direction lately.

![Graphify工作流程图](https://wink.run/image?url=https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FHFQihmhaAAA20nZ%3Fformat%3Djpg%26name%3Dlarge)

At its core, it's the same trend: the capability bottleneck of AI programming assistants has shifted from "the model isn't strong enough" to "the context is too long." Instead of feeding more tokens, it's better to change the organization method.

GitHub: https://github.com/safishamsi/graphify

发布时间: 2026-04-07 14:34