Interactive demo

OVec

OVec is a vector database written from scratch in pure Python and NumPy, with no FAISS and no scikit-learn. A fresh database searches exactly: it compares the query with every stored vector. Calling build_index() clusters the vectors with k-means++, and from then on a search scans only the nprobe clusters closest to the query. That is faster, but it can miss true neighbours.

Starting Python in your browser

  1. Python runtime Pyodide 314.0.7
  2. NumPy
  3. OVec source vector_db/*.py
  4. Generating vectors

0.0 s · about 10 MB on the first visit, cached afterwards

Recall against nprobe

Recall@k Vectors scanned, % of all
Build the index to measure the trade-off.