Skip to content

rafael-robsonn/repomind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RepoMind πŸ”

Context-Aware AI Code Review β€” AMD Developer Hackathon 2026

Multi-agent system that learns your repository first (AST + 3D knowledge graph), then runs context-aware code review on your PRs.

> Note: This application is designed to run locally for privacy and performance. Follow the installation guide below to run the demo.


🎯 Key features

  1. AST analysis with tree-sitter β€” extracts symbols, imports, real dependencies
  2. Interactive 3D knowledge graph β€” Three.js, force-directed, visualizes architecture
  3. Automatic project profile β€” architecture, patterns, conventions (via LLM)
  4. Multi-query retrieval β€” search by file, symbol, and semantics
  5. Reviewer with few-shot β€” examples of good vs. bad justification
  6. Adversarial Critic β€” filters generic issues before the final report
  7. Privacy first β€” local Ollama, your code never leaves your machine
  8. Secure secrets β€” centralized config, automatic masking in logs

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  INDEXER (runs once per repo)                       β”‚
β”‚  Files β†’ AST (tree-sitter) β†’ Knowledge Graph        β”‚
β”‚              ↓                                      β”‚
β”‚       Project Profile (LLM)                         β”‚
β”‚              ↓                                      β”‚
β”‚       Vector Store (ChromaDB)                       β”‚
β”‚              ↓                                      β”‚
β”‚       3D Graph (Three.js)                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  REVIEW PIPELINE (LangGraph)                        β”‚
β”‚  Diff β†’ Parse β†’ Contextualize β†’ Review              β”‚
β”‚                                     ↓               β”‚
β”‚                                  Critic             β”‚
β”‚                                     ↓               β”‚
β”‚                                  Report             β”‚
β”‚                                                     β”‚
β”‚  Context files GLOW in the 3D graph in real time    β”‚
β”‚  while the pipeline runs                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start (Windows)

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • Ollama installed

Automatic setup

From the project folder:

setup.bat

Does everything: creates the venv, installs deps, pulls the Ollama model, validates.

Run

:: Terminal 1
run_backend.bat

:: Terminal 2
run_frontend.bat

Open http://localhost:5173

Build as EXE

To produce a single RepoMind.exe (frontend + backend bundled):

build.bat

Output: dist\RepoMind.exe (~500MB). See BUILD_EXE.md for details.


πŸ” Credentials security

API keys are NEVER stored in code. Everything goes through .env:

backend/.env             ← your credentials (DO NOT commit)
backend/.env.example     ← template (safe to commit)
backend/config.py        ← loads and validates secrets
.gitignore               ← protects .env

The backend:

  • Validates config on startup and fails fast if anything is missing
  • Automatically masks any credential that shows up in logs
  • The /config endpoint returns public info (provider/model) without keys
  • WebSockets sanitize messages before sending them to the frontend

Switching providers (Ollama β†’ AMD Cloud β†’ Groq) is just editing .env. Zero code changes.


🎨 Interface

3D Knowledge Graph (Three.js):

  • Nodes = files, size proportional to LOC
  • Colors by language
  • Edges = imports
  • Drag to rotate, scroll to zoom, click nodes to inspect
  • During review, context files pulse in red showing exactly what the RAG retrieved

Live pipeline visualizer:

  • Each agent lights up green with timing
  • Shows queries used, retrieved context, issues raised vs. filtered out by the Critic

πŸ“ Structure

repomind/
β”œβ”€β”€ setup.bat              ← automatic Windows setup
β”œβ”€β”€ run_backend.bat        ← starts the backend
β”œβ”€β”€ run_frontend.bat       ← starts the frontend
β”œβ”€β”€ README.md
β”œβ”€β”€ .gitignore             ← protects secrets
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config.py          ← config + secret sanitization
β”‚   β”œβ”€β”€ agents/
β”‚   β”‚   β”œβ”€β”€ llm_client.py
β”‚   β”‚   β”œβ”€β”€ code_analyzer.py    ← AST via tree-sitter
β”‚   β”‚   β”œβ”€β”€ indexer.py          ← + serialize_graph_for_viz
β”‚   β”‚   β”œβ”€β”€ diff_parser.py
β”‚   β”‚   β”œβ”€β”€ contextualizer.py
β”‚   β”‚   β”œβ”€β”€ reviewer.py
β”‚   β”‚   └── pipeline.py
β”‚   β”œβ”€β”€ api/main.py        ← + /config + /repos/{id}/graph
β”‚   β”œβ”€β”€ .env.example
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ package.json       ← + three
β”‚   β”œβ”€β”€ vite.config.js
β”‚   β”œβ”€β”€ index.html
β”‚   └── src/
β”‚       β”œβ”€β”€ main.jsx
β”‚       β”œβ”€β”€ App.jsx
β”‚       └── components/
β”‚           └── GraphViz3D.jsx   ← Three.js graph
β”‚
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ validate_setup.py
β”‚   └── test_e2e.py
β”‚
└── sample_diffs/

πŸ”§ Switching provider

Edit backend/.env:

Ollama (default, local)

AMD_BASE_URL=http://localhost:11434/v1
AMD_API_KEY=ollama
AMD_MODEL=qwen2.5-coder:14b

AMD Developer Cloud (when credits arrive)

AMD_BASE_URL=https://api.amd.com/v1
AMD_API_KEY=your_amd_key
AMD_MODEL=Qwen/Qwen2.5-Coder-32B-Instruct

Groq (free, fast)

AMD_BASE_URL=https://api.groq.com/openai/v1
AMD_API_KEY=gsk_...
AMD_MODEL=qwen-2.5-coder-32b

🎬 Demo flow

  1. Point it at a real Python project (FastAPI/Django/anything)
  2. Live indexing β†’ 3D graph appears, profile extracted
  3. Paste a diff that violates a project-specific pattern
  4. Streaming pipeline β†’ each agent lights up, context is retrieved
  5. Relevant files pulse in the 3D graph ← this is the "wow moment"
  6. Result: issues with project-specific justification

βš™οΈ Stack

Component Tech
Orchestration LangGraph
LLM Qwen2.5-Coder via Ollama / AMD ROCm
AST tree-sitter
Embeddings BAAI/bge-small-en-v1.5 (local CPU)
Vector Store ChromaDB
Knowledge Graph NetworkX + Three.js
Cache DiskCache
Backend FastAPI + WebSockets
Frontend React + Vite + Three.js

πŸ› Troubleshooting

"AMD_API_KEY not configured" β†’ cd backend && copy .env.example .env

"Could not connect to localhost:11434" β†’ Ollama isn't running. Open the app (tray icon) or run ollama serve.

"Model not installed" β†’ ollama pull qwen2.5-coder:14b

Slow pipeline β†’ Check Task Manager to see if the GPU is actually being used. If it falls back to CPU, reinstall NVIDIA drivers. Or use a smaller model: ollama pull qwen2.5-coder:7b

3D graph doesn't show up β†’ Index a repo first (step 01 in the UI). Then select it under "REPOS".

About

Context-aware AI code review. Multi-agent system that indexes your repo (AST + 3D knowledge graph) before reviewing PRs, so issues come with project-specific justification not generic linter noise.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors