StackMap
Subscribe

code-graph-rag vs Graft

Parses a polyglot monorepo with Tree-sitter into a Memgraph knowledge graph: query it in plain English (NL→Cypher), trace data flow, find dead code, edit via AST-surgical patches. — versus — Context layer for large codebases: a graph of plain-English markdown nodes — no embeddings, no index — agents read like any repo file. Claude Code hooks + MCP; 42% fewer tokens in its bench.

The curated verdict

Both are context layers for large codebases, opposite philosophies: graft stores plain-English markdown graph nodes agents read as files (no DB, no embeddings); code-graph-rag stores the actual AST-derived graph in Memgraph. Legibility and zero infra vs queryable structure.

code-graph-ragGraft
Stars2.5k488
Forks40839
LanguagePythonTypeScript
LicenseMITMIT
Last activityyesterday4 days ago
Topicscoding, ragcoding, rag
Curated connections43

code-graph-rag — the curator's take

Deepest of the code-graph tools: not just retrieval — NL→Cypher querying, FLOWS_TO taint tracing across C#/Java/C/Go, dead-code walks from entry points, ast-grep structural search-and-replace, and AST-surgical editing with diff preview, all over mixed languages in one schema. The price is infrastructure: you run Memgraph plus Python tooling. If you only want fast agent context, codebase-memory-mcp (ms indexing, single static binary) or cocoindex-code are far lighter; reach for this when agents need to *query and rewrite* structure, not just find it.

Graft — the curator's take

The anti-embeddings bet is the story: the codebase map is prose files — senior-engineer explanations, linked and greppable — so agents consume it with the file tools they already have, and a stale map shows up as a diff in review instead of rotting in a vector store. The 162-run controlled benchmark holding correctness equal is more rigor than this category usually shows; still self-run. Claude Code gets the deep integration (hooks, statusline, background rebuild), everyone else gets MCP. When NOT: nodes are LLM-written prose — building them on a big repo costs real tokens, and prose can drift subtly wrong in ways a symbol graph can't; spot-check the nodes on your hot paths. ★437 and young, with NanoNets behind it.