· via dev.to (home feed)
Graphify replaces vector RAG with deterministic code graphs; RepoBuddy shows the payoff
Graphify builds queryable knowledge graphs from code structure instead of vector embeddings, and its author reports up to 92 percent less context per query; RepoBuddy applies it to orienting first-time contributors.
Two posts that appeared on dev.to on October 17 make a straightforward case: codebases already express their own structure, so retrieving LLM context through vector search burns tokens re-deriving relationships that static analysis can read for free. One post introduces Graphify, an open-source tool that turns a repository into a deterministic, queryable knowledge graph. The other documents RepoBuddy, a Hacktoberfest build on top of it that tells first-time contributors where to start in a repository they have never opened.
What Graphify builds
Graphify, released under the MIT license, parses code with static analysis instead of embedding it. According to its introductory post, it extracts four layers of information: code structure from AST parsing (functions, classes, imports), database schemas from SQL DDL and migrations, relationships among configuration values such as environment variables and feature flags, and links into documentation like docstrings and README sections. Edges in the resulting graph are explicitly labeled — calls, imports, defines, references — with no embedding model or vector store involved.
The parser handles Python, JavaScript, TypeScript, Go and Rust out of the box, plus Postgres, MySQL and SQLite DDL. Everything runs locally: a one-time parse is cached, and later queries traverse the graph without remote API calls. Graphify also ships as a skill for AI coding assistants such as Claude Code, Cursor and Codex; a trace command locates a function node, walks its call edges and returns a subgraph the author measures at roughly 400–800 tokens.
The cost argument
The post's central claim is economic. A conventional vector pipeline embeds a query, pulls back 10–20 overlapping chunks and feeds more than 8,000 tokens of retrieved context into the prompt, repeating the process for every follow-up; keeping embeddings fresh on a 50,000-line codebase costs an estimated $2–5 per day. A Graphify traversal typically returns 300–600 tokens instead.
In a self-run benchmark — 200 queries against a 50,000-line Python/TypeScript monorepo versus a LangChain plus ChromaDB retrieval stack using identical GPT-4-turbo prompts — the author reports an 85–92 percent cut in context consumption. A recommended hybrid pattern runs graph traversal first, falls back to vector search only when the graph returns fewer than three results, and pins the graph topology in a cached prompt prefix so it can be reused across dozens of queries. The author prices that combination at roughly $0.40 per 50-query session versus $4.20 uncached. These are author-run numbers from a single setup rather than an independent benchmark, but the mechanism — exact, cacheable retrieval — holds regardless of the precise percentages.
Where graphs win, and where they don't
The post concedes that graphs do not replace semantic search. Vector RAG still wins for conceptual queries such as finding code related to payment fraud, for loosely structured or heavily metaprogrammed codebases, and for fuzzy matching across prose documentation. Graphs win when questions are structural or navigational — what calls this, or how data flows from an API endpoint to a table — and when the token budget is tight.
RepoBuddy: the idea in practice
At Hacktoberfest Hack Day in Vadodara, a team of three — Omkumar Vaghela, Soham Kanakhara and the post's author — built RepoBuddy around the question every new contributor asks. Paste a GitHub URL and the tool shallow-clones the repository, builds a graph with tree-sitter at no API cost, and generates a summary report plus an interactive graph view. Each question returns only the relevant subgraph, which goes to Gemma 4 (gemma4:31b on Ollama Cloud by default, with an optional Gemini API path that falls back to Ollama on failure) under instructions to answer only from the graph and always name real file paths. If no node matches a question, it answers from the report alone.
The write-up includes telling engineering details: concurrent requests for the same repository share one shielded clone task, and model failures surface both error causes. The front end is a static Next.js site on Cloudflare Pages with a FastAPI backend on Render, plus a beta mode that queries Graphify Cloud's hosted MCP directly — a hosted offering the original Graphify post never mentions. The admitted wart is Render's ephemeral free disk, which wipes mapped repositories on restart and forces the client to re-map.
Why it matters
Context is the binding constraint on coding agents, and every token spent on redundant retrieval is one unavailable for reasoning — billed at frontier-model rates. Code is unusual among knowledge sources because its relationships are explicit and machine-readable, which makes deterministic retrieval both cheaper and more precise than similarity search for a large class of developer questions. Graphify is best read as a complementary layer rather than a replacement: exact structure from the graph, semantics from embeddings when needed. RepoBuddy shows the approach solving a real onboarding problem, and while the benchmarks are author-run, the combination of structural retrieval and aggressive prompt caching is something any team with a rising RAG bill can test for itself.
- #code-knowledge-graphs
- #rag
- #developer-tools
- #open-source
- #llm