Documentation

Get started with Code-Graph-RAG

Everything you need to install, configure, and start using Code-Graph-RAG.

Quick Start

terminal
# 1. Clone the repository
git clone https://github.com/vitali87/code-graph-rag.git
cd code-graph-rag
# 2. Install dependencies (full multi-language support)
uv sync --extra treesitter-full
# 3. Set up environment
cp .env.example .env
# Edit .env with your API keys and configuration
# 4. Start Memgraph
docker compose up -d memgraph
# 5. Parse your codebase
uv run python -m codebase_rag.ingest /path/to/your/project
# 6. Start querying
uv run python -m codebase_rag.main

Claude Code / MCP Setup

terminal
# Add as 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
# Verify it's working
claude mcp list

Full Documentation

Environment Variables

VariableDescriptionDefault
ORCHESTRATOR_PROVIDERAI provider for orchestrator (ollama, openai, google)ollama
ORCHESTRATOR_MODELModel name for orchestratorllama3.2
ORCHESTRATOR_API_KEYAPI key (for cloud providers)
CYPHER_PROVIDERAI provider for Cypher generationollama
CYPHER_MODELModel name for Cypher generationcodellama
CYPHER_API_KEYAPI key (for cloud providers)
MEMGRAPH_HOSTMemgraph database hostlocalhost
MEMGRAPH_PORTMemgraph database port7687

Graph Schema

Node Types

TypeProperties
Functionname, file_path, line_number, end_line, source_code, language, is_method
Classname, file_path, line_number, end_line, language
Modulename, file_path, language
Filepath, language, size
Packagename, version, source

Relationships

TypeFrom → ToDescription
CALLSFunctionFunctionFunction invocation
CONTAINSModule/ClassFunction/ClassContainment hierarchy
IMPORTSModuleModuleImport/require relationships
INHERITSClassClassClass inheritance
IMPLEMENTSClassClassInterface implementation