randomfunction/vector_database — explained in plain English
Analysis updated 2026-05-18
Study a from-scratch C++ implementation of HNSW approximate nearest neighbor search.
Run a full-stack semantic search demo with a FastAPI backend and React frontend.
Benchmark vector search performance against the SIFT1M dataset.
Learn how AVX2 SIMD instructions speed up distance calculations in a search engine.
| randomfunction/vector_database | 00kaku/gallery-slider-block | 3rd-eden/ircb.io | |
|---|---|---|---|
| Stars | 0 | — | — |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | — | 2021-05-19 | 2016-11-16 |
| Maintenance | — | Dormant | Dormant |
| Setup difficulty | hard | easy | easy |
| Complexity | 5/5 | 2/5 | 2/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires compiling C++ with CMake and downloading a multi-gigabyte FastText model file.
This project is a vector database and semantic search engine built from scratch in C++, paired with a Python backend and a React frontend. A vector database stores pieces of text as long lists of numbers, called embeddings, that capture their meaning, so you can search by similarity rather than exact keyword matches. The core search engine here uses a graph based technique called HNSW, which organizes vectors into layers so it can find close matches quickly without comparing a query against every single item. The author focused heavily on low level performance. The engine stores its data in flat, contiguous arrays instead of the usual nested data structures, aligned to 64 bytes in memory so the CPU can read them efficiently. Distance calculations, the math used to measure how similar two vectors are, are hand written using AVX2 instructions that let the processor handle eight numbers at once instead of one at a time. On top of the C++ engine, text is turned into vectors using Facebook's pretrained FastText model, which can handle misspelled or unfamiliar words because it works with word pieces rather than whole words only. The C++ engine is exposed to Python through pybind11, a tool for connecting C++ and Python code directly, and a FastAPI server handles incoming search requests, also filtering out near duplicate results using a text similarity measure called Levenshtein distance. The project reports benchmark numbers on the standard SIFT1M dataset of one million vectors: about 99.3 percent accuracy at returning the correct top 10 matches, over 2,200 queries handled per second, and typical response times under one millisecond. The backend is packaged with Docker and deployed on Hugging Face Spaces, while the frontend is hosted on Vercel. To run it locally you compile the C++ engine with CMake, start the FastAPI backend after downloading the FastText model file, and run the React frontend separately with npm.
A vector search database written in C++ from scratch, with a FastAPI backend and React frontend for semantic search.
Mainly JavaScript. The stack also includes C++, Python, FastAPI.
Setup difficulty is rated hard, with roughly 1h+ to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.