{"id":13477151,"url":"https://github.com/hora-search/horapy","last_synced_at":"2025-03-27T04:32:39.473Z","repository":{"id":48071588,"uuid":"376644696","full_name":"hora-search/horapy","owner":"hora-search","description":"🐍  Python bidding for the Hora Approximate Nearest Neighbor Search Algorithm library","archived":false,"fork":false,"pushed_at":"2021-10-11T00:53:15.000Z","size":98,"stargazers_count":69,"open_issues_count":2,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-01T16:47:40.586Z","etag":null,"topics":["approximate-nearest-neighbor-search","artificial-intelligence","image-search","python","python-library","recommendation-system","search","search-engine"],"latest_commit_sha":null,"homepage":"https://horasearch.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hora-search.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-13T21:36:15.000Z","updated_at":"2024-01-04T16:58:35.000Z","dependencies_parsed_at":"2022-08-25T08:00:29.004Z","dependency_job_id":null,"html_url":"https://github.com/hora-search/horapy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hora-search%2Fhorapy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hora-search%2Fhorapy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hora-search%2Fhorapy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hora-search%2Fhorapy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hora-search","download_url":"https://codeload.github.com/hora-search/horapy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222194742,"owners_count":16946982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["approximate-nearest-neighbor-search","artificial-intelligence","image-search","python","python-library","recommendation-system","search","search-engine"],"created_at":"2024-07-31T16:01:38.826Z","updated_at":"2025-03-27T04:32:39.468Z","avatar_url":"https://github.com/hora-search.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"asset/logo.svg\" width=\"70%\"/\u003e\n\u003c/div\u003e\n\n# horapy\n\n**[[Homepage](http://horasearch.com/)]** **[[Document](https://horasearch.com/doc)]** **[[Examples](https://horasearch.com/doc/example.html)]** **[[Hora](https://github.com/hora-search/hora)]** \n\nPython binding for the **`Hora Approximate Nearest Neighbor Search`**\n\n# Key Features\n\n* **Performant** ⚡️\n  * **SIMD-Accelerated ([packed_simd](https://github.com/rust-lang/packed_simd))**\n  * **Stable algorithm implementation**\n  * **Multiple threads design**\n\n* **Multiple Indexes Support** 🚀\n  * `Hierarchical Navigable Small World Graph Index(HNSWIndex)` ([detail](https://arxiv.org/abs/1603.09320))\n  * `Satellite System Graph (SSGIndex)` ([detail](https://arxiv.org/abs/1907.06146))\n  * `Product Quantization Inverted File(PQIVFIndex)` ([detail](https://lear.inrialpes.fr/pubs/2011/JDS11/jegou_searching_with_quantization.pdf))\n  * `Random Projection Tree(RPTIndex)` (LSH, WIP)\n  * `BruteForce (BruteForceIndex)` (naive implementation with SIMD)\n\n* **Portable** 💼\n  * Support `no_std` (WIP, partial)\n  * Support `Windows`, `Linux` and `OS X`\n  * Support `IOS` and `Android` (WIP)\n  * **No** heavy dependency, such as `BLAS`\n\n* **Reliability** 🔒\n  * `Rust` compiler secure all code\n  * Memory managed by `Rust`\n  * Broad testing coverage\n\n* **Multiple Distances Support** 🧮\n  * `Dot Product Distance`\n    * ![equation](https://latex.codecogs.com/gif.latex?D%28x%2Cy%29%20%3D%20%5Csum%7B%28x*y%29%7D)\n  * `Euclidean Distance`\n    * ![equation](https://latex.codecogs.com/gif.latex?D%28x%2Cy%29%20%3D%20%5Csqrt%7B%5Csum%7B%28x-y%29%5E2%7D%7D)\n  * `Manhattan Distance`\n    * ![equation](https://latex.codecogs.com/gif.latex?D%28x%2Cy%29%20%3D%20%5Csum%7B%7C%28x-y%29%7C%7D)\n  * `Cosine Similarity`\n    * ![equation](https://latex.codecogs.com/gif.latex?D%28x%2Cy%29%20%3D%20%5Cfrac%7Bx%20*y%7D%7B%7C%7Cx%7C%7C*%7C%7Cy%7C%7C%7D)\n\n* **Productive** ⭐\n  * Well documented\n  * Elegant and simple API, easy to learn\n\n# Benchmark\n\u003cimg src=\"asset/fashion-mnist-784-euclidean_10_euclidean.png\"/\u003e\n\nby `aws t2.medium (CPU: Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz)` [more information](https://github.com/hora-search/ann-benchmarks)\n\n## Installation\n\n```bash\npip install horapy\n```\n\n## Example\n\n```Python\nimport numpy as np\nfrom horapy import HNSWIndex\n\ndimension = 50\nn = 1000\n\n# init index instance\nindex = HNSWIndex(dimension, \"usize\")\n\nsamples = np.float32(np.random.rand(n, dimension))\nfor i in range(0, len(samples)):\n    # add node\n    index.add(np.float32(samples[i]), i)\n\nindex.build(\"euclidean\")  # build index\n\ntarget = np.random.randint(0, n)\n# 410 in Hora ANNIndex \u003cHNSWIndexUsize\u003e (dimension: 50, dtype: usize, max_item: 1000000, n_neigh: 32, n_neigh0: 64, ef_build: 20, ef_search: 500, has_deletion: False)\n# has neighbors: [410, 736, 65, 36, 631, 83, 111, 254, 990, 161]\nprint(\"{} in {} \\nhas neighbors: {}\".format(\n    target, index, index.search(samples[target], 10)))  # search\n```\n\n# License\n\nThe entire repo is under [Apache License](https://github.com/hora-search/hora/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhora-search%2Fhorapy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhora-search%2Fhorapy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhora-search%2Fhorapy/lists"}