code-graph-rag 0.0.79__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,948 @@
1
+ Metadata-Version: 2.4
2
+ Name: code-graph-rag
3
+ Version: 0.0.79
4
+ Summary: The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
5
+ License-Expression: MIT
6
+ Keywords: rag,retrieval-augmented-generation,knowledge-graph,code-analysis,tree-sitter,mcp,mcp-server,llm,graph-database,semantic-search,codebase,memgraph,developer-tools,monorepo
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Environment :: Console
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
12
+ Classifier: Topic :: Software Development :: Code Generators
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Python: >=3.12
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: loguru>=0.7.3
21
+ Requires-Dist: mcp>=1.21.1
22
+ Requires-Dist: pydantic-ai>=1.27.0
23
+ Requires-Dist: pydantic-settings>=2.0.0
24
+ Requires-Dist: pymgclient>=1.4.0
25
+ Requires-Dist: python-dotenv>=1.1.0
26
+ Requires-Dist: toml>=0.10.2
27
+ Requires-Dist: tree-sitter-python>=0.23.6
28
+ Requires-Dist: tree-sitter==0.25.0
29
+ Requires-Dist: watchdog>=6.0.0
30
+ Requires-Dist: typer>=0.12.5
31
+ Requires-Dist: rich>=13.7.1
32
+ Requires-Dist: prompt-toolkit>=3.0.0
33
+ Requires-Dist: diff-match-patch>=20241021
34
+ Requires-Dist: click>=8.0.0
35
+ Requires-Dist: protobuf>=5.27.0
36
+ Requires-Dist: defusedxml>=0.7.1
37
+ Requires-Dist: huggingface-hub[hf-xet]>=0.36.0
38
+ Provides-Extra: test
39
+ Requires-Dist: pytest>=8.4.1; extra == "test"
40
+ Requires-Dist: pytest-asyncio>=1.0.0; extra == "test"
41
+ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
42
+ Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
43
+ Requires-Dist: testcontainers>=4.9.0; extra == "test"
44
+ Provides-Extra: treesitter-full
45
+ Requires-Dist: tree-sitter-python>=0.23.6; extra == "treesitter-full"
46
+ Requires-Dist: tree-sitter-javascript>=0.23.1; extra == "treesitter-full"
47
+ Requires-Dist: tree-sitter-typescript>=0.23.2; extra == "treesitter-full"
48
+ Requires-Dist: tree-sitter-rust>=0.24.0; extra == "treesitter-full"
49
+ Requires-Dist: tree-sitter-go>=0.23.4; extra == "treesitter-full"
50
+ Requires-Dist: tree-sitter-scala>=0.24.0; extra == "treesitter-full"
51
+ Requires-Dist: tree-sitter-java>=0.23.5; extra == "treesitter-full"
52
+ Requires-Dist: tree-sitter-cpp>=0.23.0; extra == "treesitter-full"
53
+ Requires-Dist: tree-sitter-lua>=0.0.19; extra == "treesitter-full"
54
+ Provides-Extra: semantic
55
+ Requires-Dist: qdrant-client>=1.9.0; extra == "semantic"
56
+ Requires-Dist: torch>=2.6.0; extra == "semantic"
57
+ Requires-Dist: transformers>=4.0.0; extra == "semantic"
58
+ Dynamic: license-file
59
+
60
+ <div align="center">
61
+ <picture>
62
+ <source srcset="assets/logo-dark-any.png" media="(prefers-color-scheme: dark)">
63
+ <source srcset="assets/logo-light-any.png" media="(prefers-color-scheme: light)">
64
+ <img src="assets/logo-dark-any.png" alt="Code-Graph-RAG Logo" width="480">
65
+ </picture>
66
+
67
+ <p>
68
+ <a href="https://github.com/vitali87/code-graph-rag/stargazers">
69
+ <img src="https://img.shields.io/github/stars/vitali87/code-graph-rag?style=social" alt="GitHub stars" />
70
+ </a>
71
+ <a href="https://github.com/vitali87/code-graph-rag/network/members">
72
+ <img src="https://img.shields.io/github/forks/vitali87/code-graph-rag?style=social" alt="GitHub forks" />
73
+ </a>
74
+ <a href="https://github.com/vitali87/code-graph-rag/blob/main/LICENSE">
75
+ <img src="https://img.shields.io/github/license/vitali87/code-graph-rag" alt="License" />
76
+ </a>
77
+ <a href="https://mseep.ai/app/vitali87-code-graph-rag">
78
+ <img src="https://mseep.net/pr/vitali87-code-graph-rag-badge.png" alt="MseeP.ai Security Assessment" height="20" />
79
+ </a>
80
+ <a href="https://code-graph-rag.com">
81
+ <img src="https://img.shields.io/badge/Enterprise-Support%20%26%20Services-6366f1" alt="Enterprise Support" />
82
+ </a>
83
+ </p>
84
+ </div>
85
+
86
+ # Code-Graph-RAG: A Graph-Based RAG System for Any Codebases
87
+
88
+ An accurate Retrieval-Augmented Generation (RAG) system that analyzes multi-language codebases using Tree-sitter, builds comprehensive knowledge graphs, and enables natural language querying of codebase structure and relationships as well as editing capabilities.
89
+
90
+
91
+ <p align="center">
92
+ <img src="./assets/demo.gif" alt="demo">
93
+ </p>
94
+
95
+ ## Latest News 🔥
96
+
97
+ - **[NEW]** **MCP Server Integration**: Code-Graph-RAG now works as an MCP server with Claude Code! Query and edit your codebase using natural language directly from Claude Code. [Setup Guide](docs/claude-code-setup.md)
98
+ - [2025/10/21] **Semantic Code Search**: Added intent-based code search using UniXcoder embeddings. Find functions by describing what they do (e.g., "error handling functions", "authentication code") rather than by exact names.
99
+
100
+ ## 🚀 Features
101
+
102
+ - **Multi-Language Support**:
103
+
104
+ <!-- SECTION:supported_languages -->
105
+ | Language | Status | Extensions | Functions | Classes/Structs | Modules | Package Detection | Additional Features |
106
+ |--------|------|----------|---------|---------------|-------|-----------------|-------------------|
107
+ | C++ | Fully Supported | .cpp, .h, .hpp, .cc, .cxx, .hxx, .hh, .ixx, .cppm, .ccm | ✓ | ✓ | ✓ | ✓ | Constructors, destructors, operator overloading, templates, lambdas, C++20 modules, namespaces |
108
+ | Java | Fully Supported | .java | ✓ | ✓ | ✓ | - | Generics, annotations, modern features (records/sealed classes), concurrency, reflection |
109
+ | JavaScript | Fully Supported | .js, .jsx | ✓ | ✓ | ✓ | - | ES6 modules, CommonJS, prototype methods, object methods, arrow functions |
110
+ | Lua | Fully Supported | .lua | ✓ | - | ✓ | - | Local/global functions, metatables, closures, coroutines |
111
+ | Python | Fully Supported | .py | ✓ | ✓ | ✓ | ✓ | Type inference, decorators, nested functions |
112
+ | Rust | Fully Supported | .rs | ✓ | ✓ | ✓ | ✓ | impl blocks, associated functions |
113
+ | TypeScript | Fully Supported | .ts, .tsx | ✓ | ✓ | ✓ | - | Interfaces, type aliases, enums, namespaces, ES6/CommonJS modules |
114
+ | C# | In Development | .cs | ✓ | ✓ | ✓ | - | Classes, interfaces, generics (planned) |
115
+ | Go | In Development | .go | ✓ | ✓ | ✓ | - | Methods, type declarations |
116
+ | PHP | In Development | .php | ✓ | ✓ | ✓ | - | Classes, functions, namespaces |
117
+ | Scala | In Development | .scala, .sc | ✓ | ✓ | ✓ | - | Case classes, objects |
118
+ <!-- /SECTION:supported_languages -->
119
+ - **🌳 Tree-sitter Parsing**: Uses Tree-sitter for robust, language-agnostic AST parsing
120
+ - **📊 Knowledge Graph Storage**: Uses Memgraph to store codebase structure as an interconnected graph
121
+ - **🗣️ Natural Language Querying**: Ask questions about your codebase in plain English
122
+ - **🤖 AI-Powered Cypher Generation**: Supports both cloud models (Google Gemini), local models (Ollama), and OpenAI models for natural language to Cypher translation
123
+ - **🤖 OpenAI Integration**: Leverage OpenAI models to enhance AI functionalities.
124
+ - **📝 Code Snippet Retrieval**: Retrieves actual source code snippets for found functions/methods
125
+ - **✍️ Advanced File Editing**: Surgical code replacement with AST-based function targeting, visual diff previews, and exact code block modifications
126
+ - **⚡️ Shell Command Execution**: Can execute terminal commands for tasks like running tests or using CLI tools.
127
+ - **🚀 Interactive Code Optimization**: AI-powered codebase optimization with language-specific best practices and interactive approval workflow
128
+ - **📚 Reference-Guided Optimization**: Use your own coding standards and architectural documents to guide optimization suggestions
129
+ - **🔗 Dependency Analysis**: Parses `pyproject.toml` to understand external dependencies
130
+ - **🎯 Nested Function Support**: Handles complex nested functions and class hierarchies
131
+ - **🔄 Language-Agnostic Design**: Unified graph schema across all supported languages
132
+
133
+ ## 🏗️ Architecture
134
+
135
+ The system consists of two main components:
136
+
137
+ 1. **Multi-language Parser**: Tree-sitter based parsing system that analyzes codebases and ingests data into Memgraph
138
+ 2. **RAG System** (`codebase_rag/`): Interactive CLI for querying the stored knowledge graph
139
+
140
+
141
+ ## 📋 Prerequisites
142
+
143
+ - Python 3.12+
144
+ - Docker & Docker Compose (for Memgraph)
145
+ - **cmake** (required for building pymgclient dependency)
146
+ - **ripgrep** (`rg`) (required for shell command text searching)
147
+ - **For cloud models**: Google Gemini API key
148
+ - **For local models**: Ollama installed and running
149
+ - `uv` package manager
150
+
151
+ ### Installing cmake and ripgrep
152
+
153
+ On macOS:
154
+ ```bash
155
+ brew install cmake ripgrep
156
+ ```
157
+
158
+ On Linux (Ubuntu/Debian):
159
+ ```bash
160
+ sudo apt-get update
161
+ sudo apt-get install cmake ripgrep
162
+ ```
163
+
164
+ On Linux (CentOS/RHEL):
165
+ ```bash
166
+ sudo yum install cmake
167
+ sudo dnf install ripgrep
168
+ # Note: ripgrep may need to be installed from EPEL or via cargo
169
+ ```
170
+
171
+ ## 🛠️ Installation
172
+
173
+ ```bash
174
+ git clone https://github.com/vitali87/code-graph-rag.git
175
+
176
+ cd code-graph-rag
177
+ ```
178
+
179
+ 2. **Install dependencies**:
180
+
181
+ For basic Python support:
182
+ ```bash
183
+ uv sync
184
+ ```
185
+
186
+ For full multi-language support:
187
+ ```bash
188
+ uv sync --extra treesitter-full
189
+ ```
190
+
191
+ For development (including tests and pre-commit hooks):
192
+ ```bash
193
+ make dev
194
+ ```
195
+
196
+ This installs all dependencies and sets up pre-commit hooks automatically.
197
+
198
+ This installs Tree-sitter grammars for all supported languages (see Multi-Language Support section).
199
+
200
+ 3. **Set up environment variables**:
201
+ ```bash
202
+ cp .env.example .env
203
+ # Edit .env with your configuration (see options below)
204
+ ```
205
+
206
+ ### Configuration Options
207
+
208
+ The new provider-explicit configuration supports mixing different providers for orchestrator and cypher models.
209
+
210
+ #### Option 1: All Ollama (Local Models)
211
+
212
+ ```bash
213
+ # .env file
214
+ ORCHESTRATOR_PROVIDER=ollama
215
+ ORCHESTRATOR_MODEL=llama3.2
216
+ ORCHESTRATOR_ENDPOINT=http://localhost:11434/v1
217
+
218
+ CYPHER_PROVIDER=ollama
219
+ CYPHER_MODEL=codellama
220
+ CYPHER_ENDPOINT=http://localhost:11434/v1
221
+ ```
222
+
223
+ #### Option 2: All OpenAI Models
224
+ ```bash
225
+ # .env file
226
+ ORCHESTRATOR_PROVIDER=openai
227
+ ORCHESTRATOR_MODEL=gpt-4o
228
+ ORCHESTRATOR_API_KEY=sk-your-openai-key
229
+
230
+ CYPHER_PROVIDER=openai
231
+ CYPHER_MODEL=gpt-4o-mini
232
+ CYPHER_API_KEY=sk-your-openai-key
233
+ ```
234
+
235
+ #### Option 3: All Google Models
236
+ ```bash
237
+ # .env file
238
+ ORCHESTRATOR_PROVIDER=google
239
+ ORCHESTRATOR_MODEL=gemini-2.5-pro
240
+ ORCHESTRATOR_API_KEY=your-google-api-key
241
+
242
+ CYPHER_PROVIDER=google
243
+ CYPHER_MODEL=gemini-2.5-flash
244
+ CYPHER_API_KEY=your-google-api-key
245
+ ```
246
+
247
+ #### Option 4: Mixed Providers
248
+ ```bash
249
+ # .env file - Google orchestrator + Ollama cypher
250
+ ORCHESTRATOR_PROVIDER=google
251
+ ORCHESTRATOR_MODEL=gemini-2.5-pro
252
+ ORCHESTRATOR_API_KEY=your-google-api-key
253
+
254
+ CYPHER_PROVIDER=ollama
255
+ CYPHER_MODEL=codellama
256
+ CYPHER_ENDPOINT=http://localhost:11434/v1
257
+ ```
258
+
259
+ Get your Google API key from [Google AI Studio](https://aistudio.google.com/app/apikey).
260
+
261
+ **Install and run Ollama**:
262
+ ```bash
263
+ # Install Ollama (macOS/Linux)
264
+ curl -fsSL https://ollama.ai/install.sh | sh
265
+
266
+ # Pull required models
267
+ ollama pull llama3.2
268
+ # Or try other models like:
269
+ # ollama pull llama3
270
+ # ollama pull mistral
271
+ # ollama pull codellama
272
+
273
+ # Ollama will automatically start serving on localhost:11434
274
+ ```
275
+
276
+ > **Note**: Local models provide privacy and no API costs, but may have lower accuracy compared to cloud models like Gemini.
277
+
278
+ 4. **Start Memgraph database**:
279
+ ```bash
280
+ docker-compose up -d
281
+ ```
282
+
283
+ ## 🛠️ Makefile Commands
284
+
285
+ Use the Makefile for common development tasks:
286
+
287
+ <!-- SECTION:makefile_commands -->
288
+ | Command | Description |
289
+ |-------|-----------|
290
+ | `make help` | Show this help message |
291
+ | `make all` | Install everything for full development environment (deps, grammars, hooks, tests) |
292
+ | `make install` | Install project dependencies with full language support |
293
+ | `make python` | Install project dependencies for Python only |
294
+ | `make dev` | Setup development environment (install deps + pre-commit hooks) |
295
+ | `make test` | Run unit tests only (fast, no Docker) |
296
+ | `make test-parallel` | Run unit tests in parallel (fast, no Docker) |
297
+ | `make test-integration` | Run integration tests (requires Docker) |
298
+ | `make test-all` | Run all tests including integration and e2e (requires Docker) |
299
+ | `make test-parallel-all` | Run all tests in parallel including integration and e2e (requires Docker) |
300
+ | `make clean` | Clean up build artifacts and cache |
301
+ | `make build-grammars` | Build grammar submodules |
302
+ | `make watch` | Watch repository for changes and update graph in real-time |
303
+ | `make readme` | Regenerate README.md from codebase |
304
+ | `make lint` | Run ruff check |
305
+ | `make format` | Run ruff format |
306
+ | `make typecheck` | Run type checking with ty |
307
+ | `make check` | Run all checks: lint, typecheck, test |
308
+ | `make pre-commit` | Run all pre-commit checks locally (comprehensive test before commit) |
309
+ <!-- /SECTION:makefile_commands -->
310
+
311
+ ## 🎯 Usage
312
+
313
+ The Code-Graph-RAG system offers four main modes of operation:
314
+ 1. **Parse & Ingest**: Build knowledge graph from your codebase
315
+ 2. **Interactive Query**: Ask questions about your code in natural language
316
+ 3. **Export & Analyze**: Export graph data for programmatic analysis
317
+ 4. **AI Optimization**: Get AI-powered optimization suggestions for your code.
318
+ 5. **Editing**: Perform surgical code replacements and modifications with precise targeting.
319
+
320
+ ### Step 1: Parse a Repository
321
+
322
+ Parse and ingest a multi-language repository into the knowledge graph:
323
+
324
+ **For the first repository (clean start):**
325
+ ```bash
326
+ cgr start --repo-path /path/to/repo1 --update-graph --clean
327
+ ```
328
+
329
+ **For additional repositories (preserve existing data):**
330
+ ```bash
331
+ cgr start --repo-path /path/to/repo2 --update-graph
332
+ cgr start --repo-path /path/to/repo3 --update-graph
333
+ ```
334
+
335
+ **Control Memgraph batch flushing:**
336
+ ```bash
337
+ # Flush every 5,000 records instead of the default from settings
338
+ cgr start --repo-path /path/to/repo --update-graph \
339
+ --batch-size 5000
340
+ ```
341
+
342
+ The system automatically detects and processes files for all supported languages (see Multi-Language Support section).
343
+
344
+ ### Step 2: Query the Codebase
345
+
346
+ Start the interactive RAG CLI:
347
+
348
+ ```bash
349
+ cgr start --repo-path /path/to/your/repo
350
+ ```
351
+
352
+ ### Step 2.5: Real-Time Graph Updates (Optional)
353
+
354
+ For active development, you can keep your knowledge graph automatically synchronized with code changes using the realtime updater. This is particularly useful when you're actively modifying code and want the AI assistant to always work with the latest codebase structure.
355
+
356
+ **What it does:**
357
+ - Watches your repository for file changes (create, modify, delete)
358
+ - Automatically updates the knowledge graph in real-time
359
+ - Maintains consistency by recalculating all function call relationships
360
+ - Filters out irrelevant files (`.git`, `node_modules`, etc.)
361
+
362
+ **How to use:**
363
+
364
+ Run the realtime updater in a separate terminal:
365
+
366
+ ```bash
367
+ # Using Python directly
368
+ python realtime_updater.py /path/to/your/repo
369
+
370
+ # Or using the Makefile
371
+ make watch REPO_PATH=/path/to/your/repo
372
+ ```
373
+
374
+ **With custom Memgraph settings:**
375
+ ```bash
376
+ # Python
377
+ python realtime_updater.py /path/to/your/repo --host localhost --port 7687 --batch-size 1000
378
+
379
+ # Makefile
380
+ make watch REPO_PATH=/path/to/your/repo HOST=localhost PORT=7687 BATCH_SIZE=1000
381
+ ```
382
+
383
+ **Multi-terminal workflow:**
384
+ ```bash
385
+ # Terminal 1: Start the realtime updater
386
+ python realtime_updater.py ~/my-project
387
+
388
+ # Terminal 2: Run the AI assistant
389
+ cgr start --repo-path ~/my-project
390
+ ```
391
+
392
+ **Performance note:** The updater currently recalculates all CALLS relationships on every file change to ensure consistency. This prevents "island" problems where changes in one file aren't reflected in relationships from other files, but may impact performance on very large codebases with frequent changes. **Note:** Optimization of this behavior is a work in progress.
393
+
394
+ **CLI Arguments:**
395
+ - `repo_path` (required): Path to repository to watch
396
+ - `--host`: Memgraph host (default: `localhost`)
397
+ - `--port`: Memgraph port (default: `7687`)
398
+ - `--batch-size`: Number of buffered nodes/relationships before flushing to Memgraph
399
+
400
+ **Specify Custom Models:**
401
+ ```bash
402
+ # Use specific local models
403
+ cgr start --repo-path /path/to/your/repo \
404
+ --orchestrator ollama:llama3.2 \
405
+ --cypher ollama:codellama
406
+
407
+ # Use specific Gemini models
408
+ cgr start --repo-path /path/to/your/repo \
409
+ --orchestrator google:gemini-2.0-flash-thinking-exp-01-21 \
410
+ --cypher google:gemini-2.5-flash-lite-preview-06-17
411
+
412
+ # Use mixed providers
413
+ cgr start --repo-path /path/to/your/repo \
414
+ --orchestrator google:gemini-2.0-flash-thinking-exp-01-21 \
415
+ --cypher ollama:codellama
416
+ ```
417
+
418
+ Example queries (works across all supported languages):
419
+ - "Show me all classes that contain 'user' in their name"
420
+ - "Find functions related to database operations"
421
+ - "What methods does the User class have?"
422
+ - "Show me functions that handle authentication"
423
+ - "List all TypeScript components"
424
+ - "Find Rust structs and their methods"
425
+ - "Show me Go interfaces and implementations"
426
+ - "Find all C++ operator overloads in the Matrix class"
427
+ - "Show me C++ template functions with their specializations"
428
+ - "List all C++ namespaces and their contained classes"
429
+ - "Find C++ lambda expressions used in algorithms"
430
+ - "Add logging to all database connection functions"
431
+ - "Refactor the User class to use dependency injection"
432
+ - "Convert these Python functions to async/await pattern"
433
+ - "Add error handling to authentication methods"
434
+ - "Optimize this function for better performance"
435
+
436
+ ### Step 3: Export Graph Data
437
+
438
+ For programmatic access and integration with other tools, you can export the entire knowledge graph to JSON:
439
+
440
+ **Export during graph update:**
441
+ ```bash
442
+ cgr start --repo-path /path/to/repo --update-graph --clean -o my_graph.json
443
+ ```
444
+
445
+ **Export existing graph without updating:**
446
+ ```bash
447
+ cgr export -o my_graph.json
448
+ ```
449
+
450
+ **Optional: adjust Memgraph batching during export:**
451
+ ```bash
452
+ cgr export -o my_graph.json --batch-size 5000
453
+ ```
454
+
455
+ **Working with exported data:**
456
+ ```python
457
+ from codebase_rag.graph_loader import load_graph
458
+
459
+ # Load the exported graph
460
+ graph = load_graph("my_graph.json")
461
+
462
+ # Get summary statistics
463
+ summary = graph.summary()
464
+ print(f"Total nodes: {summary['total_nodes']}")
465
+ print(f"Total relationships: {summary['total_relationships']}")
466
+
467
+ # Find specific node types
468
+ functions = graph.find_nodes_by_label("Function")
469
+ classes = graph.find_nodes_by_label("Class")
470
+
471
+ # Analyze relationships
472
+ for func in functions[:5]:
473
+ relationships = graph.get_relationships_for_node(func.node_id)
474
+ print(f"Function {func.properties['name']} has {len(relationships)} relationships")
475
+ ```
476
+
477
+ **Example analysis script:**
478
+ ```bash
479
+ python examples/graph_export_example.py my_graph.json
480
+ ```
481
+
482
+ This provides a reliable, programmatic way to access your codebase structure without LLM restrictions, perfect for:
483
+ - Integration with other tools
484
+ - Custom analysis scripts
485
+ - Building documentation generators
486
+ - Creating code metrics dashboards
487
+
488
+ ### Step 4: Code Optimization
489
+
490
+ For AI-powered codebase optimization with best practices guidance:
491
+
492
+ **Basic optimization for a specific language:**
493
+ ```bash
494
+ cgr optimize python --repo-path /path/to/your/repo
495
+ ```
496
+
497
+ **Optimization with reference documentation:**
498
+ ```bash
499
+ cgr optimize python \
500
+ --repo-path /path/to/your/repo \
501
+ --reference-document /path/to/best_practices.md
502
+ ```
503
+
504
+ **Using specific models for optimization:**
505
+ ```bash
506
+ cgr optimize javascript \
507
+ --repo-path /path/to/frontend \
508
+ --orchestrator google:gemini-2.0-flash-thinking-exp-01-21
509
+
510
+ # Optional: override Memgraph batch flushing during optimization
511
+ cgr optimize javascript --repo-path /path/to/frontend \
512
+ --batch-size 5000
513
+ ```
514
+
515
+ **Supported Languages for Optimization:**
516
+ All supported languages: `python`, `javascript`, `typescript`, `rust`, `go`, `java`, `scala`, `cpp`
517
+
518
+ **How It Works:**
519
+ 1. **Analysis Phase**: The agent analyzes your codebase structure using the knowledge graph
520
+ 2. **Pattern Recognition**: Identifies common anti-patterns, performance issues, and improvement opportunities
521
+ 3. **Best Practices Application**: Applies language-specific best practices and patterns
522
+ 4. **Interactive Approval**: Presents each optimization suggestion for your approval before implementation
523
+ 5. **Guided Implementation**: Implements approved changes with detailed explanations
524
+
525
+ **Example Optimization Session:**
526
+ ```
527
+ Starting python optimization session...
528
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
529
+ ┃ The agent will analyze your python codebase and propose specific ┃
530
+ ┃ optimizations. You'll be asked to approve each suggestion before ┃
531
+ ┃ implementation. Type 'exit' or 'quit' to end the session. ┃
532
+ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
533
+
534
+ 🔍 Analyzing codebase structure...
535
+ 📊 Found 23 Python modules with potential optimizations
536
+
537
+ 💡 Optimization Suggestion #1:
538
+ File: src/data_processor.py
539
+ Issue: Using list comprehension in a loop can be optimized
540
+ Suggestion: Replace with generator expression for memory efficiency
541
+
542
+ [y/n] Do you approve this optimization?
543
+ ```
544
+
545
+ **Reference Document Support:**
546
+ You can provide reference documentation (like coding standards, architectural guidelines, or best practices documents) to guide the optimization process:
547
+
548
+ ```bash
549
+ # Use company coding standards
550
+ cgr optimize python \
551
+ --reference-document ./docs/coding_standards.md
552
+
553
+ # Use architectural guidelines
554
+ cgr optimize java \
555
+ --reference-document ./ARCHITECTURE.md
556
+
557
+ # Use performance best practices
558
+ cgr optimize rust \
559
+ --reference-document ./docs/performance_guide.md
560
+ ```
561
+
562
+ The agent will incorporate the guidance from your reference documents when suggesting optimizations, ensuring they align with your project's standards and architectural decisions.
563
+
564
+ **Common CLI Arguments:**
565
+ - `--orchestrator`: Specify provider:model for main operations (e.g., `google:gemini-2.0-flash-thinking-exp-01-21`, `ollama:llama3.2`)
566
+ - `--cypher`: Specify provider:model for graph queries (e.g., `google:gemini-2.5-flash-lite-preview-06-17`, `ollama:codellama`)
567
+ - `--repo-path`: Path to repository (defaults to current directory)
568
+ - `--batch-size`: Override Memgraph flush batch size (defaults to `MEMGRAPH_BATCH_SIZE` in settings)
569
+ - `--reference-document`: Path to reference documentation (optimization only)
570
+
571
+ ## 🔌 MCP Server (Claude Code Integration)
572
+
573
+ Code-Graph-RAG can run as an MCP (Model Context Protocol) server, enabling seamless integration with Claude Code and other MCP clients.
574
+
575
+ ### Quick Setup
576
+
577
+ ```bash
578
+ claude mcp add --transport stdio code-graph-rag \
579
+ --env TARGET_REPO_PATH=/absolute/path/to/your/project \
580
+ --env CYPHER_PROVIDER=openai \
581
+ --env CYPHER_MODEL=gpt-4 \
582
+ --env CYPHER_API_KEY=your-api-key \
583
+ -- uv run --directory /path/to/code-graph-rag code-graph-rag mcp-server
584
+ ```
585
+
586
+ ### Available Tools
587
+
588
+ <!-- SECTION:mcp_tools -->
589
+ | Tool | Description |
590
+ |----|-----------|
591
+ | `list_projects` | List all indexed projects in the knowledge graph database. Returns a list of project names that have been indexed. |
592
+ | `delete_project` | Delete a specific project from the knowledge graph database. This removes all nodes associated with the project while preserving other projects. Use list_projects first to see available projects. |
593
+ | `wipe_database` | WARNING: Completely wipe the entire database, removing ALL indexed projects. This cannot be undone. Use delete_project for removing individual projects. |
594
+ | `index_repository` | Parse and ingest the repository into the Memgraph knowledge graph. This builds a comprehensive graph of functions, classes, dependencies, and relationships. Note: This preserves other projects - only the current project is re-indexed. |
595
+ | `query_code_graph` | Query the codebase knowledge graph using natural language. Ask questions like 'What functions call UserService.create_user?' or 'Show me all classes that implement the Repository interface'. |
596
+ | `get_code_snippet` | Retrieve source code for a function, class, or method by its qualified name. Returns the source code, file path, line numbers, and docstring. |
597
+ | `surgical_replace_code` | Surgically replace an exact code block in a file using diff-match-patch. Only modifies the exact target block, leaving the rest unchanged. |
598
+ | `read_file` | Read the contents of a file from the project. Supports pagination for large files. |
599
+ | `write_file` | Write content to a file, creating it if it doesn't exist. |
600
+ | `list_directory` | List contents of a directory in the project. |
601
+ <!-- /SECTION:mcp_tools -->
602
+
603
+ ### Example Usage
604
+
605
+ ```
606
+ > Index this repository
607
+ > What functions call UserService.create_user?
608
+ > Update the login function to add rate limiting
609
+ ```
610
+
611
+ For detailed setup, see [Claude Code Setup Guide](docs/claude-code-setup.md).
612
+
613
+ ## 📊 Graph Schema
614
+
615
+ The knowledge graph uses the following node types and relationships:
616
+
617
+ ### Node Types
618
+
619
+ <!-- SECTION:node_schemas -->
620
+ | Label | Properties |
621
+ |-----|----------|
622
+ | Project | `{name: string}` |
623
+ | Package | `{qualified_name: string, name: string, path: string}` |
624
+ | Folder | `{path: string, name: string}` |
625
+ | File | `{path: string, name: string, extension: string}` |
626
+ | Module | `{qualified_name: string, name: string, path: string}` |
627
+ | Class | `{qualified_name: string, name: string, decorators: list[string]}` |
628
+ | Function | `{qualified_name: string, name: string, decorators: list[string]}` |
629
+ | Method | `{qualified_name: string, name: string, decorators: list[string]}` |
630
+ | Interface | `{qualified_name: string, name: string}` |
631
+ | Enum | `{qualified_name: string, name: string}` |
632
+ | Type | `{qualified_name: string, name: string}` |
633
+ | Union | `{qualified_name: string, name: string}` |
634
+ | ModuleInterface | `{qualified_name: string, name: string, path: string}` |
635
+ | ModuleImplementation | `{qualified_name: string, name: string, path: string, implements_module: string}` |
636
+ | ExternalPackage | `{name: string, version_spec: string}` |
637
+ <!-- /SECTION:node_schemas -->
638
+
639
+ ### Language-Specific Mappings
640
+
641
+ <!-- SECTION:language_mappings -->
642
+ - **C++**: `class_specifier`, `declaration`, `enum_specifier`, `field_declaration`, `function_definition`, `lambda_expression`, `struct_specifier`, `template_declaration`, `union_specifier`
643
+ - **Java**: `annotation_type_declaration`, `class_declaration`, `constructor_declaration`, `enum_declaration`, `interface_declaration`, `method_declaration`, `record_declaration`
644
+ - **JavaScript**: `arrow_function`, `class`, `class_declaration`, `function_declaration`, `function_expression`, `generator_function_declaration`, `method_definition`
645
+ - **Lua**: `function_declaration`, `function_definition`
646
+ - **Python**: `class_definition`, `function_definition`
647
+ - **Rust**: `closure_expression`, `enum_item`, `function_item`, `function_signature_item`, `impl_item`, `struct_item`, `trait_item`, `type_item`, `union_item`
648
+ - **TypeScript**: `abstract_class_declaration`, `arrow_function`, `class`, `class_declaration`, `enum_declaration`, `function_declaration`, `function_expression`, `function_signature`, `generator_function_declaration`, `interface_declaration`, `internal_module`, `method_definition`, `type_alias_declaration`
649
+ - **C#**: `anonymous_method_expression`, `class_declaration`, `constructor_declaration`, `destructor_declaration`, `enum_declaration`, `function_pointer_type`, `interface_declaration`, `lambda_expression`, `local_function_statement`, `method_declaration`, `struct_declaration`
650
+ - **Go**: `function_declaration`, `method_declaration`, `type_declaration`
651
+ - **PHP**: `anonymous_function`, `arrow_function`, `class_declaration`, `enum_declaration`, `function_definition`, `function_static_declaration`, `interface_declaration`, `trait_declaration`
652
+ - **Scala**: `class_definition`, `function_declaration`, `function_definition`, `object_definition`, `trait_definition`
653
+ <!-- /SECTION:language_mappings -->
654
+
655
+ ### Relationships
656
+
657
+ <!-- SECTION:relationship_schemas -->
658
+ | Source | Relationship | Target |
659
+ |------|------------|------|
660
+ | Project, Package, Folder | CONTAINS_PACKAGE | Package |
661
+ | Project, Package, Folder | CONTAINS_FOLDER | Folder |
662
+ | Project, Package, Folder | CONTAINS_FILE | File |
663
+ | Project, Package, Folder | CONTAINS_MODULE | Module |
664
+ | Module | DEFINES | Class, Function |
665
+ | Class | DEFINES_METHOD | Method |
666
+ | Module | IMPORTS | Module |
667
+ | Module | EXPORTS | Class, Function |
668
+ | Module | EXPORTS_MODULE | ModuleInterface |
669
+ | Module | IMPLEMENTS_MODULE | ModuleImplementation |
670
+ | Class | INHERITS | Class |
671
+ | Class | IMPLEMENTS | Interface |
672
+ | Method | OVERRIDES | Method |
673
+ | ModuleImplementation | IMPLEMENTS | ModuleInterface |
674
+ | Project | DEPENDS_ON_EXTERNAL | ExternalPackage |
675
+ | Function, Method | CALLS | Function, Method |
676
+ <!-- /SECTION:relationship_schemas -->
677
+
678
+ ## 🔧 Configuration
679
+
680
+ Configuration is managed through environment variables in `.env` file:
681
+
682
+ ### Provider-Specific Settings
683
+
684
+ #### Orchestrator Model Configuration
685
+ - `ORCHESTRATOR_PROVIDER`: Provider name (`google`, `openai`, `ollama`)
686
+ - `ORCHESTRATOR_MODEL`: Model ID (e.g., `gemini-2.5-pro`, `gpt-4o`, `llama3.2`)
687
+ - `ORCHESTRATOR_API_KEY`: API key for the provider (if required)
688
+ - `ORCHESTRATOR_ENDPOINT`: Custom endpoint URL (if required)
689
+ - `ORCHESTRATOR_PROJECT_ID`: Google Cloud project ID (for Vertex AI)
690
+ - `ORCHESTRATOR_REGION`: Google Cloud region (default: `us-central1`)
691
+ - `ORCHESTRATOR_PROVIDER_TYPE`: Google provider type (`gla` or `vertex`)
692
+ - `ORCHESTRATOR_THINKING_BUDGET`: Thinking budget for reasoning models
693
+ - `ORCHESTRATOR_SERVICE_ACCOUNT_FILE`: Path to service account file (for Vertex AI)
694
+
695
+ #### Cypher Model Configuration
696
+ - `CYPHER_PROVIDER`: Provider name (`google`, `openai`, `ollama`)
697
+ - `CYPHER_MODEL`: Model ID (e.g., `gemini-2.5-flash`, `gpt-4o-mini`, `codellama`)
698
+ - `CYPHER_API_KEY`: API key for the provider (if required)
699
+ - `CYPHER_ENDPOINT`: Custom endpoint URL (if required)
700
+ - `CYPHER_PROJECT_ID`: Google Cloud project ID (for Vertex AI)
701
+ - `CYPHER_REGION`: Google Cloud region (default: `us-central1`)
702
+ - `CYPHER_PROVIDER_TYPE`: Google provider type (`gla` or `vertex`)
703
+ - `CYPHER_THINKING_BUDGET`: Thinking budget for reasoning models
704
+ - `CYPHER_SERVICE_ACCOUNT_FILE`: Path to service account file (for Vertex AI)
705
+
706
+ ### System Settings
707
+ - `MEMGRAPH_HOST`: Memgraph hostname (default: `localhost`)
708
+ - `MEMGRAPH_PORT`: Memgraph port (default: `7687`)
709
+ - `MEMGRAPH_HTTP_PORT`: Memgraph HTTP port (default: `7444`)
710
+ - `LAB_PORT`: Memgraph Lab port (default: `3000`)
711
+ - `MEMGRAPH_BATCH_SIZE`: Batch size for Memgraph operations (default: `1000`)
712
+ - `TARGET_REPO_PATH`: Default repository path (default: `.`)
713
+ - `LOCAL_MODEL_ENDPOINT`: Fallback endpoint for Ollama (default: `http://localhost:11434/v1`)
714
+
715
+ ### Custom Ignore Patterns
716
+
717
+ You can specify additional directories to exclude by creating a `.cgrignore` file in your repository root:
718
+
719
+ ```
720
+ # Comments start with #
721
+ vendor
722
+ .custom_cache
723
+ my_build_output
724
+ ```
725
+
726
+ - One directory name per line
727
+ - Lines starting with `#` are comments
728
+ - Blank lines are ignored
729
+ - Patterns are exact directory name matches (not globs)
730
+ - Patterns from `.cgrignore` are merged with `--exclude` flags and auto-detected directories
731
+
732
+ ### Key Dependencies
733
+
734
+ <!-- SECTION:dependencies -->
735
+ - **loguru**: Python logging made (stupidly) simple
736
+ - **mcp**: Model Context Protocol SDK
737
+ - **pydantic-ai**: Agent Framework / shim to use Pydantic with LLMs
738
+ - **pydantic-settings**: Settings management using Pydantic
739
+ - **pymgclient**: Memgraph database adapter for Python language
740
+ - **python-dotenv**: Read key-value pairs from a .env file and set them as environment variables
741
+ - **toml**: Python Library for Tom's Obvious, Minimal Language
742
+ - **tree-sitter-python**: Python grammar for tree-sitter
743
+ - **tree-sitter**: Python bindings to the Tree-sitter parsing library
744
+ - **watchdog**: Filesystem events monitoring
745
+ - **typer**: Typer, build great CLIs. Easy to code. Based on Python type hints.
746
+ - **rich**: Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal
747
+ - **prompt-toolkit**: Library for building powerful interactive command lines in Python
748
+ - **diff-match-patch**: Repackaging of Google's Diff Match and Patch libraries.
749
+ - **click**: Composable command line interface toolkit
750
+ - **protobuf**
751
+ - **defusedxml**: XML bomb protection for Python stdlib modules
752
+ - **huggingface-hub**: Client library to download and publish models, datasets and other repos on the huggingface.co hub
753
+ <!-- /SECTION:dependencies -->
754
+
755
+ ## 🤖 Agentic Workflow & Tools
756
+
757
+ The agent is designed with a deliberate workflow to ensure it acts with context and precision, especially when modifying the file system.
758
+
759
+ ### Core Tools
760
+
761
+ The agent has access to a suite of tools to understand and interact with the codebase:
762
+
763
+ <!-- SECTION:agentic_tools -->
764
+ | Tool | Description |
765
+ |----|-----------|
766
+ | `query_graph` | Query the codebase knowledge graph using natural language questions. Ask in plain English about classes, functions, methods, dependencies, or code structure. Examples: 'Find all functions that call each other', 'What classes are in the user module', 'Show me functions with the longest call chains'. |
767
+ | `read_file` | Reads the content of text-based files. For documents like PDFs or images, use the 'analyze_document' tool instead. |
768
+ | `create_file` | Creates a new file with content. IMPORTANT: Check file existence first! Overwrites completely WITHOUT showing diff. Use only for new files, not existing file modifications. |
769
+ | `replace_code` | Surgically replaces specific code blocks in files. Requires exact target code and replacement. Only modifies the specified block, leaving rest of file unchanged. True surgical patching. |
770
+ | `list_directory` | Lists the contents of a directory to explore the codebase. |
771
+ | `analyze_document` | Analyzes documents (PDFs, images) to answer questions about their content. |
772
+ | `execute_shell` | Executes shell commands from allowlist. Read-only commands run without approval; write operations require user confirmation. |
773
+ | `semantic_search` | Performs a semantic search for functions based on a natural language query describing their purpose, returning a list of potential matches with similarity scores. |
774
+ | `get_function_source` | Retrieves the source code for a specific function or method using its internal node ID, typically obtained from a semantic search result. |
775
+ | `get_code_snippet` | Retrieves the source code for a specific function, class, or method using its full qualified name. |
776
+ <!-- /SECTION:agentic_tools -->
777
+
778
+ ### Intelligent and Safe File Editing
779
+
780
+ The agent uses AST-based function targeting with Tree-sitter for precise code modifications. Features include:
781
+ - **Visual diff preview** before changes
782
+ - **Surgical patching** that only modifies target code blocks
783
+ - **Multi-language support** across all supported languages
784
+ - **Security sandbox** preventing edits outside project directory
785
+ - **Smart function matching** with qualified names and line numbers
786
+
787
+
788
+
789
+ ## 🌍 Multi-Language Support
790
+
791
+ ### Adding New Languages
792
+
793
+ Code-Graph-RAG makes it easy to add support for any language that has a Tree-sitter grammar. The system automatically handles grammar compilation and integration.
794
+
795
+ > **⚠️ Recommendation**: While you can add languages yourself, we recommend waiting for official full support to ensure optimal parsing quality, comprehensive feature coverage, and robust integration. The languages marked as "In Development" above will receive dedicated optimization and testing.
796
+
797
+ > **💡 Request Support**: If you want a specific language to be officially supported, please [submit an issue](https://github.com/vitali87/code-graph-rag/issues) with your language request.
798
+
799
+ #### Quick Start: Add a Language
800
+
801
+ Use the built-in language management tool to add any Tree-sitter supported language:
802
+
803
+ ```bash
804
+ # Add a language using the standard tree-sitter repository
805
+ cgr language add-grammar <language-name>
806
+
807
+ # Examples:
808
+ cgr language add-grammar c-sharp
809
+ cgr language add-grammar php
810
+ cgr language add-grammar ruby
811
+ cgr language add-grammar kotlin
812
+ ```
813
+
814
+ #### Custom Grammar Repositories
815
+
816
+ For languages hosted outside the standard tree-sitter organization:
817
+
818
+ ```bash
819
+ # Add a language from a custom repository
820
+ cgr language add-grammar --grammar-url https://github.com/custom/tree-sitter-mylang
821
+ ```
822
+
823
+ #### What Happens Automatically
824
+
825
+ When you add a language, the tool automatically:
826
+
827
+ 1. **Downloads the Grammar**: Clones the tree-sitter grammar repository as a git submodule
828
+ 2. **Detects Configuration**: Auto-extracts language metadata from `tree-sitter.json`
829
+ 3. **Analyzes Node Types**: Automatically identifies AST node types for:
830
+ - Functions/methods (`method_declaration`, `function_definition`, etc.)
831
+ - Classes/structs (`class_declaration`, `struct_declaration`, etc.)
832
+ - Modules/files (`compilation_unit`, `source_file`, etc.)
833
+ - Function calls (`call_expression`, `method_invocation`, etc.)
834
+ 4. **Compiles Bindings**: Builds Python bindings from the grammar source
835
+ 5. **Updates Configuration**: Adds the language to `codebase_rag/language_config.py`
836
+ 6. **Enables Parsing**: Makes the language immediately available for codebase analysis
837
+
838
+ #### Example: Adding C# Support
839
+
840
+ ```bash
841
+ $ cgr language add-grammar c-sharp
842
+ 🔍 Using default tree-sitter URL: https://github.com/tree-sitter/tree-sitter-c-sharp
843
+ 🔄 Adding submodule from https://github.com/tree-sitter/tree-sitter-c-sharp...
844
+ ✅ Successfully added submodule at grammars/tree-sitter-c-sharp
845
+ Auto-detected language: c-sharp
846
+ Auto-detected file extensions: ['cs']
847
+ Auto-detected node types:
848
+ Functions: ['destructor_declaration', 'method_declaration', 'constructor_declaration']
849
+ Classes: ['struct_declaration', 'enum_declaration', 'interface_declaration', 'class_declaration']
850
+ Modules: ['compilation_unit', 'file_scoped_namespace_declaration', 'namespace_declaration']
851
+ Calls: ['invocation_expression']
852
+
853
+ ✅ Language 'c-sharp' has been added to the configuration!
854
+ 📝 Updated codebase_rag/language_config.py
855
+ ```
856
+
857
+ #### Managing Languages
858
+
859
+ ```bash
860
+ # List all configured languages
861
+ cgr language list-languages
862
+
863
+ # Remove a language (this also removes the git submodule unless --keep-submodule is specified)
864
+ cgr language remove-language <language-name>
865
+ ```
866
+
867
+ #### Language Configuration
868
+
869
+ The system uses a configuration-driven approach for language support. Each language is defined in `codebase_rag/language_config.py` with the following structure:
870
+
871
+ ```python
872
+ "language-name": LanguageConfig(
873
+ name="language-name",
874
+ file_extensions=[".ext1", ".ext2"],
875
+ function_node_types=["function_declaration", "method_declaration"],
876
+ class_node_types=["class_declaration", "struct_declaration"],
877
+ module_node_types=["compilation_unit", "source_file"],
878
+ call_node_types=["call_expression", "method_invocation"],
879
+ ),
880
+ ```
881
+
882
+ #### Troubleshooting
883
+
884
+ **Grammar not found**: If the automatic URL doesn't work, use a custom URL:
885
+ ```bash
886
+ cgr language add-grammar --grammar-url https://github.com/custom/tree-sitter-mylang
887
+ ```
888
+
889
+ **Version incompatibility**: If you get "Incompatible Language version" errors, update your tree-sitter package:
890
+ ```bash
891
+ uv add tree-sitter@latest
892
+ ```
893
+
894
+ **Missing node types**: The tool automatically detects common node patterns, but you can manually adjust the configuration in `language_config.py` if needed.
895
+
896
+ ## 📦 Building a binary
897
+
898
+ You can build a binary of the application using the `build_binary.py` script. This script uses PyInstaller to package the application and its dependencies into a single executable.
899
+
900
+ ```bash
901
+ python build_binary.py
902
+ ```
903
+ The resulting binary will be located in the `dist` directory.
904
+
905
+ ## 🐛 Debugging
906
+
907
+ 1. **Check Memgraph connection**:
908
+ - Ensure Docker containers are running: `docker-compose ps`
909
+ - Verify Memgraph is accessible on port 7687
910
+
911
+ 2. **View database in Memgraph Lab**:
912
+ - Open http://localhost:3000
913
+ - Connect to memgraph:7687
914
+
915
+ 3. **For local models**:
916
+ - Verify Ollama is running: `ollama list`
917
+ - Check if models are downloaded: `ollama pull llama3`
918
+ - Test Ollama API: `curl http://localhost:11434/v1/models`
919
+ - Check Ollama logs: `ollama logs`
920
+
921
+ ## 🤝 Contributing
922
+
923
+ Please see [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
924
+
925
+ Good first PRs are from TODO issues.
926
+
927
+ ## 🙋‍♂️ Support
928
+
929
+ For issues or questions:
930
+ 1. Check the logs for error details
931
+ 2. Verify Memgraph connection
932
+ 3. Ensure all environment variables are set
933
+ 4. Review the graph schema matches your expectations
934
+
935
+ ## 💼 Enterprise Services
936
+
937
+ Code-Graph-RAG is open source and free to use. For organizations that need more, we offer **fully managed cloud-hosted solutions** and **on-premise deployments**:
938
+
939
+ - **Cloud-Hosted Deployment** — Managed cloud infrastructure for both the graph database and AI agent connection. Zero infrastructure overhead — we handle scaling, updates, and availability so your team can focus on building.
940
+ - **On-Premise & Air-Gapped Deployment** — Deploy Code-Graph-RAG entirely within your own environment, including air-gapped networks. Full data sovereignty for regulated industries and security-sensitive organizations.
941
+
942
+ We also offer custom development, integration consulting, technical support contracts, and team training.
943
+
944
+ **[View plans & pricing at code-graph-rag.com →](https://code-graph-rag.com/enterprise)**
945
+
946
+ ## Star History
947
+
948
+ [![Star History Chart](https://api.star-history.com/svg?repos=vitali87/code-graph-rag&type=Date)](https://www.star-history.com/#vitali87/code-graph-rag&Date)