What is code-graph-rag?
code-graph-rag is an open-source project for querying, understanding and editing multi-language codebases with AI and knowledge graphs. code-graph-rag targets repositories and mixed-language monorepos, representing their structure under a unified graph schema. Developers can ask questions in plain English and retrieve answers grounded in the functions, classes, methods, modules and relationships extracted from source files.
code-graph-rag combines a Tree-sitter-based parser with an interactive retrieval-augmented generation system. Compiler-grade frontends and runtime traces can supplement the parsed structure where available. The default graph lives in an embedded SQLite file, so the standard database setup does not require a separate server, Docker or cmake.
What code-graph-rag can do
code-graph-rag connects code retrieval, analysis and editing to a graph of repository structure. Natural-language questions are translated into Cypher queries that retrieve relevant graph results and source code. Beyond answering questions, the agent can make targeted edits, while structural analysis and runtime information support investigation of dependencies and code behaviour.
- code-graph-rag retrieves function, class and method source by name or intent.
- code-graph-rag applies AST-based surgical patches with a diff preview before changes.
- code-graph-rag optimises code against language best practices or supplied coding standards.
- code-graph-rag detects dead code by following call and reference edges from entry points.
- code-graph-rag searches and rewrites AST patterns through ast-grep.
- code-graph-rag merges observed runtime calls from test traces or production eBPF profiles into the graph.
How code-graph-rag works
code-graph-rag is published to PyPI and can be installed with uv or pipx, with extras for Tree-sitter grammars, ast-grep and semantic vector search. Developers index a repository using cgr start with its repository path and the --update-graph option, then run cgr start against that path to ask questions and edit code.
code-graph-rag stores indexed projects in a shared graph by default, and syncing a project leaves other indexed projects intact. Memgraph and Neo4j are optional backends. The MCP server exposes codebase querying and editing to Claude Code and other MCP clients, while the default embedded backend avoids running a separate database service.
Who code-graph-rag is for
code-graph-rag serves developers and teams that need to understand or modify repositories spanning multiple programming languages. Organisations with deployment constraints can also obtain on-premise or air-gapped deployments. The documented workflows cover codebase questions, source retrieval, code optimisation, dead code detection and runtime call tracing rather than a single programming language or repository layout.
- Developers can investigate code structure through natural-language questions.
- Teams can query mixed-language monorepos through a unified graph schema.
- Developers can review targeted patches before changing source files.
- Security-sensitive organisations can deploy within their own environments.
code-graph-rag pricing and plans
code-graph-rag is open source and free to use under the MIT licence. The repository provides installation instructions for the published package and for running newer code directly from Git. Enterprise offerings include managed cloud hosting for the graph database and AI agent connection, plus on-premise and air-gapped deployment options.
code-graph-rag also offers custom development, integration consulting, technical support contracts and team training. The repository directs organisations to the project website for plans and pricing but does not list enterprise prices. The free project and the enterprise services are described separately, so no enterprise subscription is stated as necessary for using the open-source software.
code-graph-rag strengths and limitations
code-graph-rag combines a server-free default graph, multi-language parsing and previewable code edits. The analysis can combine static structure with compiler-derived facts and observed runtime calls. Coverage still depends on language support, available toolchains and what code actually runs; the repository explicitly distinguishes full language support from structural support and features still in development.
- code-graph-rag requires Python 3.12+ and ripgrep.
- code-graph-rag requires its native extension, available for the documented Linux, macOS and Windows architectures.
- code-graph-rag lists Scala support as in development and several other languages as structurally supported.
- code-graph-rag traces only executed code, and compiler frontends only cover code their toolchains can build.
- code-graph-rag deletes every project in the shared graph when the --clean option is used.
code-graph-rag FAQ
What is code-graph-rag?
code-graph-rag is an open-source code analysis and retrieval-augmented generation project that builds knowledge graphs from multi-language repositories. code-graph-rag lets developers ask natural-language questions, retrieve source code, edit code and analyse relationships through an interactive CLI or MCP server.
Is code-graph-rag free?
code-graph-rag is free to use and distributed under the MIT licence. code-graph-rag also offers enterprise services, including managed cloud hosting, on-premise and air-gapped deployments, custom development, integration consulting, support contracts and training. Enterprise pricing figures are not listed in the repository text.
Does code-graph-rag work with Claude Code?
code-graph-rag runs as an MCP server so Claude Code and other MCP clients can query and edit a codebase directly. code-graph-rag provides an MCP Server guide for setup and also offers an interactive CLI for natural-language querying, editing and optimisation.
Does code-graph-rag need a database server?
code-graph-rag does not require a database server by default because the graph is stored in an embedded SQLite file. code-graph-rag also supports Memgraph and Neo4j as optional graph backends, with separate configuration and setup instructions for those alternatives.
Which programming languages does code-graph-rag support?
code-graph-rag fully supports Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, Dart and Julia. code-graph-rag lists Scala as in development and provides structural support for Ruby, Kotlin, Swift, Elixir, Haskell, Solidity, Bash and Nix through the pluggable ast-grep tier.
What are the installation requirements for code-graph-rag?
code-graph-rag requires Python 3.12+, ripgrep and its native cgr-graph-rs extension. code-graph-rag publishes installation instructions using uv or pipx, and the native extension ships for supported Linux architectures, macOS and Windows x64. Optional installation extras add grammars, structural language support and vector search.
From the community
No reviews yet
Be the first to review this tool. What you write helps the next person choose.




