USearch
C++11 Single Header Vector Search
Compact, yet Powerful
- [x] Single C++11 header implementation, easily extendible.
- [x] 4B+ sized space efficient point-clouds with
uint40_t
.
- [x] Half-precision support with
maratyszcza/fp16
.
- [x] View from disk, without loading into RAM.
- [x] Any metric, includes:
- [x] Euclidean, Dot-product, Cosine,
- [x] Jaccard, Hamming, Haversine.
- [x] Hardware-accelerated
ashvardanian/simsimd
.
- [x] Variable dimensionality vectors.
- [x] Don't copy vectors if not needed.
- [x] Bring your threads.
- [x] Multiple vectors per label.
- [x] Python bindings:
pip install usearch
- [x] JavaScript bindings:
npm install usearch
- [x] Rust bindings:
cargo add usearch
- [ ] Wolfram language bindings.
- [x] For Linux: GCC, Clang.
- [x] For MacOS: Apple Clang.
- [ ] For Windows.
- [ ] Multi-index lookups in Python.
- [ ] Thread-safe
reserve
.
- [ ] Distributed construction.
Usage
C++
To use in a C++ project simply copy the include/usearch/usearch.hpp
header into your project.
```c++
using namespace unum::usearch;
index_gt> index;
float vec[3] = {0.1, 0.3, 0.2};
index.add(/* label: / 42, / vector: / {&vec, 3});
index.search(
/ query: / {&vec, 3}, 10 / results /,
/ callback: */ { });
```
Alternatively fetch it with CMake:
cmake
FetchContent_Declare(usearch GIT_REPOSITORY https://github.com/unum-cloud/usearch.git)
FetchContent_MakeAvailable(usearch)
Features
Bring your Threads
Performance
TODO
- JavaScript: Allow calling from "worker threads".
- Rust: Allow passing a custom thread ID.