A Retrieval-Augmented Generation (RAG) system featuring a high-performance 3D visualization of the Hierarchical Navigable Small World (HNSW) algorithm. This project demonstrates how vector search works under the hood with an interactive, beautiful interface.
- 3D HNSW Visualization: Interactive 3D view of HNSW layers, nodes, and connections using React Three Fiber.
- Real-time Search: Visualize the search path through HNSW layers as you query documents.
- RAG Backend: Fast API backend using Qdrant for vector storage and Jina AI for embeddings.
- Smart Chunking: text processing with sliding window chunking to ensure relevant search results.
- Modern UI: Sleek, dark-themed interface built with React, Tailwind CSS, and Framer Motion.
- React 18
- Vite
- Three.js / React Three Fiber
- Tailwind CSS
- Framer Motion
- FastAPI
- Qdrant (Vector Database)
- Jina AI (Embeddings)
- Python 3.10+
- Node.js 18+
- Python 3.10+
- Qdrant instance (local or cloud)
- Jina AI API Key
-
Clone the repository:
git clone https://github.com/Nishant2116/HNSW-RAG.git cd HNSW-RAG -
Setup Backend:
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
Create a
.envfile inbackend/with:JINA_API_KEY=your_key_here QDRANT_HOST=localhost QDRANT_PORT=6333 -
Setup Frontend:
cd frontend npm install
-
Start Backend:
# In backend/ directory uvicorn main:app --reload -
Start Frontend:
# In frontend/ directory npm run dev
- Open the frontend (usually http://localhost:5173).
- Use the "Ingest" tab to upload documents (PDF, DOCX, TXT).
- Switch to "Search" and enter a query.
- Watch the 3D visualization show how the HNSW algorithm finds the nearest neighbors!
MIT