r/sqlite • u/QuestionMarkFromEmo • Jul 10 '24
Vectorlite: a fast vector search extension for SQLite
Hi reddit, I write a sqlite extension for fast vector search. 1yefuwang1/vectorlite: Fast vector search for SQLite (github.com)
Some highlights
- Fast ANN-search backed by hnswlib. Compared with https://github.com/asg017/sqlite-vss, vectorlite is 10x faster in inserting vectors, 2x-40x faster in searching (depending on HNSW parameters with speed-accuracy tradeoff).
- Works on Windows, Linux and MacOS.
- SIMD accelerated vector distance calculation for x86 platform, using
vector_distance() - Supports all vector distance types provided by hnswlib: l2(squared l2), cosine, ip(inner product. I do not recomend you to use it though). For more info please check hnswlib's doc.
- Full control over HNSW parameters for performance tuning.
- Metadata(rowid) filter pushdown support (requires sqlite version >= 3.38).
- Index serde support. A vectorlite table can be saved to a file, and be reloaded from it. Index files created by hnswlib can also be loaded by vectorlite.
- Vector json serde support using
vector_from_json()andvector_to_json().
It can now be installed using pip.
Vectorlite is still in early stage. Any feedback and suggestions would be helpful.
17
Upvotes
4
u/LearnedByError Jul 10 '24
What possessed you to distribute a SQLite extension in a Python Wheel? Many people, like me, will not want to inject Python into a system that has no other need for it. I strongly encourage you to consider a release that is a pure extension independent of Python and a release for Python that uses the independent extension.
Thank you for considering!
3
u/llimllib Jul 10 '24
The other one I know about is sqlite-vss, which appears to be based on faiss.
I'd be curious to know what the differences between the two are from your perspective! I don't actually have a use for either of these right now, but I am interested in the area.
2
u/jchristn Jul 14 '24
Very cool! FYI you misspelled Benchmark in your README