akdybala's picture
Use browser MiniLM embeddings
6ed4eb1 verified
|
Raw History Blame Contribute Delete
1.21 kB
---
title: CodeRAG Retrieval Console
sdk: static
---
# CodeRAG Retrieval Console
CodeRAG is a small code retrieval app. Paste Python code, build a function-level vector index, ask a natural-language question, and retrieve the top matching functions.
## What it demonstrates
- React UI for code input and retrieval inspection.
- Python API for indexing and search.
- AST-based function and method extraction.
- SQLite-backed vector database.
- Browser neural embeddings with `Xenova/all-MiniLM-L6-v2`, with deterministic hashing fallback.
- Multi-view retrieval over raw code, propagated call context, and semantic synthetic questions.
## Local run
```powershell
cd coderag_ui
npm install
npm run build
cd ..
python -m pip install -r requirements.txt
python coderag_api.py --host 127.0.0.1 --port 7860
```
Open `http://127.0.0.1:7860`.
## API
```txt
GET /api/health
GET /api/coderag/stats
POST /api/coderag/index-code
POST /api/coderag/search
POST /api/coderag/rebuild
```
The free Hugging Face Space runs as a static browser app. The hosted Space builds an in-browser vector index with a lightweight MiniLM embedder. The Python API and SQLite vector database are included for local or Docker use.