unum-cloud / usearch

Fast Open-Source Search & Clustering engine Γ— for Vectors & πŸ”œ Strings Γ— in C++, C, Python, JavaScript, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram πŸ”
https://unum-cloud.github.io/usearch/
Apache License 2.0
2.27k stars 143 forks source link

Feature: allow larger keys #340

Open MathGeniusJodie opened 10 months ago

MathGeniusJodie commented 10 months ago

Describe what you are looking for

this library does everything we need it to do except allow 128 bit keys, it would be nice if we didn't need to fork it

Can you contribute to the implementation?

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

Code of Conduct

ashvardanian commented 10 months ago

Thanks @MathGeniusJodie! That feature makes sense! I will look into it πŸ€—

ashvardanian commented 6 months ago

The library easily supports 128 bit keys in the C++ layer. Can you please clarify which bindings you plan to use, @MathGeniusJodie?

If we assume it’s Python, one way to implement this would be to store an std::variant of different template instantiations of an index_dense_gt in python/lib.cpp. I think we can stick to just 2 overloads - 64-bit keys with 32-bit slots and 128-bit keys with 40-bit slots. This may be exposed as 2 separate classes, like Index and IndexBig. Any chance you try implementing it and open a PR?