• Home
  • Categories
  • Tags
  • Pricing
  • Submit
    Decorative pattern
    1. Home
    2. Sdks & Libraries
    3. hnswlib-node

    hnswlib-node

    Node.js bindings for HNSWlib implementing approximate nearest-neighbor search. Provides fast HNSW-based vector similarity search for JavaScript/TypeScript applications with file persistence support.

    🌐Visit Website

    About this tool

    Overview

    hnswlib-node provides Node.js bindings for HNSWlib, enabling approximate nearest-neighbor search based on hierarchical navigable small world graphs in JavaScript and TypeScript applications.

    Key Features

    • HNSW Algorithm: Fast approximate nearest-neighbor search
    • Multiple Distance Metrics: L2 (Euclidean), Cosine, Inner Product
    • File Persistence: Save and load indices to/from disk
    • Filter Functions: Search with custom filter predicates
    • LangChain Integration: Compatible with LangChain vector stores
    • Active Development: Regular updates and maintenance

    Installation

    npm install hnswlib-node
    

    Available on npm: https://www.npmjs.com/package/hnswlib-node

    Popularity

    • 12,405+ weekly downloads on npm
    • Open source under Apache-2.0 License
    • Active community and regular updates

    Basic Usage

    The library provides a simple API for:

    • Creating vector indices with specified dimensions
    • Adding vectors to the index
    • Searching for nearest neighbors
    • Persisting indices to files
    • Loading indices from disk

    Use Cases

    • In-Memory Vector Search: Fast vector similarity search for Node.js applications
    • Machine Learning: Embedding-based search for ML models
    • Recommendation Systems: User/item similarity matching
    • Semantic Search: Text embedding similarity in Node.js backends
    • RAG Applications: Retrieval component for LangChain-based RAG

    Integration

    LangChain

    Integrated as an in-memory vector store in LangChain JavaScript:

    • Fast local vector search
    • File-based persistence
    • No external dependencies required

    Related Projects

    • hnswlib-wasm: Browser-based HNSW via WebAssembly
    • hnswsqlite: Persistent vector search combining HNSWlib with SQLite

    Performance

    HNSW algorithm provides:

    • Logarithmic search complexity
    • High recall rates (90%+ typical)
    • Fast query times for approximate search
    • Efficient memory usage

    API Documentation

    Complete API documentation available at: https://yoshoku.github.io/hnswlib-node/doc/

    Advantages

    • No External Services: Runs entirely in Node.js process
    • Simple Setup: Easy npm install, no database server needed
    • File Persistence: Indices can be saved and loaded
    • Type Safety: Works well with TypeScript
    • Small Footprint: Minimal dependencies

    Limitations

    • In-memory only (until persisted to disk)
    • Not suitable for distributed deployments
    • Limited to single-machine scale
    • No built-in replication or clustering

    Pricing

    Free and open-source under the Apache 2.0 license.

    Surveys

    Loading more......

    Information

    Websitegithub.com
    PublishedMar 11, 2026

    Categories

    1 Item
    Sdks & Libraries

    Tags

    3 Items
    #Nodejs#Javascript#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.

    EntityDB

    A powerful, lightweight in-browser vector database that wraps IndexedDB and Transformers.js over WebAssembly, enabling semantic search and AI memory entirely in the browser without server requirements.

    MeMemo

    A JavaScript library that brings vector search and RAG (Retrieval-Augmented Generation) to browser environments, enabling efficient searching through millions of vectors using HNSW algorithm with IndexedDB and Web Workers.

    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.

    HNSW-IF
    Featured

    Hybrid billion-scale vector search method combining HNSW with inverted file indexes, enabling cost-efficient search by keeping centroids in memory while storing vectors on disk.

    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.

    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