# Introduction
# Hora Search Everywhere!
Hora, a approximate nearest neighbor search algorithm library. We implement all code in Rust🦀 for reliability, high level abstraction and high speed comparable to C++, these make it really suitable for Artificial Intellingence Computing scene.
Hora, 「ほら」 in Japanese, sound like [hōlə], means Wow, You see! or Look at that!. he name is inspired by a famous lyrics 「ほら あなたにとって大事な人ほど すぐそばにいるの」 of a famous Japanese song 小さな恋のうた, it means You See, the most important people to you is always stay near you
# Approximate Nearest Neighbor
As shown in the picture below, we have a large data set. Each piece of data is an array<float> (usually a float) representing a store. Now the request is also an array<float>. We now hope that we Find k points with the smallest
make it in math language:
ND-dim query vectors
1D-dim query vector
Task:Given
for futher more information, I really recommend this speech tutorial [CVPR20 Tutorial] Billion-scale Approximate Nearest Neighbor Search present in CVPR2020
# Key Features
Performant ⚡️
- SIMD-Accelerated (packed_simd (opens new window))
- Stable algorithm implementation
- Multiple threads design
Multiple Languages Support ☄️
PythonJavascriptJavaGo(WIP)Ruby(WIP)Swift(WIP)R(WIP)Julia(WIP)- also can serve as a service
Multiple Indexes Support 🚀
Hierarchical Navigable Small World Graph Index(HNSWIndex)(detail (opens new window))Satellite System Graph (SSGIndex)(detail (opens new window))Product Quantization Inverted File(PQIVFIndex)(detail (opens new window))Random Projection Tree(RPTIndex)(LSH, WIP)BruteForce (BruteForceIndex)(naive implementation with SIMD)
Portable 💼
- Support
no_std(WIP, partial) - Support
Windows,LinuxandOS X - Support
IOSandAndroid(WIP) - No heavy dependency, such as
BLAS
- Support
Reliability 🔒
Rustcompiler secure all code- Memory managed by
Rustfor all language libs such asPython lib - Broad testing coverage
Multiple Distances Support 🧮
Dot Product DistanceEuclidean DistanceManhattan DistanceCosine Similarity
Productive ⭐
- Well documented
- Elegant and simple API, easy to learn
# Related Projects and Comparison
Faiss (opens new window), Annoy (opens new window), ScaNN (opens new window):
Hora's implementation is strongly inspired by these lib.Faissfocus more on the GPu scenerio, andHorais lighter than Faiss, such as no heavy dependency.Horaexpects to support more language, and everything related to performance shall be implemented by Rust🦀.Annoyonly supportLSH(Random Projection)algorithm.ScaNNandFaissare less user-friendly, such as lack of document.- Hora is ALL IN RUST 🦀.
Milvus (opens new window), Vald (opens new window), Jina AI (opens new window)
MilvusandValdalso support multiple languages, but serve as a service instead of a libMilvusis built upon some libs such asFaiss, whileHorais an algorithm lib with all the algo implemented by itself