code-graph-rag

From public sources

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

MCP serverCategory: MCP Servers · AI & memory · Git & developer tools · Search & knowledgeOpen sourcedata checked Oct 15, 2026

Overview

  • ai
  • ast
  • claude-code
  • code-analysis
  • code-understanding
  • codebase-search
  • developer-tools
  • graph-database
  • knowledge-graph
  • llm

Installation

Commands are shown, never run by the marketplace. Check them against the official documentation.

Compatibility

Unknown means no evidence was found — not that the product is incompatible.
PlatformStatusArchitectureEvidenceConfidence
Claude (web & desktop)Unknown———
Claude CodeUnknown———
CursorUnknown———
VS CodeUnknown———
WindsurfUnknown———
ChatGPTUnknown———
WindowsCompatiblex86_64official build in release v0.3.13: code-graph-rag-windows-amd64.exe0.70
macOSCompatiblex86_64official build in release v0.3.13: code-graph-rag-darwin-amd640.70
Compatiblearm64official build in release v0.3.13: code-graph-rag-darwin-arm640.70
LinuxCompatiblex86_64official build in release v0.3.13: code-graph-rag-linux-amd640.70
PythonCompatible—package manifest: pyproject.toml name0.60

Releases

checked Oct 29, 2026
v0.3.13LatestOct 25, 2026Official source ↗

Files in 0.3.13

The marketplace does not host these files: downloads go to the official source. Files have not been scanned by us.
FilePlatformSizeSHA-256Download from the official source
code-graph-rag-darwin-amd64macos · x86_6456.9 MBdf820615ed70…Official source ↗
code-graph-rag-darwin-arm64macos · arm6455.7 MB5ea9f3a61848…Official source ↗
code-graph-rag-linux-amd64linux · x86_6475.8 MB4900763c68c1…Official source ↗
code-graph-rag-windows-amd64.exewindows · x86_64 · exe56.6 MBc039843eeddb…Official source ↗
code-graph-rag-darwin-amd64.THIRD_PARTY_NOTICES.txtother448.6 KBcfd1d41492fd…Official source ↗
code-graph-rag-darwin-arm64.THIRD_PARTY_NOTICES.txtother448.6 KBcfd1d41492fd…Official source ↗
code-graph-rag-linux-amd64.THIRD_PARTY_NOTICES.txtother496.3 KBc240732e0e57…Official source ↗
code-graph-rag-windows-amd64.THIRD_PARTY_NOTICES.txtother488.9 KB5ac22031ea8d…Official source ↗
code-graph-rag-darwin-amd64.cdx.jsonSBOM115.7 KB824d5151af8c…Official source ↗
code-graph-rag-darwin-arm64.cdx.jsonSBOM115.7 KB4441c8c25797…Official source ↗
code-graph-rag-linux-amd64.cdx.jsonSBOM115.7 KB41b1e76895ea…Official source ↗
code-graph-rag-windows-amd64.cdx.jsonSBOM123.2 KB1e7e8e6efecd…Official source ↗
code-graph-rag-darwin-amd64.THIRD_PARTY_NOTICES.txt.sigstore.jsonsignature10.4 KBa47523731ef4…Official source ↗
code-graph-rag-darwin-amd64.cdx.json.sigstore.jsonsignature10.3 KB90eb1080a92c…Official source ↗
code-graph-rag-darwin-amd64.sigstore.jsonsignature10.3 KBd5199fb5f35e…Official source ↗
code-graph-rag-darwin-arm64.THIRD_PARTY_NOTICES.txt.sigstore.jsonsignature10.3 KBc120d1ab10ad…Official source ↗
code-graph-rag-darwin-arm64.cdx.json.sigstore.jsonsignature10.3 KB20ca404ca76f…Official source ↗
code-graph-rag-darwin-arm64.sigstore.jsonsignature10.3 KBd61a190b59c3…Official source ↗
code-graph-rag-linux-amd64.THIRD_PARTY_NOTICES.txt.sigstore.jsonsignature10.3 KB5b36ef22de81…Official source ↗
code-graph-rag-linux-amd64.cdx.json.sigstore.jsonsignature10.4 KB553d070ef6e4…Official source ↗
code-graph-rag-linux-amd64.sigstore.jsonsignature10.2 KB289aa93d0859…Official source ↗
code-graph-rag-windows-amd64.THIRD_PARTY_NOTICES.txt.sigstore.jsonsignature10.3 KBef4f239cfadd…Official source ↗
code-graph-rag-windows-amd64.cdx.json.sigstore.jsonsignature10.1 KBaa466cb18775…Official source ↗
code-graph-rag-windows-amd64.exe.sigstore.jsonsignature10.3 KBaba5e92e1b8f…Official source ↗
multiple.intoto.jsonlsignature12.6 KB7209aaf1fde9…Official source ↗

Release history

Quality profile

algorithm quality-v1.0 · assessed Oct 15, 2026
Quality Score99
Risk Score0
Confidence 1.00
Quality Score and Risk Score are different measures. A high score does not guarantee safety.

Score components

Maintenance · 2020
last activity 0 days ago
Documentation · 1515
README 12912 chars, description present
Ready to use · 1515
install instructions: yes; releases: yes
Metadata · 1010
4/4 of description, homepage, license, topics
Releases · 1010
10 release(s), latest 1 days ago
Category confidence · 1010
classifier confidence 0.97
Adoption · 109
5259 stars (log-dampened, 10k = max)
License clarity · 55
SPDX MIT
Community · 55
issues enabled, 701 forks

License

MIT
Known licensefrom the repository host

This is the catalog policy status, not legal advice.

Sources

github.com/vitali87/code-graph-ragPrimary★ 5,259 starslast activity Oct 15, 2026Primary repository · Confidence 1.00

Reviews

Sign in to write a review

No reviews yet.

Alternatives

README

From vitali87/code-graph-rag · license MIT · fetched Oct 29, 2026

Code-Graph-RAG

Code-Graph-RAG parses a multi-language codebase with Tree-sitter, sharpened by compiler-grade frontends and runtime traces where available, builds a knowledge graph of its structure in an embedded graph database that needs no server, 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.

Latest News 🔥

  • Dependencies Updated: Several dependencies have been updated to the latest versions, including neo4j, qdrant-client, and transformers, bringing in bug fixes and new features.
  • CLI Improvements: The change_signature operation is now accessible through the CLI and MCP, with updated documentation.
  • Graph-RS Fuzzing: Expanded fuzz testing for the graph-rs component with new targets for procedures, bulk writing, and input decoding.

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:

  • Ask questions about the codebase in natural language and get answers grounded in the real structure.
  • Retrieve the actual source of any function, class, or method by name or by intent.
  • Edit code through the agent with AST-based surgical patching and a diff preview before anything changes.
  • Optimise code against language best practices or your own coding standards.
  • Find dead code by walking call and reference edges from entry points.
  • Search and rewrite structurally by AST pattern with ast-grep.
  • Overlay runtime behaviour: trace a test run (or pull production eBPF profiles) with cgr trace and merge the calls that actually happened into the graph, exposing dispatch that static analysis cannot see.

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 the graph under a single language-agnostic schema. Where a toolchain is available, compiler-grade frontends layer exact facts on top (libclang for C/C++, go/types for Go, and opt-in Roslyn, javac and Jedi for C#, Java and Python), and dynamic tracing merges calls observed at runtime. Tree-sitter stays the backbone: a trace only sees code that ran, and a compiler frontend only covers what its toolchain can build.
  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 -> Knowledge Graph
                                                             |
User Query -> AI Model (Cypher Gen) -> Cypher Query -> Graph Results -> Response

The graph is stored in an embedded SQLite file by default. Memgraph and Neo4j are opt-in backends that run the same Cypher; Graph Backends compares them.

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, Dart, and Julia 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 (tree-sitter grammars), ast-grep (Ruby, Kotlin, Swift, Elixir, Haskell, Solidity, Bash, Nix) and semantic (vector search) extras:

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

# or with pipx
pipx install "code-graph-rag[treesitter-full,ast-grep,semantic]"

Which version am I getting?

Three version lines exist and they intentionally differ:

wherewhat it tracks
git tagsevery version, one per merge
GitHub Releases (binaries, signatures)every 50th version, plus any security fix, breaking change or merge labelled release now
PyPIevery 50th version, plus any security fix, breaking change or merge labelled release now

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, a breaking change or a merge a maintainer labels release now does NOT wait for the cadence: each 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,ast-grep,semantic] @ git+https://github.com/vitali87/code-graph-rag@main"

To upgrade an existing install, run uv tool upgrade code-graph-rag (with pipx, pipx upgrade code-graph-rag, or pipx reinstall code-graph-rag for a git install). Upgrade covers the other install methods.

You also need Python 3.12+ and ripgrep. The graph lives in an embedded SQLite file by default, so there is no database server to run: no Docker and no cmake. Memgraph and Neo4j remain available as opt-in backends (Graph Backends). Full prerequisites, source installs, and environment setup are in the Installation guide.

[!NOTE] The wheel is pure Python (py3-none-any), so it installs on any platform with Python 3.12 or newer. Older system interpreters (Debian Bookworm ships 3.11) need the interpreter pinned explicitly; see Installation for the commands.

Quick Start

# 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

The graph is written to ~/.cgr/graph.sqlite (set SQLITE_GRAPH_PATH to move it). To use Memgraph instead, install the driver with the memgraph extra, set GRAPH_BACKEND=memgraph, and start the packaged Memgraph + Qdrant stack with cgr daemon up.

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.

A default index leaves out the opt-in capture groups; add them with --capture or CGR_CAPTURE.

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:

  • Cloud-Hosted Deployment: Managed cloud infrastructure for both the graph database and the AI agent connection. Zero infrastructure overhead, so we handle scaling, updates, and availability while your team focuses on building.
  • On-Premise & Air-Gapped Deployment: Deploy Code-Graph-RAG entirely within your own environment, including air-gapped networks. Full data sovereignty for regulated industries and security-sensitive organisations.

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.

If cgr is useful to you, please consider pledging support on GitHub Sponsors. cgr links the page under cgr --version and, in a terminal, after most commands finish; set CGR_SPONSOR_PLEDGE=false to hide that line.

Accessibility

ACCESSIBILITY.md describes what cgr and its documentation support for people using assistive technology or alternative settings, the known limitations and their workarounds, and how to report a barrier.

License

MIT. See LICENSE.

Third-party components and their licences are credited on the Credits page.

Open the repository ↗