• Home
  • Categories
  • Tags
  • Pricing
  • Submit
    1. Home
    2. Sdks & Libraries
    3. hnswlib-rs

    hnswlib-rs

    Pure-Rust implementation of HNSW algorithm for approximate nearest neighbor search. Decouples graph from vector storage for flexible deployment. Supports dense floating point and quantized int8 vectors. This is an OSS library.

    🌐Visit Website

    About this tool

    Overview

    hnswlib-rs is a pure-Rust implementation of the HNSW (Hierarchical Navigable Small World) algorithm inspired by the original C++ hnswlib. Designed with a decoupled architecture separating graph structure from vector storage.

    Key Features

    • Decoupled Architecture: Graph separated from vector storage for flexibility
    • External Key Support: Map your external keys to internal NodeId
    • Multiple Precision: f32, f16, bf16, and per-vector quantized int8
    • Pure Rust: Memory-safe implementation without C dependencies
    • Flexible Storage: Provide vectors on demand via VectorStore interface

    Architecture

    The library intentionally decouples components:

    • Hnsw<K, M>: Owns the graph + mapping from external key K to internal NodeId
    • VectorStore: Keyed by NodeId, supplies vectors on demand
    • This design allows flexible storage backends and memory management

    Supported Data Types

    • f32: Standard 32-bit floating point
    • f16: 16-bit floating point for memory efficiency
    • bf16: Brain floating point for ML applications
    • int8: Quantized 8-bit integers for maximum compression

    Use Cases

    • Approximate nearest neighbor search
    • Embedding similarity search
    • Large-scale vector retrieval
    • Custom storage backend integration
    • Applications requiring memory-efficient vector search

    Installation

    Available on crates.io:

    [dependencies]
    hnswlib-rs = "*"
    

    Comparison to Other Implementations

    vs. C++ hnswlib

    • Memory safety guarantees from Rust
    • No C dependencies or FFI overhead
    • Modern Rust ecosystem integration

    vs. Other Rust HNSW

    • Unique decoupled architecture
    • Flexible vector storage
    • Support for multiple precision formats

    Repository

    GitHub: jean-pierreBoth/hnswlib-rs Crates.io: https://crates.io/crates/hnswlib-rs

    Technical Details

    Implements the algorithm from: "Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs" by Yu. A. Malkov and D. A. Yashunin

    Pricing

    Free and open-source under MIT or Apache 2.0 license. No licensing costs.

    Surveys

    Loading more......

    Information

    Websitegithub.com
    PublishedMar 6, 2026

    Categories

    1 Item
    Sdks & Libraries

    Tags

    3 Items
    #Open Source
    #Rust
    #Hnsw

    Similar Products

    6 result(s)
    HNSWlib
    Featured

    Header-only C++/Python library for fast approximate nearest neighbor search implementing the HNSW algorithm. Used by Spotify and others, offers 10x speed increase over Annoy. This is an OSS library.

    hora

    Hora is an efficient, open-source library for approximate nearest neighbor search, written in Rust. It offers high-performance vector search capabilities for AI and machine learning applications.

    pgvecto.rs
    Featured

    PostgreSQL extension for scalable, low-latency vector search written in Rust. Features 20x faster HNSW than pgvector, with support for FP16, INT8, and binary vectors. This is an OSS extension.

    HelixDB

    HelixDB is a powerful, open-source graph-vector database built in Rust, designed for intelligent data storage for Retrieval-Augmented Generation (RAG) and AI applications. It combines graph database features with vector search, making it directly relevant to AI and machine learning workflows that require vector data management.

    NVIDIA cuVS
    Featured

    GPU-accelerated vector search and clustering library from NVIDIA RAPIDS. Provides 8-12x faster index building and queries with multiple language support (C, C++, Python, Rust). This is an OSS library.

    PyNNDescent

    Python implementation of Nearest Neighbor Descent for k-neighbor-graph construction and ANN search. Targets 80%-100% accuracy with fast performance and supports wide variety of distance metrics. This is an OSS library.

    Built with
    Ever Works
    Ever Works

    Connect with us

    Stay Updated

    Get the latest updates and exclusive content delivered to your inbox.

    Product

    • Categories
    • Tags
    • Pricing
    • Help

    Clients

    • Sign In
    • Register
    • Forgot password?

    Company

    • About Us
    • Admin
    • Sitemap

    Resources

    • Blog
    • Submit
    • API Documentation
    All product names, logos, and brands are the property of their respective owners. All company, product, and service names used in this repository, related repositories, and associated websites are for identification purposes only. The use of these names, logos, and brands does not imply endorsement, affiliation, or sponsorship. This directory may include content generated by artificial intelligence.
    Copyright © 2025 Awesome Vector Databases. All rights reserved.·Terms of Service·Privacy Policy·Cookies