← Back to Leaderboard
Cvitali87

vitali87/code-graph-rag

Graph-backed RAG for querying and editing multilingual codebases

Engineering Health (Methodology)
A+ · 95/100
Maintenance Activity
● Updated today
Latest Release
v0.7.180
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption20/25
Release Cadence20/20
License Clarity20/20
DockerMCPSelf-HostedCLI
Total Stars
★ 5,465
24h Growth
+2
7d Growth
+20
Forks
739

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

vitali87/code-graph-rag Star History (2025-06-18 - 2026-12-04) ALL-TIME STAR HISTORY (2025-06 – 2026-12) +5.5k in 534d · avg +10/day 5.8k 2.9k 0 2025-06-18: ★ 12025-07-26: ★ 7722025-08-30: ★ 9702025-10-04: ★ 1,1872025-11-08: ★ 1,3112025-12-13: ★ 1,4772026-01-17: ★ 1,6632026-02-21: ★ 1,8752026-03-28: ★ 2,2422026-05-02: ★ 2,2432026-06-06: ★ 2,2432026-07-11: ★ 2,2802026-08-15: ★ 4,3192026-09-19: ★ 5,1112026-10-24: ★ 5,2622026-12-04: ★ 5,465 ★ 5.5k 2025-06 2026-03 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Code-Graph-RAG is a code index and retrieval agent, not a general-purpose RAG database. Tree-sitter parses source into ASTs, and the indexer extracts symbols and relationships into a unified graph schema across languages. Compiler-grade frontends and runtime traces can enrich the graph where available. SQLite stores the graph in-process by default; Memgraph and Neo4j are opt-in backends that use the same Cypher queries.

The Python application in codebase_rag/ uses a model to turn questions into Cypher, then retrieves graph results and matching source to ground the response. The application requires the cgr-graph-rs native extension. From v0.7.180, the Rust engine framework is enabled by default with a Python fallback; that fallback does not remove the package's native extension requirement. The CLI is the direct interface, and MCP exposes query and edit capabilities to clients such as Claude Code.

Key Capabilities & Differentiators

The graph supports source lookup, relationship queries, and dead-code analysis by walking call and reference edges from entry points. Optional vector search adds intent-based lookup, while ast-grep supports structural search and rewrite. Agent-driven edits use AST-based patching with a diff preview before changes. cgr trace can merge observed calls from test runs or production eBPF profiles, revealing dispatch that static analysis misses for the workloads actually observed.

Full language support is listed for Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, Dart, Julia, and Lean 4; Scala is still in development. The ast-grep tier provides structural support for Ruby, Kotlin, Swift, Elixir, Haskell, Solidity, Bash, and Nix, including modules, functions, classes where applicable, and imports. That tier should not be treated as equivalent to full call or reference analysis. Optional capture groups are excluded from the default index and can be enabled with --capture or CGR_CAPTURE.

Trade-offs & Limitations

Compared with keyword search or vector-only code RAG, explicit edges are more useful when a question depends on callers, imports, or reachability rather than text similarity. The cost is an index that must stay current and whose usefulness depends on parser and edge coverage. Model-generated Cypher can also misread the question. Runtime overlays improve coverage for exercised paths, but an unobserved call is not proof of dead code. Use a representative repository to measure index build time, peak memory, and graph size; size local inference separately for the chosen model and concurrency.

Embedded SQLite is the lower-operations starting point. Use Memgraph or Neo4j when a separately managed graph service fits your operating model; do not assume a performance gain without testing the actual workload. The default graph can contain multiple projects, and --clean clears all of them, not just the selected repository. Isolate graph files where project boundaries matter. The MIT license supports self-hosting, but review model data flows and MCP filesystem access separately before exposing proprietary workspaces or enabling editing.

Hardware & Deployment Guide

Install with uv tool or pipx on CPython 3.12+ with ripgrep. Native wheels constrain platform compatibility: Linux x86_64 and aarch64, macOS, and Windows x64 are listed. The default deployment needs neither Docker nor a database server. Build the index with cgr start --repo-path /path/to/repo --update-graph; the default database is ~/.cgr/graph.sqlite, configurable through SQLITE_GRAPH_PATH. For the opt-in Memgraph path, install the memgraph extra, set GRAPH_BACKEND=memgraph, and use cgr daemon up to start the packaged Memgraph and Qdrant stack.

The Dockerfile uses uv and a Rust toolchain to build cgr-graph-rs from rust/. Release v0.7.129 introduced ordered parallel hashing and cross-checked Rust discovery against the Python walk; v0.7.180 made the Rust framework the default and added Go and patched C/C++ grammars. The supplied manifest is at 0.7.185 while the listed release is v0.7.180, consistent with source versions running ahead of published packages. Pin the tested artifact, especially when evaluating language coverage. For offline deployment, validate model inference and any optional semantic search dependencies separately from local graph storage.

Storage: an embedded SQLite graph by default, with Memgraph and Neo4j as opt-in Cypher backends.
Language analysis: Tree-sitter indexing under a unified schema, plus a pluggable ast-grep tier for structural coverage.
Retrieval: natural-language questions become Cypher queries; the optional semantic extra adds vector search.
Runtime evidence: cgr trace adds observed calls from test runs or production eBPF profiles to the graph.
Editing: the CLI and MCP expose code editing, with AST-based patching and a diff preview before changes.
Engine evolution: v0.7.180 enables the Rust engine framework by default, keeps Python as a fallback, and includes Go and patched C/C++ grammars.
Best For

Teams maintaining a multilingual monorepo that need answers grounded in call and import relationships, with a local index and optional MCP integration for reviewed edits.

Skip If

Keyword or similarity search already meets your needs, your critical languages only have structural coverage, or you cannot validate the client and model data paths against your source-handling policy.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

DockerMCPSelf-HostedCLI
# 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]"

Comparison vs. Top RAG, Data & Memory Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
code-graph-rag ★5.5k+20PythonMITGraph-backed RAG for querying and editing multilingual codebases
Scrapling107.9k+1.8kPythonBSD-3-ClausePython HTTP and browser crawlers that turn websites into RAG-ready Markdown
cognee33.8k+174PythonApache-2.0Graph and vector retrieval for persistent agent memory across sessions
crawl4ai88.5k+408PythonApache-2.0Async browser crawler that turns web pages into Markdown and JSON for RAG

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/vitali87/code-graph-rag.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

vitali87/code-graph-rag Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about code-graph-rag

How do I index a repository and connect an assistant?

Run cgr start --repo-path /path/to/repo --update-graph to build or refresh the index, then start an interactive session without --update-graph. The default index lives at ~/.cgr/graph.sqlite; set SQLITE_GRAPH_PATH to isolate it. MCP provides an alternative integration for clients such as Claude Code that need query or edit access.

Do I need a GPU, and how should I size the runtime?

No GPU requirement is specified for building the graph. Size indexing first by measuring CPU time, peak memory, and SQLite file growth on a representative checkout. Semantic search is optional; GPU and VRAM requirements for any locally run model depend on the model and concurrency. Also check native wheel availability for your CPython version and platform.

Can we self-host it for commercial work without sending source off-site?

Yes. The project is MIT-licensed and can be self-hosted with an embedded graph. Graph locality does not guarantee inference locality: verify where the model runs, what source context leaves the machine, and what filesystem permissions the MCP process has. Managed, on-premises, and air-gapped deployment services are separate offerings.

When is this a better fit than ripgrep or vector-only code RAG?

Use ripgrep when you know the symbol or text you are looking for, and vector retrieval when intent-based matching is enough. Choose this graph-first approach when answers need to follow explicit relationships, such as callers, imports, or reachability. Test those edges on your own languages and frameworks before relying on the agent's conclusions.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining vitali87/code-graph-rag? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature vitali87/code-graph-rag on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare