gitmyhub

code-graph-rag

Python ★ 4.2k updated 6h ago

The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs

Code Graph RAG maps a multi-language codebase into a graph database so you can search, understand, and edit code using plain English questions.

PythonTree-sitterMemgraphQdrantMCPDockersetup: moderatecomplexity 4/5

Code Graph RAG is a tool that helps you understand and work with large codebases made up of many programming languages. Instead of asking you to read through thousands of files by hand, it scans your entire project and builds a map of how everything connects: which functions call which, which classes belong to which modules, and how pieces of code relate to one another. That map is stored in a graph database called Memgraph.

Once the map exists, you can ask questions about your code in plain English and get answers based on the actual structure of your project, not guesses. You can look up the real source code for any function or class by name or by describing what it does. You can also ask the tool to edit code for you: it makes precise, structural changes and shows you a preview of the difference before anything is applied. It can suggest improvements based on coding best practices, find code that is never used by tracing which parts of the program are actually reachable, and search for patterns in the code structure itself rather than just matching text.

Under the hood, the project uses a parsing library called Tree sitter to read source files and pull out their structure, then stores everything in the Memgraph graph database. A command line interface turns your questions into database queries, retrieves the relevant code, and manages the AI powered editing and cleanup features.

It works with many languages, including Python, TypeScript, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, and Dart, with support for more languages in progress. To use it you install the tool through PyPI, and you also need Docker to run the Memgraph database, along with a couple of smaller command line tools like cmake and ripgrep.

The project can also run as an MCP server, which means AI coding assistants such as Claude Code can connect to it directly and use its code understanding features while you work. It comes from an active open source project with continuous integration, test coverage tracking, and security scanning built into its workflow.

Where it fits