Author: Shubham Rajpurohit
A custom, low-latency vector database engineered entirely from scratch in C++. This project bypasses standard Python wrappers (such as LangChain or ChromaDB) to implement foundational spatial indexing algorithms at the systems level. It includes a fully integrated Retrieval-Augmented Generation (RAG) pipeline powered by local LLMs via Ollama, demonstrating a complete end-to-end AI backend architecture.
Implemented a multi-layer graph index for approximate nearest-neighbor search, achieving O(log N) retrieval complexity for high-dimensional semantic embeddings.
Built-in side-by-side performance comparisons between:
- HNSW
- KD-Tree (axis-aligned space partitioning)
- Exact Brute Force Search
to evaluate retrieval speed and accuracy.
Seamless HTTP integration with local Ollama instances.
- Embedding Model:
nomic-embed-text(768-dimensional embeddings) - Language Model:
llama3.2
The system generates document embeddings, performs semantic retrieval, and produces context-aware responses using a fully local RAG pipeline.
A lightweight C++ backend serves a responsive web interface with real-time PCA dimensionality reduction for visualizing vector clusters.
| Category | Technologies |
|---|---|
| Backend | C++17, Winsock2 |
| AI / ML | Ollama, Llama 3.2, Nomic Embeddings |
| Frontend | HTML5, CSS3, Vanilla JavaScript |
| Visualization | PCA (Principal Component Analysis) |
- MSYS2 (GCC Compiler)
- Ollama
ollama pull nomic-embed-text
ollama pull llama3.2g++ -std=c++17 -O2 main.cpp -o db -lws2_32./dbThen open your browser and visit:
http://localhost:8080