Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 RepoMind

A repository-aware code intelligence engine powered by call graphs, repository maps, and vector search.

RepoMind analyzes a full codebase and builds a structured understanding of it using:

  • Static repository structure analysis
  • Function-level call graph extraction
  • Semantic code search (Qdrant)
  • LLM-based reasoning over code context

Currently optimized for local LLM inference via LM Studio.


✨ Features

  • 📁 Repository structure mapping (modules, files, importance scoring)
  • 🔗 Static call graph generation (cross-file function tracking)
  • 🧠 Semantic code search using embeddings
  • 💬 LLM-powered chat over codebase
  • ⚡ Incremental indexing support
  • 📦 Local-first architecture (no cloud dependency required)

⚠️ Current Limitations (IMPORTANT)

RepoMind is still in early development.

Current constraints:

  • ❗ Only works with LM Studio (OpenAI-compatible local API)
  • ❗ No OpenAI / cloud API support yet
  • ❗ Requires Qdrant running locally
  • ❗ No UI (CLI-only experience)

🧱 Architecture Overview

RepoMind builds 3 intelligence layers:

1. Repository Map

  • File & folder structure
  • Module classification
  • Importance scoring

2. Call Graph

  • Function-level relationships
  • Cross-file dependencies
  • Execution flow inference
  • Unresolved edges tracking

3. Vector Search Layer (Qdrant)

  • Code chunk embeddings
  • Semantic retrieval
  • Context ranking for LLM prompts

📦 Project Structure


src/
│
├── chat.py              # Main Q&A interface
├── indexer.py           # Embedding + Qdrant indexing
├── repo_map.py          # Repository structure analysis
├── call_graph.py        # Static function call graph
├── search.py            # Semantic search engine
├── reranker.py          # Context reranking
├── memory.py           # Chat memory layer
├── config.py           # Local config (ignored by git)
├── config.example.py   # Example config for setup
│
├── cache/              # Generated artifacts
└── workspace/          # Cloned repositories


⚙️ Requirements

1. Python

  • Python 3.10+

2. Install dependencies

pip install -r requirements.txt

3. install & Start Qdrant (Vector Database)

docker pull qdrant/qdrant
docker run -p 6333:6333 -p 6334:6334 -v qdrant_storage:/qdrant/storage qdrant/qdrant

⚙️ Configuration Setup

Step 1 — Create config file

cp src/config.example.py src/config.py

Step 2 — Configure repository

Edit only this line:

REPO_URL = "https://github.com/your-username/your-repo.git"

Step 3 — LM Studio setup (IMPORTANT)

RepoMind currently uses LM Studio as the only supported LLM backend.

Make sure:

  • LM Studio is running
  • Server is enabled
  • API endpoint is:
http://localhost:1234/v1

In config.py:

LMSTUDIO_URL = "http://localhost:1234/v1"
LMSTUDIO_KEY = "lm-studio"

🚀 Running the System

1. Build Repository Map

python -m src.repo_map

Output:

src/cache/repo_map.json

2. Build Call Graph

python -m src.call_graph

Output:

src/cache/call_graph.json

3. Index Codebase (Qdrant)

python -m src.indexer

This step:

  • Clones repo
  • Chunks code
  • Generates embeddings
  • Stores vectors in Qdrant

4. Start Chat Interface

python -m src.chat

💬 Example Queries

Try:

Explain websocket flow step by step
Trace login request from client to server response
Where is authentication handled in the system?
How does call graph resolve cross-file functions?

🧠 How It Works

RepoMind combines:

  • 📁 Structural understanding (repo map)
  • 🔗 Execution relationships (call graph)
  • 🔍 Semantic search (vector DB)
  • 🧠 LLM reasoning (LM Studio)

This creates a multi-layer code reasoning system.


⚠️ Important Notes

  • config.py is ignored in git (contains local settings)
  • cache/ is auto-generated
  • workspace/ contains cloned repositories
  • Always run from project root
  • First run may take time due to indexing

🔮 Roadmap

Planned improvements:

  • Multi-repo support
  • OpenAI / Claude backend support
  • Web UI (graph + chat)
  • Real-time AST-based call graph
  • Incremental background indexing
  • Better unresolved call resolution

📌 License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages