RESEARCH PROTOTYPE · LEARNED DATA STRUCTURES · VECTOR SEARCH
Learned ANN Index
Can a learned recursive partition model guide embedding search? This prototype explores centroid-based RMI routing with exact or HNSW leaf search and compares quality, throughput, build time, and memory with IVF-PQ and optional HNSW/ScaNN baselines.
This is a research experiment, not a claim that learned routing outperforms mature ANN systems. Its bundled dataset is synthetic; evaluate representative, authorized embeddings before drawing conclusions.
Learned routing, measured trade-offs
- Recursive k-means routing selects candidate leaf partitions.
- Exact scan is the default within a partition; local HNSW is optional.
- Residual product quantization provides a self-contained IVF-PQ baseline.
- Optional adapters expose Faiss IVF-PQ, hnswlib, and ScaNN comparisons.
The benchmark reports recall@k against brute-force ground truth, sequential QPS, build time, and documented memory estimates. The Streamlit dashboard plots the recall/QPS frontier.
Run a reproducible synthetic benchmark
cd learned-ann
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,dashboard]"
learned-ann benchmark \
--vectors 4000 --queries 160 --dimension 32 \
--indexes learned-rmi ivf-pq \
--output results/ann-benchmark.json
streamlit run dashboard.pyNative baselines are optional extras; hardware, dataset, query batching, and index parameters affect comparisons. The project README documents what memory and QPS do and do not measure.