vitali87/code-graph-rag

★ 5,155⑂ 0

The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs

About vitali87/code-graph-rag

vitali87/code-graph-rag is an open-source project on GitHub, mainly written in Python. The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs It currently holds 5,155 stars and 0 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the AI Models & LLM Tools board.

GitHub Repository Details

Repository vitali87/code-graph-rag · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

https://github.com/vitali87/code-graph-rag/blob/HEAD/Code-Graph-RAG Logo

https://github.com/vitali87/code-graph-rag/blob/HEAD/vitali87/code-graph-rag | Trendshift

https://github.com/vitali87/code-graph-rag/blob/HEAD/CI https://github.com/vitali87/code-graph-rag/blob/HEAD/Codecov https://github.com/vitali87/code-graph-rag/blob/HEAD/Quality Gate Status https://github.com/vitali87/code-graph-rag/blob/HEAD/Enterprise Support https://github.com/vitali87/code-graph-rag/blob/HEAD/PyPI Version https://github.com/vitali87/code-graph-rag/blob/HEAD/PyPI Downloads https://github.com/vitali87/code-graph-rag/blob/HEAD/SkillsLLM Security Check https://github.com/vitali87/code-graph-rag/blob/HEAD/OpenSSF Scorecard https://github.com/vitali87/code-graph-rag/blob/HEAD/OpenSSF Best Practices

Code-Graph-RAG

Code-Graph-RAG parses a multi-language codebase with Tree-sitter, builds a knowledge graph of its structure in Memgraph, and lets you query, edit, and optimise that code in plain English. It works across a monorepo of mixed languages under one unified graph schema.

https://github.com/vitali87/code-graph-rag/blob/HEAD/demo

Latest News 🔥

See NEWS.md for the full history.

What It Does

Point Code-Graph-RAG at a repository and it reads every source file, extracts functions, classes, methods, modules, and the relationships between them, and stores the result as an interconnected graph. Once the graph exists you can:

How It Works

The system has two components:

1. Multi-language parser. A Tree-sitter based parser reads the codebase and ingests functions, classes, methods, modules, and their relationships into Memgraph under a single language-agnostic schema. 2. RAG system (codebase_rag/). An interactive CLI that turns natural language into Cypher queries, retrieves matching code, and drives AI-powered editing and optimisation.

Source Code -> Tree-sitter Parser -> AST Analysis -> Memgraph Knowledge Graph
                                                             |
User Query -> AI Model (Cypher Gen) -> Cypher Query -> Graph Results -> Response

See the Architecture Overview and Graph Schema for the full picture.

Supported Languages

Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, and Dart are fully supported. Scala is in development, and Ruby, Kotlin, Swift, Elixir, Haskell, Solidity, Bash, and Nix have structural support (modules, functions, classes where the language has them, and imports) through the pluggable ast-grep tier. See the Language Support matrix for per-language capabilities.

Installation

cgr is published to PyPI. Install it system-wide with the treesitter-full (all languages) and semantic (vector search) extras:

# with uv (recommended)
uv tool install "code-graph-rag[treesitter-full,semantic]"

or with pipx

pipx install "code-graph-rag[treesitter-full,semantic]"

Which version am I getting?

Three version lines exist and they intentionally differ:

| where | what it tracks | |---|---| | git tags | every version, one per merge | | GitHub Releases (binaries, signatures) | every 50th version, plus any security fix | | PyPI | every 50th version, plus any security fix |

So the newest tag on main usually runs ahead of the newest release, often by tens of patch versions; they coincide only just after a release. Nothing is stuck, the cadences differ by design. A security fix does NOT wait for the cadence: it ships a release and a PyPI upload immediately.

uv tool install and pipx install give you the newest PyPI version, which is the newest RELEASE, not the newest tag. Interim tags exist so every merge is addressable; binaries and PyPI uploads follow the cadence above.

To run code newer than the latest release, install from git:

uv tool install "code-graph-rag[treesitter-full,semantic] @ git+https://github.com/vitali87/code-graph-rag@main"

You also need Python 3.12+, Docker (for Memgraph), cmake, and ripgrep. Full prerequisites, source installs, and environment setup are in the Installation guide.

[!NOTE]
The wheel is pure Python (py3-none-any), so the package itself installs on any platform with Python 3.12 or newer (dependencies may still need platform wheels or build tools, such as cmake for pymgclient). The piwheels build for Debian Bookworm shows as failed because Bookworm's system Python is 3.11, which is below our floor. On Raspberry Pi OS Bookworm, pin the interpreter explicitly, for example uv tool install --python 3.12 "code-graph-rag[treesitter-full,semantic]"; uv downloads Python 3.12 automatically and the PyPI wheel installs normally.

Quick Start

# Start the packaged Memgraph + Qdrant stack (no compose file needed)
cgr daemon up

Parse a repository into the graph, then query it

cgr start --repo-path /path/to/repo --update-graph cgr start --repo-path /path/to/repo

Repeat the first command for each repository you want indexed; the graph is shared, and syncing one project leaves the others alone. To start over from an empty graph, add --clean — it deletes every project in the shared graph, not just this one, and asks for confirmation first when other projects would be destroyed.

The Quick Start guide walks through parsing, querying, and exporting in five minutes.

MCP Server

Code-Graph-RAG runs as an MCP server so Claude Code and other MCP clients can query and edit your codebase directly. See the MCP Server guide for setup.

Documentation

Getting Started

User Guide Architecture Python SDK Advanced

Enterprise Services

Code-Graph-RAG is open source and free to use. For organisations that need more, we offer fully managed cloud-hosted solutions and on-premise deployments:

We also offer custom development, integration consulting, technical support contracts, and team training.

View plans & pricing at code-graph-rag.com

Contributing

Please see CONTRIBUTING.md for contribution guidelines. Good first PRs come from the TODO issues.

Support

For issues or questions, check the Troubleshooting guide first, then open an issue.

License

MIT. See LICENSE.

GitHub Stars & Activity

5,155Stars
0Forks
0Open issues
PythonLanguage

GitHub Popularity

GitHub stars5,155
Forks0
Open issues0
Primary languagePython
License-
Stars gained today0
Created-
Last pushed-

Trending History

Trending statusnot on today's boards

Related AI Projects

1

huggingface / transformers

Python★ 166,453⑂ 0
2

TauricResearch / TradingAgents

Python★ 107,797⑂ 0
3

PaddlePaddle / PaddleOCR

Python★ 89,891⑂ 0
4

unslothai / unsloth

Python★ 76,497⑂ 0
5

hiyouga / LlamaFactory

Python★ 74,932⑂ 0
6

headroomlabs-ai / headroom

Python★ 73,265⑂ 0
7

ZhuLinsen / daily_stock_analysis

Python★ 65,382⑂ 0
8

BerriAI / litellm

Python★ 59,247⑂ 0

More AI Rankings