{"repo":"nnethercott/hannoy","free":true,"listed":false,"github":"https://github.com/nnethercott/hannoy","clone":"git clone https://github.com/nnethercott/hannoy.git","description":"Production-ready KV-backed HNSW implementation in Rust using LMDB","language":"Rust","stars":86,"topics":["hnsw","rust","vector-database","lmdb","approximate-nearest-neighbor-search","diskann","python"],"license":"MIT","category":"databases-storage","readme_excerpt":"hannoy 🗼 hannoy is a key-value backed HNSW implementation based on arroy. Motivation Many popular HNSW libraries are built in memory, meaning you need enough RAM to store all the vectors you're indexing. Instead, hannoy uses LMDB — a memory-mapped KV store — as a storage backend. This is more well-suited for machines running multiple programs, or cases where the dataset you're indexing won't fit in memory. LMDB also supports non-blocking concurrent reads by design, meaning its safe to query the index in multi-threaded environments. Features - Supported metrics: euclidean, cosine, manhattan, hamming, as well as quantized counterparts. - Python bindings with maturin and pyo3 - Multithreaded builds using rayon - Disk-backed storage to enable indexing datasets that won't fit in RAM using LMDB - Compressed bitmaps to store graph edges with minimal overhead, adding 200 bytes per vector - Dynamic document insertions and deletions without full re-indexing Missing Features - GPU-accelerated indexing Usage Rust 🦀 Python 🐍 Alternatively, you can add many items at once from a 2d numpy array of dtype float 32: Tips and tricks Reducing cold start latencies Search in an hnsw always traverses from the top to bottom layers of the graph, so we know a priori some vectors will be needed. We can hint to the kernel that these vectors (and their neighbours) should be loaded into RAM using madvise to speed up search. Doing so can reduce cold-start latencies by several milliseconds, and is configu","default_branch":null,"files":null,"tree":[],"storefront":"/r/nnethercott","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/nnethercott/hannoy/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}