English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Graphify: The Knowledge Graph Tool Born from a Single Karpathy Tweet

Forum topic · ✨步子哥 · 2026-04-25

Summary

Graphify is an open-source tool that turns scattered code, documents, papers, and images into a structured knowledge graph for LLMs. It was inspired by Andrej Karpathy's April 2 post proposing an 'LLM Wiki': instead of retrieval-augmented generation (RAG) at query time, raw materials should be compiled once into a persistent, interconnected knowledge base. AI graduate student Safi Shamsi built Graphify in under 48 hours; the project gained 6,000+ GitHub stars in two days and roughly 34,500 stars by April 25. Technically, Graphify uses a dual-channel extraction engine: deterministic AST analysis via Tree-sitter for code (confidence 1.0), and LLM-based semantic extraction for documents, PDFs, and images. Edges are labeled EXTRACTED, INFERRED (0.6-0.9), or AMBIGUOUS for transparency. Results are merged into a NetworkX graph with Leiden community detection, producing an interactive HTML map, JSON data, and a Markdown audit report. According to the project, queries against the compiled graph consume about 71.5x fewer tokens than reading raw files, and knowledge accumulates across sessions. Graphify has been officially integrated into over ten AI coding platforms including Claude Code, Cursor, and GitHub Copilot CLI.

Graphify: The Knowledge Graph Tool Born from a Single Karpathy Tweet

Background: Karpathy's LLM Wiki Vision

On April 2, Andrej Karpathy posted that he increasingly prefers using LLMs to build personal knowledge bases rather than just generating code. His workflow: dump raw materials (papers, screenshots, code snippets, notes) into a /raw folder, then have the LLM compile them into a structured, internally linked knowledge Wiki — instead of retrieving fragments from raw documents on every query. This contrasts sharply with RAG: Karpathy advocates "compile once, reuse persistently." He summarized it as: Obsidian is the IDE, the LLM is the programmer, the knowledge Wiki is the codebase.

On April 4 he published an ideas file on GitHub Gist detailing a three-layer LLM Wiki architecture, stressing that knowledge should accumulate continuously rather than be rediscovered on every question. This became the inspiration for Graphify.

Birth: From Idea to Project in 48 Hours

Safi Shamsi, an AI graduate student from Birmingham, turned the idea into reality in under 48 hours, building Graphify on knowledge graph techniques from his master's thesis. The project was created on GitHub on April 3, gained over 6,000 stars within two days, and reached about 34,500 stars by April 25, topping GitHub trending and earning official integrations with more than ten AI coding platforms.

Core Idea: Don't Feed Code to AI — Let AI Draw the Knowledge Graph

Graphify preprocesses materials with a dual-channel extraction engine before generating a structured knowledge graph:

  • Channel A: Deterministic AST extraction. For code files, Tree-sitter parses abstract syntax trees with zero LLM calls, extracting class definitions, function signatures, imports, call graphs, docstrings, and design-decision comments (e.g., # WHY:, # HACK:, # NOTE:). Confidence is fixed at 1.0.
  • Channel B: Semantic extraction. For Markdown/text/reStructuredText documents, PDFs, and images (PNG/JPG/WebP/GIF), LLM subagents extract concepts; images go through vision models and PDFs are mined for citations and concepts.
  • The merged results form a NetworkX graph, partitioned into knowledge communities via the Leiden algorithm — no vector database or embeddings required. Outputs include an interactive HTML graph, structured JSON, and a Markdown audit report highlighting "god nodes," "surprising connections," and suggested questions.

    Confidence Labels: Every Edge Is Accountable

    Each relationship edge carries a three-level confidence label:

  • EXTRACTED — explicitly found in source (confidence 1.0), e.g., AST-derived call or import relations.
  • INFERRED — reasonably inferred by the LLM (confidence 0.6–0.9), e.g., semantic links between modules sharing data structures.
  • AMBIGUOUS — uncertain, flagged for human review.
  • This keeps the graph transparent: developers know exactly which connections are certain and which are guesses.

    Efficiency: 71.5x Token Savings

    Compared to having the model read raw files, querying the Graphify knowledge graph reportedly cuts token consumption by 71.5x. Key advantages:

  • Query cost: only graph summaries and relevant nodes are read, not raw document chunks.
  • Knowledge accumulation: unlike one-shot RAG retrieval, the graph persists and grows with each new source.
  • Cross-document synthesis: inter-document links are pre-built, so no re-discovery per query.
In short, a one-time compilation cost buys long-term efficient querying.

Growth: 6,000 Stars in 48 Hours

Graphify hit GitHub trending almost immediately, gaining roughly 6,000 stars in two days and ~34,500 by April 25. It was integrated into over ten mainstream AI coding platforms, including Claude Code, OpenAI Codex, OpenCode, Cursor, GitHub Copilot CLI, Factory Droid, Trae, and Google Antigravity — a positive feedback loop of popularity and ecosystem support.

Karpathy's Vision: Knowledge Should Accumulate

The shared vision: a knowledge base that auto-updates when new material is added and reuses existing structure on every query. Graphify takes a concrete step toward this by letting LLMs stand on accumulated knowledge rather than re-exploring raw files each time. Open challenges remain, such as automatically detecting and correcting contradictions in the graph (Karpathy's proposed "Lint" operation) and making the tool accessible to non-technical users.

Conclusion

Graphify demonstrates the potential of the knowledge graph + LLM combination: knowledge becomes a growing, queryable, comprehensible network rather than static text. Born from a single tweet and built in 48 hours, it validates knowledge graphs in the LLM era and sets a benchmark for the "LLM + knowledge management" space.

Tags

#graphify#knowledge-graph#andrej-karpathy#llm#rag#open-source#tree-sitter#github-trending

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177618750