V
vitali87/code-graph-rag
The ultimate RAG for your monorepo
View on GitHub ↗Link checked 2026-11-12 · HTTP 200 · opens the vendor's own site
Official descriptionThe ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
- Star count
- 5,354 ★ · vitali87/code-graph-rag · read from the GitHub search API · (checked 2026-11-13 20:00:50)
- Source
- read directly from its GitHub page · type: open-source project
- Harvest history
- first seen 2026-10-26 · last seen 2026-11-14 · seen 23× · listed by 1 sources
- Score
- score 114 · 5,354 ★ · 1 sources · repo
FAQ (answers come from our records)
Who is it for?
We filed it under these tags: 开源项目. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository
vitali87/code-graph-rag;first catalogued 2026-10-26;last seen 2026-11-14。There is no official certification or quality rating here — we record sources and dates only.# Code-Graph-RAG
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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.
1. Index: cgr start --update-graph parses a repository into a knowledge graph (sped up)
2. Ask: cgr start answers questions and edits code, grounded in that graph
## Latest News 🔥
Security Enhancements: Incorporates an OSS Scanner build image and threat model.
Data Export: Ensures all node properties within the graph are exported.
SQL Fixes: Addresses several SQL-related issues including grammar errors and dead-code roots.
Rust Fixes: Improves indexing of methods and handling of types in Rust code.
Build Fixes: Repairs build issues related to eMudhra root certificates and distrusted components.
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 (codebaserag/). 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.
1. Index: cgr start --update-graph parses a repository into a knowledge graph (sped up)
2. Ask: cgr start answers questions and edits code, grounded in that graph
## Latest News 🔥
Security Enhancements: Incorporates an OSS Scanner build image and threat model.
Data Export: Ensures all node properties within the graph are exported.
SQL Fixes: Addresses several SQL-related issues including grammar errors and dead-code roots.
Rust Fixes: Improves indexing of methods and handling of types in Rust code.
Build Fixes: Repairs build issues related to eMudhra root certificates and distrusted components.
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 (codebaserag/). 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.
Listed badge (optional)
Copy this line into the README if you want the listing mark. Optional, and it does not affect being listed.
[](https://anclum.com/en/s/vitali87-code-graph-rag/)
- Source
- github · https://github.com/vitali87/code-graph-rag
- Browse by field
- Open source
- Traction
- 5,354 ★
- added
- today
More like this
Filed under
Every tag opens the full list for that filter. Counts are the live catalogue figures.