Code-Graph-RAG Gives AI Agents a Real Map to Stop Hallucinating Monorepos
An open-source tool parses your monorepo with Tree-sitter, builds a Memgraph knowledge graph, and hooks into Claude Code via MCP.
PRO- Code-Graph-RAG turns monorepos into a queryable Memgraph knowledge graph via Tree-sitter parsing.
- Runs as an MCP server for Claude Code with 15 tools for querying and editing.
- 14 languages supported with a unified graph schema, plus YAML-based ast-grep tier for new ones.
- Runtime call tracing merges real calls, including eBPF profiles from Parca or Pyroscope, into the graph.
- Semantic search with UniXcoder embeddings finds functions by intent, not exact name.
- MIT-licensed open-source core with enterprise cloud, on-prem, and custom parser services.
Coding agents love to hallucinate about files they never opened. Point them at a monorepo and they will confidently rewrite a function whose callers they know nothing about. Code-Graph-RAG tackles that by handing the agent a real map instead of a peephole into a handful of files.
The project is open-source, MIT-licensed, and has been climbing GitHub trending at roughly 4,700 stars. It 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 across a monorepo of mixed languages under one unified schema.
From files to a queryable graph
The core loop is simple. Point it 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 that graph exists, the agent no longer has to guess which function calls which. It walks edges.
That structural view unlocks a set of operations that plain vector RAG struggles with:
- Ask questions about the codebase in natural language and get answers grounded in the real structure, or retrieve the actual source of any function, class, or method by name or by intent.
This story is for Pro members
You've reached the end of the free preview. Upgrade to AlphaSignal Pro to read the full article - and everything else behind the paywall.