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. - Ruby Support: Ruby joins the graph through a new pluggable ast-grep tier that adds a language from a single YAML pattern file, emitt
Add this skill
npx mdskills install vitali87/code-graph-rag@vitali87? Sign in with GitHub to claim this listing.Multi-language codebase parser with graph knowledge base and natural language RAG query interface
1<div align="center">2 <!-- Bitbucket strips <picture>/<source> tags, so we use a single light-mode <img>. Restore the theme-aware <picture> block below when the GitHub account is reinstated:3 <picture>4 <source srcset="assets/logo-dark-any.png" media="(prefers-color-scheme: dark)">5 <source srcset="assets/logo-light-any.png" media="(prefers-color-scheme: light)">6 <img src="assets/logo-dark-any.png" alt="Code-Graph-RAG Logo" width="480">7 </picture>8 -->9 <img src="assets/logo-light-any.png" alt="Code-Graph-RAG Logo" width="480">1011 <p>12 <!-- Badges below are commented out while the GitHub account is suspended. Restore them when the account is reinstated.13 Stars/Forks: shields.io hits GitHub's API (returns "repo not found" for suspended accounts).14 gitcgr: indexes from GitHub (shows "not indexed" while unavailable).15 MseeP.ai: badge PNG ignores inline height on Bitbucket and renders as a full-size tile.16 <a href="https://github.com/vitali87/code-graph-rag/stargazers">17 <img src="https://img.shields.io/github/stars/vitali87/code-graph-rag?style=social" alt="GitHub stars" />18 </a>19 <a href="https://github.com/vitali87/code-graph-rag/network/members">20 <img src="https://img.shields.io/github/forks/vitali87/code-graph-rag?style=social" alt="GitHub forks" />21 </a>22 -->23 <!-- Codecov, SonarCloud, and OpenSSF Scorecard badges are fed by GitHub-side CI. Uncomment once that CI is confirmed to publish to these services again.24 <a href="https://codecov.io/gh/vitali87/code-graph-rag">25 <img src="https://codecov.io/gh/vitali87/code-graph-rag/graph/badge.svg" alt="Codecov" />26 </a>27 <a href="https://sonarcloud.io/summary/overall?id=vitali87_code-graph-rag">28 <img src="https://sonarcloud.io/api/project_badges/measure?project=vitali87_code-graph-rag&metric=alert_status" alt="Quality Gate Status" />29 </a>30 -->31 <!--32 <a href="https://mseep.ai/app/vitali87-code-graph-rag">33 <img src="https://mseep.net/pr/vitali87-code-graph-rag-badge.png" alt="MseeP.ai Security Assessment" height="20" />34 </a>35 -->36 <a href="https://code-graph-rag.com">37 <img src="https://img.shields.io/badge/Enterprise-Support%20%26%20Services-6366f1" alt="Enterprise Support" />38 </a>39 <a href="https://pepy.tech/projects/code-graph-rag">40 <img src="https://static.pepy.tech/personalized-badge/code-graph-rag?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads" alt="PyPI Downloads" />41 </a>42 <!-- OpenSSF Scorecard only tracks GitHub-hosted repos. Uncomment once the Scorecard workflow is confirmed running on the authoritative GitHub repo.43 <a href="https://scorecard.dev/viewer/?uri=github.com/vitali87/code-graph-rag">44 <img src="https://api.scorecard.dev/projects/github.com/vitali87/code-graph-rag/badge" alt="OpenSSF Scorecard" />45 </a>46 -->47 <!--48 <a href="https://gitcgr.com/vitali87/code-graph-rag">49 <img src="https://gitcgr.com/badge/vitali87/code-graph-rag.svg" alt="gitcgr" />50 </a>51 -->52</p>53</div>5455# Code-Graph-RAG5657Code-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.5859<p align="center">60 <img src="./assets/demo.gif" alt="demo">61</p>6263## Latest News 🔥6465<!-- SECTION:latest_news -->66- **Ruby Support**: Ruby joins the graph through a new pluggable ast-grep tier that adds a language from a single YAML pattern file, emitting `Module`, `Function`, and `Class` nodes plus import edges without a hand-written parser.67- **Structural Search & Replace**: Find and rewrite code by AST pattern with ast-grep, exposed as agent tools so you can match and transform structure across the whole codebase instead of relying on text or regex.68- **Data-Flow Tracing**: New `FLOWS_TO` taint edges follow values through assignments, function calls, and I/O sinks, with coverage across C#, Java, C, and Go.69<!-- /SECTION:latest_news -->7071See [NEWS.md](NEWS.md) for the full history.7273## What It Does7475Point 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:7677- Ask questions about the codebase in natural language and get answers grounded in the real structure.78- Retrieve the actual source of any function, class, or method by name or by intent.79- Edit code through the agent with AST-based surgical patching and a diff preview before anything changes.80- Optimise code against language best practices or your own coding standards.81- Find dead code by walking call and reference edges from entry points.82- Search and rewrite structurally by AST pattern with ast-grep.8384## How It Works8586The system has two components:87881. **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.892. **RAG system** (`codebase_rag/`). An interactive CLI that turns natural language into Cypher queries, retrieves matching code, and drives AI-powered editing and optimisation.9091```92Source Code -> Tree-sitter Parser -> AST Analysis -> Memgraph Knowledge Graph93 |94User Query -> AI Model (Cypher Gen) -> Cypher Query -> Graph Results -> Response95```9697See the [Architecture Overview](docs/architecture/overview.md) and [Graph Schema](docs/architecture/graph-schema.md) for the full picture.9899## Supported Languages100101Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, and Dart are fully supported. Scala is in development, and Ruby has structural support (modules, functions, classes, and imports) through the pluggable ast-grep tier. See the [Language Support](docs/architecture/language-support.md) matrix for per-language capabilities.102103## Installation104105`cgr` is published to PyPI. Install it system-wide with the `treesitter-full` (all languages) and `semantic` (vector search) extras:106107```bash108# with uv (recommended)109uv tool install "code-graph-rag[treesitter-full,semantic]"110111# or with pipx112pipx install "code-graph-rag[treesitter-full,semantic]"113```114115You also need Docker (for Memgraph), `cmake`, and `ripgrep`. Full prerequisites, source installs, and environment setup are in the [Installation](docs/getting-started/installation.md) guide.116117## Quick Start118119```bash120# Start the packaged Memgraph + Qdrant stack (no compose file needed)121cgr daemon up122123# Parse a repository into the graph, then query it124cgr start --repo-path /path/to/repo --update-graph --clean125cgr start --repo-path /path/to/repo126```127128The [Quick Start](docs/getting-started/quickstart.md) guide walks through parsing, querying, and exporting in five minutes.129130## MCP Server131132Code-Graph-RAG runs as an [MCP](https://modelcontextprotocol.io) server so Claude Code and other MCP clients can query and edit your codebase directly. See the [MCP Server](docs/guide/mcp-server.md) guide for setup.133134## Documentation135136**Getting Started**137- [Installation](docs/getting-started/installation.md)138- [Quick Start](docs/getting-started/quickstart.md)139- [Configuration](docs/getting-started/configuration.md)140141**User Guide**142- [CLI Reference](docs/guide/cli-reference.md)143- [Interactive Querying](docs/guide/interactive-querying.md)144- [Code Optimisation](docs/guide/code-optimization.md)145- [Dead Code Detection](docs/guide/dead-code.md)146- [Graph Export](docs/guide/graph-export.md)147- [Real-Time Updates](docs/guide/realtime-updates.md)148- [MCP Server](docs/guide/mcp-server.md)149150**Architecture**151- [Overview](docs/architecture/overview.md)152- [Graph Schema](docs/architecture/graph-schema.md)153- [Language Support](docs/architecture/language-support.md)154- [Data-Flow Edges](docs/architecture/data-flow-edges.md)155156**Python SDK**157- [Overview](docs/sdk/overview.md)158- [Graph Loader](docs/sdk/graph-loader.md)159- [Cypher Generator](docs/sdk/cypher-generator.md)160- [Semantic Search](docs/sdk/semantic-search.md)161162**Advanced**163- [Adding Languages](docs/advanced/adding-languages.md)164- [Ignore Patterns](docs/advanced/ignore-patterns.md)165- [Building Binaries](docs/advanced/building-binaries.md)166- [Troubleshooting](docs/advanced/troubleshooting.md)167168## Enterprise Services169170Code-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**:171172- **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.173- **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.174175We also offer custom development, integration consulting, technical support contracts, and team training.176177**[View plans & pricing at code-graph-rag.com](https://code-graph-rag.com/enterprise)**178179## Contributing180181Please see [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines. Good first PRs come from the TODO issues.182183## Support184185For issues or questions, check the [Troubleshooting](docs/advanced/troubleshooting.md) guide first, then open an issue.186187## License188189MIT. See [LICENSE](LICENSE).190
Full transparency — inspect the skill content before installing.