ホーム 暮らし Stop Grepping, Start Asking the Graph: Decoding the Codebase Knowledge Graph 'graphify' from its Official Repository

Stop Grepping, Start Asking the Graph: Decoding the Codebase Knowledge Graph 'graphify' from its Official Repository

雨宮 千夏 雨宮 千夏 • 更新: • 公開: • 読了約 51 分
目次

Target Audience for This Article

n749689a23e0a
  • Primary Audience: Readers who want to help their AI coding assistant understand large repositories but find themselves burning through tokens and time with endless chains of Grep and Read commands.

  • Technical Level: Primarily aimed at intermediate users, though applicable to beginner and advanced levels as well.

  • Prerequisites: Basic Git operations and daily experience with AI coding assistants like Claude Code or Cursor.

  • What You Will Gain: You will be able to explain the 3-pass extraction mechanism of graphify in your own words and judge whether to adopt it based on three axes: corpus scale, cost, and confidentiality.

Summary

graphify is an OSS tool that aggregates code, documentation, PDFs, images, and videos into a single knowledge graph, allowing you to query the graph instead of re-reading files. The first half explains the three-pass extraction pipeline and the design decision to attach evidence tags to every edge. The second half breaks down the claim of '71.5x token reduction' based on official measurements and delves into the failure cases recorded by the official repository itself. By the time you finish reading, you will be able to judge whether to integrate it into your repository based on measurement conditions rather than marketing slogans.

The Idea of Stopping 'Making the AI Read Files'

Recall the behavior when you ask a large repository, 'Where is this authentication process connected?' The assistant lists candidates with Glob, narrows them down with Grep, and reads multiple relevant files. By the time an answer is returned, hundreds of thousands of tokens have vanished. And in the next question, it repeats the same process.

The concept of graphify is to break this cycle. Instead of making the AI read files every time, it analyzes the entire codebase once in advance and drops it into a graph, after which you query that graph. The key is that it is not vector search; it uses neither embeddings nor a vector store. It is a real graph where you can actually trace nodes and edges.

Commands are organized into three types. graphify query "<question>" extracts the subgraph related to the question, graphify path A B traces the shortest path between two elements, and graphify explain X lists all connections for a single concept.

It is faster to see it in action. The demo animation placed in the official repository perfectly reproduces the behavior of path.

Video 1. Official demo (animated SVG). When you ask for a path on the terminal side, the path travels across the graph on the right, lighting up one hop at a time. Click to go to the corresponding section on the official page. Source: Graphify-Labs/graphify — See it in action

The output consists of only three files: graph.html which can be opened in a browser, GRAPH_REPORT.md for human reading, and graph.json for querying. This graphify-out/ directory is designed with the assumption that it will be committed to Git, allowing the entire team to start working from the same map.

The scale is also significant in terms of numbers. As of September 2026, it has 113,000 GitHub stars, 11,000 forks, and 1,629 commits to the development branch v8. The license is dual Apache-2.0 and MIT, and it was accepted into Y Combinator S26. This article was written by reading the source code of version 0.9.53 (final commit August 30, 2026) directly.

The 3-Pass Extraction Pipeline

If you think of graphify as a 'tool that analyzes code with an LLM,' you will miscalculate the cost. The actual processing is divided into three passes, and an LLM is used in only one of them.

(1) Code is analyzed via tree-sitter AST It extracts functions, classes, imports, and call relationships from the syntax tree. It is deterministic, and the LLM is never called. Therefore, if the corpus is code-only, it runs completely offline without an API key. Not a single byte leaves your machine.

(2) Transcribing videos and audio with faster-whisper This is also processed locally. What is interesting is that the nodes with many connections identified in pass 1 (the central concepts the official docs call 'god nodes') are passed as seeds into the transcription prompt. The idea is to teach the domain vocabulary first before having it listen.

(3) Only documents, PDFs, and images go through the model Only this part incurs token costs. When running as /graphify within an IDE, the session's model is used as-is, so no additional keys are needed. Environment variables are only required when running headlessly, such as in CI.

Note that the descriptions of the number of supported languages vary between documents. docs/how-it-works.md says 25 languages, the file table in the README says '37 tree-sitter grammars', and the feature table in the same README and BENCHMARKS.md say 'about 40 languages'. They were likely updated at different times. If you want to know the exact number, checking the dependency list in pyproject.toml is the most reliable way.

The design decision to provide evidence for every edge

Personally, this is what I like most about this tool.

There are countless tools that automatically generate graphs. The problem is that it becomes unclear which of the generated edges are 'facts written in the source' and which are 'tool inferences'. The moment they are mixed, the graph loses its credibility.

graphify tags each edge to separate these.

EXTRACTED refers to things explicitly stated in the source, such as import statements or direct function calls, with a fixed confidence of 1.0. INFERRED is derived by the resolution process and is segmented into a 5-level rubric from 0.95 (explicit cross-references) to 0.55 (close to a guess). AMBIGUOUS refers to items that could not be determined, which appear on the report as 'manual review required'.

Thanks to this design, the way you read the report changes. When looking at the edges listed in the 'Surprising Connections' section, you can adjust your level of trust by checking the tags. In fact, as described later, false positives due to name matching occur with some frequency.

How to correctly interpret '71.5x token reduction'

The figure of 71.5x is often cited in advertisements. Is this true? When you open the official measurement data, the conditions are clearly stated.

The 71.5x figure was achieved with a corpus of 52 files and approximately 123,000 tokens, mixing 3 repositories (nanoGPT, minGPT, micrograd) with 5 papers and 4 images. For 29 files extracted from the same corpus containing only code, it drops to 8.8x. And for a small synthetic corpus of 6 files, the official documentation itself writes 'about 1x'.

The trick is simple: while the subgraph returned by the query side is almost constant at around 1,700 tokens, the side that reads everything grows in proportion to the size of the corpus. Since only the denominator is increasing, the ratio can grow indefinitely.

In other words, this number is not a lie. However, it does not mean 'it will be 71.5x in your repository'. If it is around 6 files, it is faster to just read everything. The effect appears only after the scale exceeds the context window.

Failure examples written by the official repository itself

I believe this is what distinguishes how it is evaluated compared to other tools. graphify places the results of applying it to actual corpora and honest verification notes (review.md) in the worked/ directory. It contains patterns that did not work well, rather than just advertisements.

For example, in a verification applied to a real project with 1,886 nodes, the top 'central concepts with the most connections' were as follows.

RankIncluding testsExcluding tests1st_make_siege() (test helper)SiegeMember (domain type)2nd_make_member() (test helper)BoardPage() (screen entry point)3rd_make_position() (test helper)Design memo document4thSiegeMember (domain type)postsTab\beginarray \hline \textbfRank & \textbfIncluding tests & \textbfExcluding tests \\ \hline \text1st & \text\_make\_siege() (test helper) & \textSiegeMember (domain type) \\ \hline \text2nd & \text\_make\_member() (test helper) & \textBoardPage() (screen entry point) \\ \hline \text3rd & \text\_make\_position() (test helper) & \textDesign memo document \\ \hline \text4th & \textSiegeMember (domain type) & \textpostsTab \\ \hline \endarray

If you include tests, the top three results will all be filled with test factory functions. The number of connections is certainly high, but it is not useful as an answer to 'What is the core abstraction of this project?'. The official solution is to write tests/ in .graphifyignore. I consider this a task that must be done on the first day of introduction.

Another point raised by the same verification memo is false positives that cross language boundaries. If a Python backend and a TypeScript frontend have types with the same name, an edge like AuthError --uses--> Member will appear as a 'surprising connection'. Python classes do not use TypeScript types at runtime. This is the result of picking up name matches as semantic relationships.

You can identify them as INFERRED by looking at the tags, but since the section heading provocatively calls them 'connections you didn't know about', it is dangerous to take them at face value. In a monorepo configuration where vocabulary is shared, it is better to assume that the false positive rate in this section is high.

The 3 landmines you hit first during introduction

Installation itself ends in two lines. However, there are a mountain of stumbling blocks in the official troubleshooting guide. I will extract just the three most frequent ones.

(1) The PyPI package name is graphifyy (with two y's) Even though the command name is graphify, the package name is different. uv tool install graphifyy is correct. If you type uvx graphify ..., it will fail to resolve because uv interprets the first word as the package name. You need to write uvx --from graphifyy graphify install. It is a subtle but most frequent trap. Note that the official documentation explicitly states that 'other graphify* packages are unrelated'. Be careful not to mistake them.

(2) Avoid pip install on Mac/Windows The skill resolves Python from graphify-out/.graphify_python at runtime. If it conflicts with the environment where pip installed it, you will get a ModuleNotFoundError. If you use uv tool install or pipx install, the environment is isolated, so this problem itself will not occur.

(3) Put graph.json in .claudeignore graphify writes an output file to the workspace every time it runs. If you don't exclude it, the Claude Code prompt cache will be invalidated every time it writes, and the entire thing will be re-uploaded in the next turn. It becomes a laughable situation where a tool you introduced to reduce tokens actually increases them.

A mechanism to keep the graph fresh is also provided. Once you run graphify hook install, reconstruction runs automatically on git commit and git checkout. In addition, a merge driver for graph.json is included, so conflict markers do not appear even if multiple people commit at the same time. However, only after git pull do you need to run graphify update . yourself. The official documentation also recommends aliasing this.

The position indicated by benchmarks

The official BENCHMARKS.md (updated July 5, 2026) contains results compared with other systems under the same conditions in conversation memory benchmarks. While it must be discounted that these are vendor-reported values, it is in the sincere category that they publish a 90.6% agreement rate and a Cohen's κ of 0.81 when cross-referenced with a second independent grader.

指標graphifysupermemorymem0LOCOMO recall@100.4970.1490.048LOCOMO QA正答率45.3%49.7%27.3%取り込みコスト約 $1.40約 $15.67約 $3.48グラフ構築のLLM費用$0——\beginarrayl \hline \textbf指標 & \textbfgraphify & \textbfsupermemory & \textbfmem0 \\ \hline \textLOCOMO recall@10 & \text0.497 & \text0.149 & \text0.048 \\ \hline \textLOCOMO QA正答率 & \text45.3\% & \text49.7\% & \text27.3\% \\ \hline \text取り込みコスト & \text約 \$1.40 & \text約 \$15.67 & \text約 \$3.48 \\ \hline \textグラフ構築のLLM費用 & \text\$0 & \text--- & \text--- \\ \hline \endarray

Here is how to read it. Looking only at the QA accuracy rate, supermemory is 4.4 points ahead. However, the cost is about 11 times higher. Conversely, graphify is about 3 times superior in search recall. In LongMemEval-S, it is tied for first place with dense RAG at 76%.

And the 'zero LLM cost for graph construction' comes into play. Because it takes the structure deterministically with tree-sitter, it does not consume a single token at the indexing stage. The cost structure is fundamentally different from methods that have an LLM read documents to extract entities.

By the way, in an evaluation of code understanding targeting ERPNext with about 1 MLOC, it is reported that it improved from a baseline of 70.8% with only grep and read to 82.0%. Since the number of questions is small at n=6, it is appropriate to accept it as a reference value.

Should you use it, or pass?

I will break down the materials so far into a form that allows for a decision.

You don't need to install it for small repositories. It has almost no effect, and only the extra effort of operation remains. Conversely, in a configuration where code, design documents, and PDFs are scattered and no one can trace 'why this implementation exists', it shows its true worth. The specification where # NOTE: or # WHY: comments and references to ADRs and RFCs are tied to the code as independent nodes exists for workplaces like this.

If there are confidentiality constraints, code analysis alone does not go outside, so it is not a problem. If you want to include documents, you can move to fully local with --backend ollama. What you should be careful about here is the specification where the backend is automatically determined from environment variables. It is safer to specify it explicitly so that it does not point to an unintended provider.

I would like to add one note regarding privacy. The privacy section of the README still contains a description that could be read as "queries are logged by default," but when actually reading graphify/querylog.py in v0.9.53, the default was completely off. No file is created unless GRAPHIFY_QUERY_LOG_ENABLE=1 is explicitly set. The comments in the code also state that logging by default was disabled because it contradicts the on-device policy. It is just that the documentation update is lagging behind, but when submitting it for internal review, I want to use the code itself as the basis.

The decision to introduce it is, honestly, not that difficult. It is free, local, and you can try it out in 10 minutes if you only look at the code. If it doesn't fit, it disappears without a trace with graphify uninstall --purge. If you are hesitant, you should just run it once and see if the top 10 "central concepts" in GRAPH_REPORT.md match your intuition. If they don't, it means it is too early for that repository.

Summary

  • graphify is an OSS that bundles code and peripheral materials into a single graph, allowing you to query them instead of reading files.

  • Extraction is a 3-pass process; code and audio are completed locally, while only documents, PDFs, and images go through the model API.

  • Every edge is tagged with EXTRACTED / INFERRED / AMBIGUOUS evidence tags, so you can read them without confusing inferences with facts.

  • The "71.5x reduction" is a value for a corpus with 52 mixed files; it drops to about 1x at the 6-file scale. The effect depends on the corpus scale.

  • The three things you should do on the first day of introduction are: excluding tests/ in .graphifyignore, running graphify hook install, and adding output files to .claudeignore.

If making the graph itself becomes the goal, you will probably fail. The goal is one thing: "don't make me re-read files every time." I want you to measure whether there is a cost burden there first, and then decide whether to introduce it.

References and Materials Used

  • Graphify-Labs/graphify — Official GitHub repository (Apache-2.0 / MIT dual license, v0.9.53)

  • docs/how-it-works.md — 3-pass configuration, community detection, and confidence tags

  • ARCHITECTURE.md — Module configuration and extraction schema

  • BENCHMARKS.md — LOCOMO / LongMemEval / Code understanding evaluation (Updated July 5, 2026)

  • worked/ — Application results to actual corpora and verification notes

  • Image materials for Figure 1 and Video 1: Official repository docs/graph-hero.png and docs/demo-path.svg (Apache-2.0)

  • Figures 2 to 5: Created by the author based on the primary information above

If you found this article helpful, please give it a like❤️ or leave a comment! If you have any questions, feel free to ask in the comments section.

Innovating your business with technology

Thank you for reading this article. Are you worried about "wanting to build a system but the initial investment is too high" or "wanting to develop an IoT product but feeling anxious about both technology and costs"?

✨ Develop SaaS with 0 yen initial cost. PonoTech's micro-SaaS service

We at PonoTech Inc. develop custom SaaS for our clients with 0 yen initial cost.

Features of micro-SaaS development

  • 0 yen initial cost: Develop web, mobile, and desktop apps for free

  • Provided via monthly subscription: Start using with a monthly fee based on the features you need

  • Buyout option: You can also purchase the system as your own company asset while using the subscription

This is the optimal solution for companies that say, 'We want our own dedicated SaaS, but a multi-million yen initial investment is difficult.'

IoT contract development × subsidy utilization to support manufacturing

We can handle everything from hardware to software development. We realize the construction of IoT systems with up to 66% cost reduction by utilizing subsidies.

Reduce system development costs by utilizing subsidies
As an IT introduction support provider certified by the Ministry of Economy, Trade and Industry, we provide the following services one-stop.

  • Subsidy diagnosis and application support: We propose the optimal subsidy with a track record of 82.8% adoption rate

  • Consistent support from requirements definition to development: A development structure that is 100% compliant with subsidy requirements

  • Labor-saving subsidies, manufacturing subsidies, etc.: Support for utilizing up to 80 million yen in subsidies

Latest book 'ComfyUI Master Guide' released on May 9th!

The image generation AI book 'ComfyUI Master Guide,' co-authored by our representative Yasuhiro Hayano, who has deep knowledge of AI technology, was released by SB Creative on May 9, 2025. If you want to understand the forefront of AI image generation, please take a look.

Ideal for companies with these challenges
  • 'We want a dedicated SaaS, but we want to keep initial investment low'

  • 'We want to develop an IoT product, but we need knowledge of both hardware and software'

  • 'We want to utilize subsidies, but we don't know how to apply'

  • 'We want to start with a subscription and buy it out if necessary'

Creating a secure future together with three core strengths
  1. Micro-SaaS Development: Build a dedicated system with zero initial costs

  2. IoT Contract Development: End-to-end support from hardware to software

  3. Subsidy Utilization: Reduce development costs by up to 66%

Please take advantage of our free initial consultation. Let's think about your company's growth strategy together from both technical and management perspectives.
Click here to contact Ponotech Inc.!

▶ Take the first step to accelerate growth with technology
― Creating the future with technology. Ponotech Inc.

同じカテゴリの記事

雨宮 千夏
デジタルマーケター 雨宮 千夏
プロフィールを見る →

アイドルと音楽シーンの取材を担当。公式サイトの公演情報、リリース告知、公開チャートを照合してから構成しています。

おすすめの関連記事