code-graph-rag  by vitali87

Codebase RAG system for multi-language analysis

created 2 months ago
918 stars

Top 39.6% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This project provides a multi-language AI assistant for analyzing and interacting with codebases, targeting developers and researchers working with monorepos or complex code structures. It leverages a knowledge graph approach to enable natural language querying, code editing, and AI-driven optimization, aiming to improve developer productivity and code quality.

How It Works

The system utilizes Tree-sitter for robust, language-agnostic parsing of codebases, building a comprehensive knowledge graph stored in Memgraph. This graph captures code structure, relationships, and dependencies. A Retrieval-Augmented Generation (RAG) system, powered by various LLMs (Gemini, OpenAI, Ollama), allows users to query this graph using natural language. The system can translate queries into Cypher for graph traversal, retrieve code snippets, and even perform surgical code modifications based on AST analysis.

Quick Start & Requirements

  • Install: git clone https://github.com/vitali87/code-graph-rag.git && cd code-graph-rag followed by uv sync (for Python), uv sync --extra treesitter-full (for full multi-language support), or make dev (for development setup).
  • Prerequisites: Python 3.12+, Docker & Docker Compose (for Memgraph), cmake. API keys for cloud models (Gemini/OpenAI) or Ollama for local models.
  • Setup: Requires configuring .env file with API keys or local model endpoints. Memgraph is run via docker-compose up -d.
  • Docs: README

Highlighted Details

  • Multi-Language Support: Fully supports Python, JavaScript, TypeScript, with active development for C++, Rust, Go, Scala, and Java.
  • AI-Powered Editing: Features surgical code replacement with AST-based targeting, visual diff previews, and interactive approval workflows.
  • Reference-Guided Optimization: Can use custom documentation (coding standards, architectural guidelines) to guide AI optimization suggestions.
  • Extensible: Easy to add support for new languages via Tree-sitter grammars.

Maintenance & Community

The project appears to be actively developed by a single primary author (vitali87). There are no explicit links to community channels like Discord or Slack in the README.

Licensing & Compatibility

The repository does not explicitly state a license in the README. This is a critical omission for evaluating commercial use or closed-source integration.

Limitations & Caveats

The project's licensing is not specified, which is a significant blocker for many use cases. While C++, Rust, Go, Scala, and Java parsing are in development, they are not yet fully supported, potentially leading to incomplete graph representations for these languages.

Health Check
Last commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
25
Issues (30d)
31
Star History
235 stars in the last 30 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
5 more.

rivet by Ironclad

0.3%
4k
Visual IDE for AI agent and prompt-chaining development
created 2 years ago
updated 1 week ago
Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Former Cofounder of Luma AI), Will Brown Will Brown(Research Lead at Prime Intellect), and
7 more.

avante.nvim by yetone

0.7%
16k
Neovim plugin emulating Cursor AI IDE for AI-driven code assistance
created 1 year ago
updated 1 day ago
Feedback? Help us improve.