Horapy
🐍 Python bidding for the Hora Approximate Nearest Neighbor Search Algorithm library
Install / Use
/learn @hora-search/HorapyREADME
horapy
[Homepage] [Document] [Examples] [Hora]
Python binding for the Hora Approximate Nearest Neighbor Search
Key Features
-
Performant ⚡️
- SIMD-Accelerated (packed_simd)
- Stable algorithm implementation
- Multiple threads design
-
Multiple Indexes Support 🚀
-
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
Rust - Broad testing coverage
-
Multiple Distances Support 🧮
Dot Product DistanceEuclidean DistanceManhattan DistanceCosine Similarity
-
Productive ⭐
- Well documented
- Elegant and simple API, easy to learn
Benchmark
<img src="asset/fashion-mnist-784-euclidean_10_euclidean.png"/>by aws t2.medium (CPU: Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz) more information
Installation
pip install horapy
Example
import numpy as np
from horapy import HNSWIndex
dimension = 50
n = 1000
# init index instance
index = HNSWIndex(dimension, "usize")
samples = np.float32(np.random.rand(n, dimension))
for i in range(0, len(samples)):
# add node
index.add(np.float32(samples[i]), i)
index.build("euclidean") # build index
target = np.random.randint(0, n)
# 410 in Hora ANNIndex <HNSWIndexUsize> (dimension: 50, dtype: usize, max_item: 1000000, n_neigh: 32, n_neigh0: 64, ef_build: 20, ef_search: 500, has_deletion: False)
# has neighbors: [410, 736, 65, 36, 631, 83, 111, 254, 990, 161]
print("{} in {} \nhas neighbors: {}".format(
target, index, index.search(samples[target], 10))) # search
License
The entire repo is under Apache License.
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
109.5kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
349.2kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
