usearch
ann-benchmarks
usearch | ann-benchmarks | |
---|---|---|
21 | 51 | |
1,691 | 4,619 | |
8.9% | - | |
9.8 | 7.7 | |
5 days ago | 7 days ago | |
C++ | Python | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
usearch
-
I'm writing a new vector search SQLite Extension
Might have a look at this library:
https://github.com/unum-cloud/usearch
It does HNSW and there is a SQLite related project, though not quite the same thing.
- USearch SQLite Extensions for Vector and Text Search
-
Ask HN: What is the state of art approximate k-NN search algorithm today?
Another worth mentioning in this thread is usearch, though not a separate algorithm, based on HNSW with a bunch of optimizations https://github.com/unum-cloud/usearch
-
Vector Databases: A Technical Primer [pdf]
I've used usearch successfully for a small project: https://github.com/unum-cloud/usearch/
- 90x Faster Than Pgvector – Lantern's HNSW Index Creation Time
-
Python, C, Assembly – Faster Cosine Similarity
The hardest (still missing) part of efficient cosine computation distance computation is picking a good epsilon for the `sqrt` calculation and avoiding "division by zero" problems.
We have an open issue about it in USearch and a related one in SimSIMD itself, so if you have any suggestions, please share your insights - they would impact millions of devices using the library (directly on servers and mobile, and through projects like ClickHouse and some of the Google repos): https://github.com/unum-cloud/usearch/issues/320
-
Show HN: I scraped 25M Shopify products to build a search engine
As you scale, you may benefit from these two projects I maintain, and the Big Tech uses :)
https://github.com/unum-cloud/usearch - for faster search
https://github.com/unum-cloud/uform - for cheaper multi-lingual multi-modal embeddings
- [P] unum-cloud/usearch: Fastest Open-Source Similarity Search engine for Vectors in Python, JavaScript, C++, C, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram 🔍
- USearch: SIMD-accelerated Vector Search Structure for 10 Programming Languages
-
Stringzilla: Fastest string sort, search, split, and shuffle using SIMD
> It doesn't appear to query CPUID
Yes, I'm actually looking for a good way to do it for other projects as well. I've looked into a couple more libs, and here is the best I've come up with so far: https://github.com/unum-cloud/usearch/blob/f942b6f334b31716f...
> Your substring routines have multiplicative worst case
Yes, that is true. It's a very simple stupid trick, just happens to work well for me :)
> It seems quite likely that your confirmation step
We have a different library internally at Unum, that avoids this shortcoming. It has a few thousand lines of C++ templates with SIMD intrinsics... and it's definitely more efficient, but the margins aren't always high. So I kept the pure C version with inlined functions as minimal and simple as possible.
> It would actually be possible to hook Stringzilla up to `memchr`'s benchmark suite if you were interested. :-)
Yes, that would be a fun thing to do! I haven't had time to look into `memchr` yet, but would expect great perf from your lib as well. For me the State of the Art is Intel HyperScan. Probably the most advanced SIMD library overall, not just for strings. I was very impressed with their perf ~5 years ago. But the repo is 200 K LOC... So get ready to invest a weekend :)
That said, I'm a bit slammed with work right now, including open-source. Hoping to ship a new major release in UCall this week, and a minor one in USearch :)
ann-benchmarks
-
Using Your Vector Database as a JSON (Or Relational) Datastore
On top of my head, pgvector only supports 2 indexes, those are running in memory only. They don't support GPU indexing, nor Disk based indexing, they also don't have separation of query and insertions.
Also with different people I've talked to, they struggle with scale past 100K-1M vector.
You can also have a look yourself from a performance perspective: https://ann-benchmarks.com/
- ANN Benchmarks
-
Approximate Nearest Neighbors Oh Yeah
https://ann-benchmarks.com/ is a good resource covering those libraries and much more.
-
pgvector vs Pinecone: cost and performance
We utilized the ANN Benchmarks methodology, a standard for benchmarking vector databases. Our tests used the dbpedia dataset of 1,000,000 OpenAI embeddings (1536 dimensions) and inner product distance metric for both Pinecone and pgvector.
-
Vector database is not a separate database category
Data warehouses are columnar stores. They are very different from row-oriented databases - like Postgres, MySQL. Operations on columns - e.g., aggregations (mean of a column) are very efficient.
Most vector databases use one of a few different vector indexing libraries - FAISS, hnswlib, and scann (google only) are popular. The newer vector dbs, like weaviate, have introduced their own indexes, but i haven't seen any performance difference -
Reference: https://ann-benchmarks.com/
-
How We Made PostgreSQL a Better Vector Database
(Blog author here). Thanks for the question. In this case the index for both DiskANN and pgvector HNSW is small enough to fit in memory on the machine (8GB RAM), so there's no need to touch the SSD. We plan to test on a config where the index size is larger than memory (we couldn't this time due to limitations in ANN benchmarks [0], the tool we use).
To your question about RAM usage, we provide a graph of index size. When enabling PQ, our new index is 10x smaller than pgvector HNSW. We don't have numbers for HNSWPQ in FAISS yet.
[0]: https://github.com/erikbern/ann-benchmarks/
- Do we think about vector dbs wrong?
-
Vector Search with OpenAI Embeddings: Lucene Is All You Need
In terms of "All You Need" for Vector Search, ANN Benchmarks (https://ann-benchmarks.com/) is a good site to review when deciding what you need. As with anything complex, there often isn't a universal solution.
txtai (https://github.com/neuml/txtai) can build indexes with Faiss, Hnswlib and Annoy. All 3 libraries have been around at least 4 years and are mature. txtai also supports storing metadata in SQLite, DuckDB and the next release will support any JSON-capable database supported by SQLAlchemy (Postgres, MariaDB/MySQL, etc).
-
Vector databases: analyzing the trade-offs
pg_vector doesn't perform well compared to other methods, at least according to ANN-Benchmarks (https://ann-benchmarks.com/).
txtai is more than just a vector database. It also has a built-in graph component for topic modeling that utilizes the vector index to autogenerate relationships. It can store metadata in SQLite/DuckDB with support for other databases coming. It has support for running LLM prompts right with the data, similar to a stored procedure, through workflows. And it has built-in support for vectorizing data into vectors.
For vector databases that simply store vectors, I agree that it's nothing more than just a different index type.
-
Vector Dataset benchmark with 1536/768 dim data
The reason https://ann-benchmarks.com is so good, is that we can see a plot of recall vs latency. I can see you have some latency numbers in the leaderboard at the bottom, but it's very difficult to make a decision.
As a practitioner that works with vector databases every day, just latency is meaningless to me, because I need to know if it's fast AND accurate, and what the tradeoff is! You can't have it both ways. So it would be helpful if you showed plots showing this tradeoff, similar to ann-benchmarks.
What are some alternatives?
StringZilla - Up to 10x faster strings for C, C++, Python, Rust, and Swift, leveraging SWAR and SIMD on Arm Neon and x86 AVX2 & AVX-512-capable chips to accelerate search, sort, edit distances, alignment scores, etc 🦖
pgvector - Open-source vector similarity search for Postgres
ustore - Multi-Modal Database replacing MongoDB, Neo4J, and Elastic with 1 faster ACID solution, with NetworkX and Pandas interfaces, and bindings for C 99, C++ 17, Python 3, Java, GoLang 🗄️
faiss - A library for efficient similarity search and clustering of dense vectors.
uform - Pocket-Sized Multimodal AI for content understanding and generation across multilingual texts, images, and 🔜 video, up to 5x faster than OpenAI CLIP and LLaVA 🖼️ & 🖋️
Milvus - A cloud-native vector database, storage for next generation AI applications
tlsh
SimSIMD - Up to 200x Faster Inner Products and Vector Similarity — for Python, JavaScript, Rust, and C, supporting f64, f32, f16 real & complex, i8, and binary vectors using SIMD for both x86 AVX2 & AVX-512 and Arm NEON & SVE 📐
vald - Vald. A Highly Scalable Distributed Vector Search Engine
kuzu - Embeddable property graph database management system built for query speed and scalability. Implements Cypher.
pgANN - Fast Approximate Nearest Neighbor (ANN) searches with a PostgreSQL database.