• Home
  • Categories
  • Tags
  • Pricing
  • Submit
    Decorative pattern
    1. Home
    2. Sdks & Libraries
    3. HNSWlib

    HNSWlib

    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.

    🌐Visit Website

    About this tool

    Overview

    HNSWlib is an open-source C++ and Python library implementing the Hierarchical Navigable Small World (HNSW) algorithm for fast approximate nearest neighbor search. Provides header-only implementation for easy integration.

    Key Features

    • Header-Only: Easy C++ integration without complex build systems
    • Incremental Construction: Full support for adding elements dynamically
    • Element Updates: Update vectors in existing index
    • Element Deletion: Mark elements as deleted
    • Python Support: Python bindings with pickle support
    • Low Memory Footprint: Significantly less memory than alternatives
    • Fast Build Time: Quick index construction

    Performance

    • 10x faster than Annoy for similar accuracy
    • Excellent scalability for high-dimensional embeddings
    • Efficient query performance
    • Production-proven at Spotify and other companies

    Technical Capabilities

    • Dynamic index updates
    • Concurrent queries (read-only mode)
    • Multiple distance metrics (L2, Inner Product, Cosine)
    • Configurable graph parameters
    • Efficient serialization

    Spotify Adoption

    Since 2018, many Spotify teams have experimented with hnswlib:

    • Tenfold speed increase over Annoy
    • Useful for higher-dimensional embeddings
    • Scaled to production use cases
    • Led to development of Voyager (successor library by Spotify)

    Python Interface

    Simple Python API:

    • Create index
    • Add items
    • Query nearest neighbors
    • Save/load index
    • Pickle support

    Installation

    Python

    pip install hnswlib
    

    C++

    Header-only, just include the headers.

    Use Cases

    • Recommendation systems
    • Semantic search
    • Image similarity
    • Content discovery
    • Embedding-based retrieval
    • Real-time ANN queries

    Pricing

    Free and open-source under 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#Hnsw#Cpp

    Similar Products

    6 result(s)
    FLANN

    Fast Library for Approximate Nearest Neighbors containing a collection of algorithms optimized for nearest neighbor search in high dimensional spaces with automatic algorithm and parameter selection.

    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.

    pg_embedding

    PostgreSQL extension enabling the Hierarchical Navigable Small World (HNSW) algorithm for vector similarity search. Developed by Neon, it delivers 5-30x faster performance compared to pgvector's IVFFlat indexing for approximate nearest neighbor search.

    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.

    PUFFINN

    Parameterless and Universal Fast Finding of Nearest Neighbors - an LSH-based library for approximate nearest neighbor search with probabilistic guarantees. Features a parameterless design requiring only memory budget and result quality specifications.

    ANN Library

    A C++ library for approximate nearest neighbor searching in arbitrarily high dimensions, developed by David Mount and Sunil Arya at the University of Maryland. Provides data structures and algorithms for both exact and approximate nearest neighbor searching.

    Decorative pattern
    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