English | Français | 日本語 | 한국어 | Русский | 中文
Hora
[Homepage] [Document] [Examples]
Hora Search Everywhere!
Hora is an approximate nearest neighbor search algorithm (wiki) library. We implement all code in Rust🦀
for reliability, high level abstraction and high speeds comparable to C++
.
Hora, 「ほら」
in Japanese, sounds like [hōlə]
, and means Wow
, You see!
or Look at that!
. The name is inspired by a famous Japanese song 「小さな恋のうた」
.
Demos
👩 Face-Match [online demo], have a try!
🍷 Dream wine comments search [online demo], have a try!
Features
-
Performant ⚡️
- SIMD-Accelerated (packed_simd)
- Stable algorithm implementation
- Multiple threads design
-
Supports Multiple Languages ☄️
-
Python
-
Javascript
-
Java
-
Go
(WIP) -
Ruby
(WIP) -
Swift
(WIP) -
R
(WIP) -
Julia
(WIP) - Can also be used as a service
-
-
Supports Multiple Indexes 🚀
-
Hierarchical Navigable Small World Graph Index (HNSWIndex)
(details) -
Satellite System Graph (SSGIndex)
(details) -
Product Quantization Inverted File(PQIVFIndex)
(details) -
Random Projection Tree(RPTIndex)
(LSH, WIP) -
BruteForce (BruteForceIndex)
(naive implementation with SIMD)
-
-
Portable 💼
- Supports
WebAssembly
- Supports
Windows
,Linux
andOS X
- Supports
IOS
andAndroid
(WIP) - Supports
no_std
(WIP, partial) -
No heavy dependencies, such as
BLAS
- Supports
-
Reliability 🔒
-
Rust
compiler secures all code - Memory managed by
Rust
for all language libraries such asPython's
- Broad testing coverage
-
-
Supports Multiple Distances 🧮
-
Dot Product Distance
-
Euclidean Distance
-
Manhattan Distance
-
Cosine Similarity
-
-
Productive ⭐
- Well documented
- Elegant, simple and easy to learn API
Installation
Rust
in Cargo.toml
Python
Javascript (WebAssembly)
Building from source
Benchmarks
by aws t2.medium (CPU: Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz)
more information
Examples
Rust
example [more info]
thank @vaaaaanquish for this complete pure Rust 🦀
image search example, For more information about this example, you can click Pure Rust な近似最近傍探索ライブラリ hora を用いた画像検索を実装する
Python
example [more info]
JavaScript
example [more info]
Java
example [more info]
Roadmap
- Full test coverage
- Implement EFANNA algorithm to achieve faster KNN graph building
- Swift support and iOS/macOS deployment example
- Support
R
- support
mmap
Related Projects and Comparison
-
Faiss, Annoy, ScaNN:
-
Hora
's implementation is strongly inspired by these libraries. -
Faiss
focuses more on the GPU scenerio, andHora
is lighter than Faiss (no heavy dependencies). -
Hora
expects to support more languages, and everything related to performance will be implemented by Rust🦀. -
Annoy
only supports theLSH (Random Projection)
algorithm. -
ScaNN
andFaiss
are less user-friendly, (e.g. lack of documentation). - Hora is ALL IN RUST 🦀.
-
-
Milvus, Vald, Jina AI
-
Milvus
andVald
also support multiple languages, but serve as a service instead of a library -
Milvus
is built upon some libraries such asFaiss
, whileHora
is a library with all the algorithms implemented itself
-
Contribute
We appreciate your participation!
We are glad to have you participate, any contributions are welcome, including documentations and tests.
You can create a Pull Request
or Issue
on GitHub, and we will review it as soon as possible.
We use GitHub issues for tracking suggestions and bugs.
Clone the repo
Build
Test
Try the changes
License
The entire repository is licensed under the Apache License.