code-graph-rag
SHA-256Code-Graph-RAG is an AI-powered RAG tool that parses multi-language codebases into a knowledge graph, enabling semantic code search, dead-code detection, and AI-assisted editing via CLI or MCP.
Smart Download
Download Download Version
v0.0.589 · 66.1 MB
Turn a multi-language codebase into a knowledge graph, query and edit it using natural language with AI assistance.
Core Features
- Multi-language parsing with Tree-sitter (Python, TS/JS, Rust, Go, Java, C/C++, etc.)
- Knowledge graph storage in Memgraph with a unified language-agnostic schema
- Natural language queries that generate Cypher automatically
- AST-based structural search and replace across the whole codebase
- Dead code detection by walking call/reference edges from entry points
What It Can't Do
- •Requires Docker to run Memgraph. Parsing very large monorepos can be slow and memory-intensive. The --clean flag wipes the entire shared graph across all projects—use with caution. Language support varies (e.g., Ruby only has structural support via ast-grep); check the language matrix before relying on specific features.
Use Cases
- Understanding and querying large monorepos with mixed languages
- Safe refactoring, dead code cleanup, and AI-assisted code modernization
Detailed Introduction
Code-Graph-RAG is an open-source RAG (Retrieval-Augmented Generation) system designed specifically for large monorepos with mixed programming languages. Using Tree-sitter, it parses source code into an AST, extracts functions, classes, methods, modules, and their relationships, and stores the result as a knowledge graph in Memgraph. Users interact with the codebase through a CLI or an MCP server, asking questions in plain English. The AI model converts the query into Cypher, retrieves the relevant graph nodes, and returns grounded answers. Beyond Q&A, the tool offers AST-based structural search and replace (via ast-grep), dead code detection by traversing call/reference edges, and AI-driven code optimisation against best practices. Unlike tools like GitHub Code Search or Sourcegraph, Code-Graph-RAG provides a language-agnostic graph schema that unifies all languages, making cross-language refactoring and semantic understanding significantly easier. It also integrates with MCP, so Claude Code and other agents can directly edit code with previewed diffs.
Tags
Getting Started
Install the software
Double-click the downloaded installer and follow the prompts
Step 1: Install the CLI via uv (Docker is required for Memgraph)
Step 2: Run cgr start on a repository to parse and index it
Step 3: Launch the interactive CLI to query the codebase, or configure the MCP server for AI clients
- Step 1: Install the CLI via uv (Docker is required for Memgraph)
- Step 2: Run cgr start on a repository to parse and index it
- Step 3: Launch the interactive CLI to query the codebase, or configure the MCP server for AI clients
SHA-256 checksum verified
Checksum extracted from GitHub official Release page
SHA256 Checksum
b07e6bb03ccf02d4bc69efd482366a340da8606a2ba2a23c53ac3545e0dbf7b3This checksum is extracted from the GitHub Release page. Verify file integrity after download.
All SHA-256 checksums on this platform are extracted from the project's official GitHub Release page, without any modification. You can independently verify them on the GitHub Releases page.
Open Source Transparency
View GitHub SourceUninstall Info
Uninstall: remove the Python package (pipx uninstall or uv tool uninstall), then stop the Docker daemon with 'cgr daemon down' if you started containers with the built-in stack.
No Extra Dependencies
Ready to use after download. No additional runtime required.
Similar Projects
Visual Studio Code (Code - OSS)
A free, open-source code editor by Microsoft with rich extensions, debugging, and Git integration. The most popular developer tool worldwide.
opencode
OpenCode is a free, open-source AI coding agent that helps you write, refactor, and understand code. It offers two built-in modes: a full-access 'build' agent for active coding and a read-only 'plan' agent for safe exploration.
scrcpy
Display and control your Android device from your computer via USB or TCP/IP. No root required, high performance, low latency, supports audio and video mirroring.