gitwtfhub

wtf is code-graph-rag?

vitali87/code-graph-rag — explained in plain English

Analysis updated 2026-08-13

4,166PythonAudience · developerComplexity · 4/5Setup · moderate

TL;DR

Code Graph RAG maps a multi-language codebase into a graph database so you can search, understand, and edit code using plain English questions.

Mindmap

mindmap
  root((repo))
    What it does
      Builds code graph
      Answers in English
      Edits code safely
      Finds dead code
    Tech stack
      Python
      Tree sitter
      Memgraph
      Qdrant
    Use cases
      Explore monorepo
      AI assisted editing
      Structural search
    Audience
      Developers
      AI coding tools

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Ask questions about an unfamiliar codebase and get answers grounded in real code structure.

REASON 2

Find and edit code across a multi-language monorepo with AI assisted structural patches.

REASON 3

Locate dead code by tracing which functions and classes are never reached.

REASON 4

Search and rewrite code by structural pattern instead of plain text matching.

What's in the stack?

PythonTree-sitterMemgraphQdrantMCPDocker

How it stacks up

vitali87/code-graph-ragguillaumemeyer/watermarks-removerfacebookresearch/vjepa2
Stars4,1664,1754,235
LanguagePythonPythonPython
Last pushed2026-03-23
MaintenanceMaintained
Setup difficultymoderateeasyhard
Complexity4/52/54/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires Docker for the Memgraph graph database plus cmake and ripgrep.

Wtf does this do

Code Graph RAG is a tool that helps you understand and work with large codebases made up of many programming languages. Instead of asking you to read through thousands of files by hand, it scans your entire project and builds a map of how everything connects: which functions call which, which classes belong to which modules, and how pieces of code relate to one another. That map is stored in a graph database called Memgraph. Once the map exists, you can ask questions about your code in plain English and get answers based on the actual structure of your project, not guesses. You can look up the real source code for any function or class by name or by describing what it does. You can also ask the tool to edit code for you: it makes precise, structural changes and shows you a preview of the difference before anything is applied. It can suggest improvements based on coding best practices, find code that is never used by tracing which parts of the program are actually reachable, and search for patterns in the code structure itself rather than just matching text. Under the hood, the project uses a parsing library called Tree sitter to read source files and pull out their structure, then stores everything in the Memgraph graph database. A command line interface turns your questions into database queries, retrieves the relevant code, and manages the AI powered editing and cleanup features. It works with many languages, including Python, TypeScript, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, and Dart, with support for more languages in progress. To use it you install the tool through PyPI, and you also need Docker to run the Memgraph database, along with a couple of smaller command line tools like cmake and ripgrep. The project can also run as an MCP server, which means AI coding assistants such as Claude Code can connect to it directly and use its code understanding features while you work. It comes from an active open source project with continuous integration, test coverage tracking, and security scanning built into its workflow.

Yoink these prompts

Prompt 1
Install code-graph-rag with uv, start the Memgraph and Qdrant stack with cgr daemon up, and index my repo at /path/to/repo.
Prompt 2
Use the code-graph-rag MCP server so my AI coding assistant can look up real function definitions in my codebase.
Prompt 3
Show me how code-graph-rag would find all dead code in a Python project by tracing call graphs from entry points.
Prompt 4
Explain how code-graph-rag builds its knowledge graph from a Tree-sitter AST for a mixed Python and TypeScript repo.

Frequently asked questions

wtf is code-graph-rag?

Code Graph RAG maps a multi-language codebase into a graph database so you can search, understand, and edit code using plain English questions.

What language is code-graph-rag written in?

Mainly Python. The stack also includes Python, Tree-sitter, Memgraph.

How hard is code-graph-rag to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is code-graph-rag for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.