StackMap
Subscribe

cocoindex-code vs code-graph-rag

AST-based semantic code search for coding agents: pipx install, zero config, local embeddings out of the box — a CLI/skill/MCP that cuts agent context ~70% vs grepping. Built on CocoIndex. — versus — 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.

The curated verdict

Two shapes of code retrieval for agents: cocoindex-code does AST-aware semantic search with local embeddings (pipx install, zero infra); code-graph-rag builds an explicit relationship graph you can walk and mutate. Search-and-read → cocoindex; structure queries and edits → this.

cocoindex-codecode-graph-rag
Stars2.6k2.5k
Forks208408
LanguagePythonPython
LicenseApache-2.0MIT
Last activity4 days agoyesterday
Topicscoding, localcoding, rag
Curated connections54

cocoindex-code — the curator's take

The lowest-friction entry in the code-context-server category: one pipx install, zero config, and the [full] variant ships local embeddings so there's no API key before first search. AST-aware chunking plus the CocoIndex engine underneath means the index stays fresh incrementally instead of rebuilding. Integrates as a skill or MCP with Claude Code, Codex, Cursor. NOT the deepest graph: it's semantic search, not call-graph analysis — no callers/blast-radius queries (that's TokenSave or codegraph-mcp territory) — and the slim install quietly requires a cloud embedding key while [full] costs ~1GB of torch.

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.