Turn your monorepo into a queryable knowledge graph
It turns your multi-language codebase into a Memgraph knowledge graph you can query in English—and then edit with surgical precision.

What it does
Code-Graph-RAG uses Tree-sitter to parse codebases in nine languages into an abstract syntax tree, then ingests functions, classes, call graphs, and imports into Memgraph. The result is a queryable knowledge graph of your repo’s structure. An interactive CLI translates natural language questions into Cypher via an LLM, retrieves actual source snippets, and can perform AST-targeted code edits with visual diffs.
The interesting bit
Instead of flat vector search, it stores real semantic relationships in a graph database, so you can trace call chains across a monorepo. The system also lets you mix LLM providers—perhaps Google Gemini for orchestration and a local Ollama model for Cypher generation—keeping sensitive code on-premise while using cloud smarts for planning. It even handles surgical edits by targeting specific AST nodes rather than dumping raw text replacements.
Key highlights
- Supports nine languages via Tree-sitter (C, C++, Java, JavaScript, Lua, PHP, Python, Rust, TypeScript); Go and Scala are in development.
- Stores structure in Memgraph, enabling relationship-aware queries—call graphs, class hierarchies, imports—that flat search misses.
- Configurable LLM backends (OpenAI, Google Gemini, local Ollama) with separate models allowed for orchestration and Cypher generation.
- Surgical code editing uses AST-based function targeting and visual diffs, plus shell command execution for test runs or CLI tasks.
- Workspaces bundle multiple repos into one queryable graph; indexed data persists in named Docker volumes across restarts.
Caveats
- The project recently migrated to Codeberg after a GitHub account suspension, leaving several CI badges and integrations broken or outdated.
- Go and Scala support is still listed as “In Development” in the language matrix.
- It requires a local Docker stack (Memgraph and Qdrant) plus system dependencies like
cmakeandripgrep, making setup heavier than a typical Python CLI.
Verdict
Worth exploring if you manage large, polyglot monorepos and need relationship-aware answers that simple text search cannot provide. Skip it if you want a lightweight, zero-dependency tool or if running a local graph database feels like overkill for your project.
Frequently asked
- What is vitali87/code-graph-rag?
- It turns your multi-language codebase into a Memgraph knowledge graph you can query in English—and then edit with surgical precision.
- Is code-graph-rag open source?
- Yes — vitali87/code-graph-rag is open source, released under the MIT license.
- What language is code-graph-rag written in?
- vitali87/code-graph-rag is primarily written in Python.
- How popular is code-graph-rag?
- vitali87/code-graph-rag has 2.3k stars on GitHub.
- Where can I find code-graph-rag?
- vitali87/code-graph-rag is on GitHub at https://github.com/vitali87/code-graph-rag.