Usearch

Latest version: v2.16.6

Safety actively analyzes 688178 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 27

2.11.2

[2.11.2](https://github.com/unum-cloud/usearch/compare/v2.11.1...v2.11.2) (2024-04-10)


Make

* Add submodules to Crates ([86a8d8c](https://github.com/unum-cloud/usearch/commit/86a8d8caa2c4d9775ff95404a1e070687941da99))
* Package submodules without `Cargo.toml` ([facb5dc](https://github.com/unum-cloud/usearch/commit/facb5dc5285a12d3c4af6951d49258de2c6890a2)), closes [#378](https://github.com/unum-cloud/usearch/issues/378)

2.11.1

[2.11.1](https://github.com/unum-cloud/usearch/compare/v2.11.0...v2.11.1) (2024-04-10)


Docs

* Filtering predicates examples ([e2498c5](https://github.com/unum-cloud/usearch/commit/e2498c5b3cb5c767ed7be4fc6d852c3df95bce70))
* TypeScript instructions ([f4df7ac](https://github.com/unum-cloud/usearch/commit/f4df7aceda7caa45ab01f65413fd0eaa20329345))

Fix

* Support oversubscribed threads ([266099e](https://github.com/unum-cloud/usearch/commit/266099e5b315bd72487d35722de3be34ec78f0f3)), closes [#389](https://github.com/unum-cloud/usearch/issues/389)

Make

* Build JS before generating docs (385) ([f417c11](https://github.com/unum-cloud/usearch/commit/f417c11dd856f96451a2614d78c8f14c26ae7268)), closes [#385](https://github.com/unum-cloud/usearch/issues/385)




Hashes
* docs.tar.gz : `97053d32eac8e71435ad05c0671c6183bc7b28828815596f8ab1c7240fea4d8d`
* usearch-v2.11.1.tar.gz : `ec0313075abca15b051861c79249bc0ecb61ca0b524b4a38a499640955cc6219`
* usearch-v2.11.1.zip : `747cb92753480a8b7151cf5c8629e98bd4051d00c02b2c12babb5df309550dd4`
* usearch_linux_amd64_2.11.1.deb : `dfa17acc264ae9ff45b26f515a48b75833addee482c57fd4ba4dba18bbfcaaf8`
* usearch_linux_amd64_2.11.1.so : `af72082cf2f706d576ba71fc1c2340f332561bf4393b3681f327143cfda3c0f6`
* usearch_linux_arm64_2.11.1.deb : `d85daabf1b9a94fe58d9a02a984df1e2a6fcf0483f9cdc21ff9e4abc2145f63c`
* usearch_linux_arm64_2.11.1.so : `3bf3554ba918ddb41bb135afb6a6d97795943762caa404ff843b0abc9e085928`
* usearch_macos_arm64_2.11.1.zip : `771de3e7c375be5074ef122e87814bdda9596e38efa25566089bb8070b88a2bc`
* usearch_macos_x86_64_2.11.1.zip : `6668e246afd0cc106c8001db3876e042c11c099fef0d0376e3410586358a0282`
* usearch_sqlite_linux_amd64_2.11.1.so : `1aa79b5bf9851e4462573123fa297a3212c19c5efee710eaa37547d4f113bc35`
* usearch_sqlite_linux_arm64_2.11.1.so : `305156117503c84c1b604114473c72baee5e23113132f409d6e517b1af31c3b3`
* usearch_sqlite_macos_arm64_2.11.1.dylib : `afa73438214bb258756cdf0ed140e91cb48bd5bf4455af2454b69f2d22cc91f8`
* usearch_sqlite_macos_x86_64_2.11.1.dylib : `2bdd2764ebfab1ea0cde647f705a4423972583a4086461da22a51c827f232d32`
* usearch_wasm_linux_arm64_2.11.1.tar.gz : `877b0f52152aad8f67816655a60b1be2a29e18d07f8830e1bf0e81d11ce4fc2a`
* usearch_wasm_linux_x86_64_2.11.1.tar.gz : `c51d76f5a599d5a449e1e71ffad46ee21869a1bc35c101ef948b3564ee9bc9ac`

2.11.0

c
include <stdio.h> // For printing.
include <assert.h> // For assertions!
include <usearch/usearch.h> // For the win 🚀


Filtering with Predicates

The new USearch release exposes low-level C++ predicated-search functionality to Rust and C 99, also providing several convenience methods already present in the Python and JavaScript APIs. In Rust you may use it like this:

rust
let is_odd = |key: Key| key % 2 == 1;
let query = vec![0.2, 0.1, 0.2, 0.1, 0.3];
let results = index.filtered_search(&query, 10, is_odd).unwrap();
assert!(
results.keys.iter().all(|&key| key % 2 == 1),
"All keys must be odd"
);


The same using the C:

c
int is_odd(usearch_key_t key, void* state) {
return key % 2;
}

int main() {
...
usearch_key_t found_keys[10];
usearch_distance_t found_distances[10];
usearch_filtered_search(
index, &query[0], usearch_scalar_f32_k, 10,
&is_odd, NULL, // no state needed for this callback
&found_keys[0], &found_distances[0], &error);


User Defined Metrics

While most vector search packages concentrate on just two metrics, "Inner Product distance" and "Euclidean distance", USearch allows arbitrary user-defined metrics. This flexibility allows you to customize your search for various applications, from computing geospatial coordinates with the rare [Haversine][haversine] distance to creating custom metrics for composite embeddings from multiple AI models, like joint image-text embeddings. You could already use [Numba][numba], [Cppyy][cppyy], or [PeachPy][peachpy] to define your [custom metric even in Python](https://unum-cloud.github.io/usearch/python#user-defined-metrics-and-jit-in-python):

[numba]: https://numba.readthedocs.io/en/stable/reference/jit-compilation.html#c-callbacks
[cppyy]: https://cppyy.readthedocs.io/en/latest/
[peachpy]: https://github.com/Maratyszcza/PeachPy

py
from numba import cfunc, types, carray
from usearch.index import Index, MetricKind, MetricSignature, CompiledMetric

cfunc(types.float32(types.CPointer(types.float32), types.CPointer(types.float32)))
def python_inner_product(a, b):
a_array = carray(a, ndim)
b_array = carray(b, ndim)
c = 0.0
for i in range(ndim):
c += a_array[i] * b_array[i]
return 1 - c

metric = CompiledMetric(pointer=python_inner_product.address, kind=MetricKind.IP, signature=MetricSignature.ArrayArray)
index = Index(ndim=ndim, metric=metric, dtype=np.float32)


Similar effect was much easier to achieve in the C++ layer, and is now also exposed to Rust and C.

c
simsimd_distance_t callback(void const* a, void const* b, void* state) {
// Your custom metric implementation here
}

int main() {
...
void callback_state = NULL;
usearch_change_metric(index, callback, callback_state, usearch_metric_unknown_k, &error);


Let's say you are implementing a weighted distance function to search through joint embeddings of images and textual descriptions of some products in a catalog, taking some [UForm](https://github.com/unum-cloud/uform) or CLIP-like multimodal embedding models. Implementing that in Rust using [SimSIMD](https://github.com/ashvardanian/simsimd) for unimodal slices may look like:

rust
use simsimd::SpatialSimilarity;

let image_dimensions: usize = 768;
let text_dimensions: usize = 512;

2.10.5

[2.10.5](https://github.com/unum-cloud/usearch/compare/v2.10.4...v2.10.5) (2024-04-04)


Fix

* Ensure Rust build aborts on error ([7c0095a](https://github.com/unum-cloud/usearch/commit/7c0095a1601f28334987564665a380b0ca1d91ed))

Make

* JS CI cross compiling (383) ([6e1356c](https://github.com/unum-cloud/usearch/commit/6e1356c83a34b6dac938099e47af0af4fc447de9)), closes [#383](https://github.com/unum-cloud/usearch/issues/383)

2.10.4

[2.10.4](https://github.com/unum-cloud/usearch/compare/v2.10.3...v2.10.4) (2024-04-02)


Fix

* TypeScript docs ([28688ac](https://github.com/unum-cloud/usearch/commit/28688ac343ea58778a69461ba964d35cb6af98ea))

Make

* NodeJS packaging (379) ([4b0cd31](https://github.com/unum-cloud/usearch/commit/4b0cd310ca74d229b33a5af17cd886f0430bba11)), closes [#379](https://github.com/unum-cloud/usearch/issues/379)

2.10.3

[2.10.3](https://github.com/unum-cloud/usearch/compare/v2.10.2...v2.10.3) (2024-04-02)


Make

* Create missing directories ([39cf7c3](https://github.com/unum-cloud/usearch/commit/39cf7c3a7d217087d6608f6be815b10cce0a5524))

Page 5 of 27

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.