Code-Graph-RAG - AI-Powered Codebase Analysis
Open Source · 12 Languages · AI-Powered
Understand Any Codebase with AI-Powered Knowledge Graphs
Build comprehensive knowledge graphs from multi-language codebases using Tree-sitter parsing. Query, edit, and optimize your code with natural language.
$ claude mcp add code-graph-rag
✓ MCP server added successfully
$ Ask: "What functions handle authentication?"
Querying knowledge graph...
Found 3 functions across 2 files:
→ auth/login.py:authenticate_user (line 42)
→ auth/login.py:verify_token (line 87)
→ auth/middleware.py:require_auth (line 15)
Core Capabilities
Everything you need to understand your code
From parsing to optimization, Code-Graph-RAG provides a complete toolkit for codebase intelligence.
Multi-Language Parsing
Tree-sitter based AST parsing across 12 languages with unified graph schema for functions, classes, modules, and dependencies.
Knowledge Graph
Build interconnected graphs of your codebase structure — functions, classes, imports, and call relationships stored in Memgraph.
Natural Language Queries
Ask questions about your codebase in plain English. AI translates your intent into precise Cypher graph queries.
AI Code Editing
Surgical code replacement with AST-based function targeting, visual diff previews, and exact code block modifications.
Code Optimization
AI-powered codebase optimization with language-specific best practices and interactive approval workflow.
MCP Integration
Works as an MCP server with Claude Code. 10 tools for querying, editing, searching, and optimizing directly from your IDE.
Enterprise Services
Open source core, enterprise-grade support
Code-Graph-RAG is free and open source. For teams that need more, we offer dedicated support, consulting, and custom development.
Custom Knowledge Graph Relationships
Define bespoke edge types and relationship semantics tailored to your organization — going far beyond standard code relationships. Model compliance mappings, data lineage, team ownership, cost attribution, and domain-specific connections that turn your code graph into a strategic asset no competitor can replicate.
- Compliance traceability — link code to regulatory requirements (SOX, HIPAA, PCI-DSS)
- Data lineage & flow tracking across services and databases
- Security classification — flag PII handlers & map blast radius
- Team ownership & cost attribution at the code level
Cloud-Hosted & On-Prem Deployment
Fully managed cloud-hosted solutions for both the graph database and AI agent connection — zero infrastructure overhead. On-premise and air-gapped deployments also available for regulated environments.
- Managed cloud graph DB & agent
- On-premise deployment
- Air-gapped environments
Custom Development
Tailored features, new language parser development, and workflow optimization built to your exact specifications.
- Custom language parsers
- Proprietary features
- Performance tuning
Technical Support Contracts
Custom SLAs, priority issue resolution, and dedicated assistance from the team that builds Code-Graph-RAG.
- Guaranteed response times
- Direct access to core devs
- Priority bug fixes
Integration Consulting
Expert guidance deploying Code-Graph-RAG in your infrastructure and integrating with your CI/CD, IDEs, and toolchain.
- CI/CD pipeline setup
- Custom toolchain integration
- Workflow optimization
Training & Onboarding
Hands-on workshops to get your team productive fast — on-site or remote, customized to your stack and use cases.
- On-site or remote
- Custom training materials
- Advanced usage patterns
Language Support
12 languages, one unified graph
Parse any codebase with Tree-sitter grammars. Each language produces the same graph schema for consistent querying.
.py
Type inference ·Decorators ·Nested functions
.ts, .tsx
Interfaces ·Type aliases ·Enums
.js, .jsx
ES6 modules ·CommonJS ·Prototype methods
.rs
Impl blocks ·Associated functions ·Package detection
.java
Generics ·Annotations ·Records
.c
Functions ·Structs ·Unions
.cpp, .h, .hpp, .cc, .cxx, .hxx, .hh, .ixx, .cppm, .ccm
Templates ·Lambdas ·C++20 modules
.lua
Local/global functions ·Metatables ·Closures
.cs
Classes ·Interfaces ·Generics (planned)
.go
Methods ·Type declarations
.php
Classes ·Functions ·Namespaces
.scala, .sc
Case classes ·Objects
See It In Action
Interactive codebase exploration
Watch Code-Graph-RAG parse a codebase, build a knowledge graph, and answer natural language queries in real-time.

Works directly with Claude Code
Code-Graph-RAG runs as an MCP server, giving Claude Code 10 powerful tools to query, edit, and optimize your codebase using natural language.
# Add Code-Graph-RAG as an MCP server in Claude Code
claude mcp add code-graph-rag \
-e MEMGRAPH_HOST=localhost \
-e MEMGRAPH_PORT=7687 \
-- uv run --directory /path/to/code-graph-rag mcp_server.py
Available MCP Tools
query_codebase
Ask natural language questions about the codebase
get_function_code
Retrieve source code for specific functions
search_code
Search for code patterns across the codebase
replace_code
Surgically replace code in specific functions
optimize_codebase
AI-powered code optimization suggestions
get_graph_schema
View the knowledge graph schema
get_graph_stats
Get statistics about the parsed codebase
export_graph
Export the knowledge graph data
semantic_search
Intent-based code search using embeddings
execute_command
Run shell commands for testing and tooling
Verified
MseeP Security Assessment