arroy  by meilisearch

Rust library for approximate nearest neighbor search

created 1 year ago
276 stars

Top 94.7% on sourcepulse

GitHubView on GitHub
Project Summary

Arroy is a Rust library for Approximate Nearest Neighbors (ANN) search, designed for efficient memory usage and concurrent access. It targets developers needing to find similar vectors in high-dimensional spaces, particularly those already using or considering LMDB for data storage, offering a low memory footprint and shared data access benefits.

How It Works

Arroy builds upon the Annoy library's random projection tree approach but utilizes LMDB as its backend storage. This memory-mapped key-value store allows multiple processes to share the same index atomically, enabling concurrent reads and writes. The library supports Euclidean, Manhattan, cosine, and dot product distances, with index creation being a separate, potentially multi-threaded process from querying.

Quick Start & Requirements

  • Install via cargo install arroy.
  • Requires Rust toolchain.
  • See crates.io for usage examples.

Highlighted Details

  • LMDB backend enables shared memory access and atomic updates across processes.
  • Supports Euclidean, Manhattan, cosine, and dot product distances.
  • Offers features beyond Annoy, including query filtering and incremental updates.
  • Designed for low memory usage, performing well up to ~1,000 dimensions.

Maintenance & Community

  • Developed by Meilisearch contributors.
  • See GitHub Actions for build status.
  • Docs.rs provides API documentation.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial and closed-source applications.

Limitations & Caveats

Arroy lacks Python bindings and Hamming distance support. Performance may be slower than non-LMDB alternatives due to LMDB's log(n) lookups and non-aligned vectors. Index creation is a distinct step, and items cannot be added after the tree is built.

Health Check
Last commit

3 weeks ago

Responsiveness

1 week

Pull Requests (30d)
2
Issues (30d)
2
Star History
14 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.