Verified project record
vitali87/code-graph-rag
This project parses multi-language codebases into a Memgraph knowledge graph using Tree-sitter, enabling developers to query, edit, and analyze code through natural language and AST patterns. It operates as an interactive CLI or MCP server and requires external services including Docker, a graph database, a vector database, and an AI model.
Project overview
Provides a unified graph schema for multi-language monorepos to perform natural language queries, structural rewrites, and data-flow tracing.
- Project type
- MCP · AI Coding · RAG
- Use cases
- Knowledge Q&A · Search & Research · Coding & Development
- Deployment
- Refer to project documentation
- License
- MIT
Best for
- Developers and enterprise teams working within large, multi-language monorepos who need structural code analysis and natural language retrieval.
Key capabilities
- Parses source code with Tree-sitter and ingests structures and relationships into a Memgraph knowledge graph.
- Interactive CLI that turns natural language into Cypher queries to retrieve matching code and get answers.
- Edits code through an agent with AST-based surgical patching and diff previews.
- Finds and rewrites code by AST pattern using ast-grep to match and transform structure across the codebase.
- Finds dead code by walking call and reference edges from entry points.
- Runs as an MCP server allowing MCP clients to query and edit the codebase directly.
- Follows values through assignments, function calls, and I/O sinks using FLOWS_TO taint edges.
- Optimises code against language best practices or custom coding standards.
Limitations and risks
- Setup requires Docker, cmake, and ripgrep, and the orchestration relies on external Memgraph and Qdrant databases.
- Natural language querying and AI code editing require an AI model for Cypher generation and code modifications. The cost and specific external deployment requirements for this model are not documented.
Getting started
- Install via uv or pipx, ensure Docker, cmake, and ripgrep prerequisites are met, start the daemon using `cgr daemon up`, and run `cgr start --repo-path /path/to/repo` to parse the target repository.
Alternatives and comparisons
- Provides code intelligence and graph querying capabilities for local repositories as an alternative approach.
- Offers codebase knowledge graph indexing and MCP tool integration for AI agents.
- Indexes codebases for symbol retrieval to provide context to AI agents.
Project comparisons
Evidence and sources
- GitHub project description: The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
- README: 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…
- README: - 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…
- README: An interactive CLI that turns natural language into Cypher queries, retrieves matching code, and drives AI-powered editing and optimisation.
- README: 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…
AI Search
Find projects, verify facts, compare options, or turn a complex need into an actionable plan
Try a searchA click only fills the search box; you stay in control
Project Details
0