A complete, context-aware AI coding assistant that helps you talk to, understand, and visualize your GitHub codebases.
Powered by Qwen 2.5 Coder, RAG (FAISS + LlamaIndex), and a Custom Node-Graph Pipeline.
- Overview
- Features
- Under the Hood
- Graphic Demonstrations
- Tech Stack
- Installation
- Usage
- API Documentation
- Project Structure
- Contributing
- License
Navigating and understanding a large, unfamiliar, or legacy GitHub codebase can take days. Developers struggle to figure out where functions are defined, how dependencies trace back globally, and what the overall architecture looks like before writing a single line of code.
RepoMind clones any public GitHub repository, parses the entire Abstract Syntax Tree (AST), and embeds the code into a semantic vector space using FAISS and HuggingFace models. You can then chat directly with the code and generate graphical node-based visualizations (Directory Structure, Dependencies, and Call Graphs) to instantly understand how the repository ticks.
- Software Engineers joining a new project or onboarding to a massive microservice.
- Code Reviewers needing extra architectural context on large pull requests.
- Open Source Contributors trying to find the exact file to fix a bug in a multi-thousand-file repository.
- β¨ RAG-Powered Chat: Ask questions about your code natively. The local LLM will scan your files and construct prompts grounded purely in your repository's logic.
- β‘ Lightning Fast Ingestion: Utilizes highly optimized
ThreadPoolExecutorparallel processing to blaze through massive codebases in seconds. - π§ Conversational Memory & Control: Follow-up questions work! The built-in History Tab allows you to view contextual memory and reset the chat context instantly to prevent token bloat.
- π Multi-Language AST Support: Robust Abstract Syntax Tree parsing for
Python,JavaScript,TypeScript, andDartcodebases. - πΊοΈ Architecture Graphs: Visualize your codebase instantly. Generates pure JSON endpoints and interactive Streamlit UI tabs for:
- Repository Directory Trees
- Function Call Graphs (who calls whom across files)
- Modular Dependency Tracking (import hierarchies)
- π GPU Accelerated: Built-in CUDA support via PyTorch to efficiently embed thousands of chunks.
- π 100% Local Privacy: Runs entirely on your hardware via Ollama. No proprietary/enterprise code is ever sent to OpenAI, Anthropic, or external API providers.
When you submit a GitHub URL, RepoMind executes a highly optimized pipeline:
- Repository Ingestion: Clones the repo locally to
cloned_repos/. - Multi-Language AST Parsing: Uses native
astmodules and advanced regex trees to logically break down files across Python, JS/TS, and Dart. - Parallel Text Chunking: Fragments the code into semantically coherent overlapping chunks across all CPU cores simultaneously.
- Vector Embedding: Uses
BAAI/bge-small-en-v1.5to generate dense vector embeddings with batch processing, leveraging GPU acceleration if available. - LlamaIndex Indexing: Builds a single-pass
VectorStoreIndexdirectly from code chunks β no redundant FAISS double-indexing. - LlamaIndex Query Engine: Routes user queries through an Ollama-hosted LLM (
qwen2.5-coder) using highly tuned, token-efficient context windows.
An overview of how RepoMind ingests code, embeds chunks into FAISS, and answers questions grounded in retrieved context.
![]()
What happens in the pipeline?
RepoMind: 1. clones your GitHub repo into `cloned_repos/` 2. extracts code chunks via traversal + AST-aware chunking 3. embeds chunks into a LlamaIndex VectorStoreIndex (single pass) 4. answers questions using Ollama + LlamaIndex, constrained by retrieved chunks 5. generates graph data (structure/call/dependencies) for the UITalk directly to your codebase with a scrollable chat container and pinned input.
| Ingesting Repository | Repo Loaded & Ready |
|---|---|
![]() |
![]() |
Ask questions and get context-aware answers grounded in your codebase.
Generate file structure trees, function call graphs, and dependency webs natively inside the UI.
| π File Structure | π Call Graph | π Dependencies |
|---|---|---|
![]() |
![]() |
![]() |
Language: Python 3.10+
Core Technologies:
- UI Frontend: Streamlit (
app.py) - Backend API: Flask (
visualization/api.py) - Local LLM Engine: Ollama running Qwen 2.5 Coder
- Vector Database: FAISS (Facebook AI Similarity Search)
- RAG Orchestration: LlamaIndex & Langchain
- Embeddings Model:
BAAI/bge-small-en-v1.5(fast, lightweight) - Acceleration: PyTorch (CUDA 12.1+ Support)
To run the local embeddings and the Ollama LLM smoothly, your system should meet these specifications:
- OS: Windows 10/11, macOS (M-series recommended), or Linux
- RAM: 8 GB minimum (16 GB highly recommended for parsing large repositories seamlessly)
- Storage: ~10 GB free space (to download Ollama LLMs and cache HuggingFace embeddings)
- CPU: Modern multi-core bridging (Intel i5/Ryzen 5 or better) for parallelized AST chunking
- GPU (Optional but Recommended): 6GB+ VRAM (NVIDIA) for PyTorch CUDA acceleration to index massive codebases instantly. If a GPU is not available, RepoMind will gracefully fall back to CPU.
- Python 3.10+
- Ollama (Must be installed and running as a background service)
- Git (For cloning target repositories)
1. Clone the repository
git clone https://github.com/Yash-Kavaiya/RepoMind.git
cd RepoMind2. Create a Virtual Environment (Highly Recommended)
python -m venv .venv
# On Windows (Command Prompt or PowerShell):
.venv\Scripts\activate
# On Mac/Linux:
source .venv/bin/activate3. Install Dependencies
For standard CPU environments:
pip install -r requirements.txtπ₯ For NVIDIA GPU Acceleration (Recommended for 10x faster indexing!):
# Remove CPU-only torch versions
pip uninstall -y torch torchvision torchaudio
# Install PyTorch with CUDA 12.1 support
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121(Verify GPU installation by running python -c "import torch; print(torch.cuda.is_available())". It should print True.)
4. Start the Local LLM In a new terminal window (keep it running), pull and start the model:
ollama run qwen2.5-coder:3b- Start the UI:
python -m streamlit run app.py- Open
http://localhost:8501in your browser. - Paste a GitHub repo URL (for example:
https://github.com/pallets/flask) into the sidebar and click Load Repository. - Ask a question like:
Sample prompts
- `Where is the request routing logic located?` - `Explain the function that handles incoming requests.` - `Show the call graph for the main entry point.`RepoMind consists of two parallel systems. You can run either the Frontend UI or the Backend Visualization API depending on your needs.
To interact with the conversational AI, ingest repositories, and query code logic natively menus:
python -m streamlit run app.pyWorkflow:
- Open
http://localhost:8501in your browser. - In the sidebar, paste a valid GitHub URL (e.g.,
https://github.com/pallets/flask). - Click Load Repository and wait for the ingestion process (FAISS indexing) to complete.
- Use the Chat box to ask contextual questions:
- "Where is the core routing logic located?"
- "Explain the
render_templatefunction and optimize it."
If you want to extract raw architectural intelligence to build your own frontend UI (like React Flow or D3.js):
python -m visualization.apiThe Flask server boots up natively on http://localhost:5000.
If running the Flask backend, you can execute GET/POST requests to retrieve codebase intelligence.
Base URL: http://localhost:5000
For repository-based endpoints, provide an absolute path via repo_path:
(Replace C:\path\to\repo with the absolute path of the locally cloned repository stored in cloned_repos/.)
| HTTP Method | Endpoint Path | Description | Response Type |
|---|---|---|---|
GET |
/repo/structure?repo_path=<path> |
Generates a deep hierarchical tree dictionary of all project files and folders. | application/json |
GET |
/repo/call-graph?repo_path=<path> |
Identifies functions and returns node/edge pairs detailing which functions call which. | application/json |
GET |
/repo/dependencies?repo_path=<path> |
Analyzes Python import statements to map file-level dependencies. |
application/json |
GET |
/chat/history |
Retrieves the current session's chat memory array. | application/json |
POST |
/chat/reset |
Purges conversation history memory for a fresh context window. | application/json |
Run a quick API test (curl)
```bash curl "http://localhost:5000/repo/structure?repo_path=C:/path/to/cloned_repos/" ```RepoMind/
βββ app.py # Main Streamlit Chat Interface
βββ architecture-diagram.png # High-level pipeline illustration (shown in README)
βββ cloned_repos/ # Local clones of target GitHub repos
βββ faiss_indices/ # Persistent FAISS index storage
βββ weights/ # HuggingFace / embedding cache (created automatically)
βββ rag_101/ # LlamaIndex + retrieval orchestration
β βββ client.py
β βββ rag.py
β βββ retriever.py
βββ repo_ingestion/ # Pipeline to clone, chunk, and embed code
β βββ code_chunker.py
β βββ embedding_store.py
β βββ file_traversal.py
β βββ github_handler.py
βββ visualization/ # AST parsing + graph generation + API
β βββ api.py # Flask backend exposing JSON endpoints
β βββ repo_structure.py # Directory tree builder
β βββ call_graph.py # Function call graph builder
β βββ dependency_graph.py # Import dependency graph builder
β βββ streamlit_viz.py # Render helpers for Streamlit
β βββ ast_analyzers/ # Language-specific analyzers
βββ memory/ # Conversation memory
β βββ chat_memory.py
βββ tests/ # Automated tests
βββ requirements.txt # Python dependency locks
Ollama errors (model not found / connection refused)
Run `ollama run qwen2.5-coder:3b` first (in a separate terminal) and keep the service running.Ingestion takes a long time
The first run includes cloning + chunking + embedding. Try a smaller repo to validate the setup, then scale up.API returns 400/404
Double-check that `repo_path` is an existing absolute directory and that youβre using the correct parameter name: `repo_path` (not `path`).Windows curl quoting issues
Use forward slashes in paths (for example `C:/Users/...`) and URL-encode spaces if needed.Is everything local / privacy-friendly?
Yes. The Streamlit app calls Ollama locally; it does not require sending your code to OpenAI/Anthropic/etc.Does the API support multiple users?
Currently the API uses a single global chat memory instance, so isolation per user/session is not implemented yet.Do FAISS indices get reused?
The ingestion pipeline persists indices to `faiss_indices/`, but the current UI rebuilds during ingestion. (The project includes index-loading utilities for future reuse.)Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See the LICENSE file for more information.
Empowering developers to understand codebases instantly.






