# hnswlib-node

> Node.js bindings (JavaScript/TypeScript SDK) for HNSWLib C++ library, enabling fast ANN vector search with async operations and V8 optimization. Supports L2/cosine distances, file persistence, filtering, and LangChain integration for seamless app embedding. Ideal for web/serverless JS RAG; lighter JS alternative to Python hnswlib bindings vs. full vector DBs like Chroma.

- **URL:** https://github.com/yoshoku/hnswlib-node
- **Category:** Core Vector Databases
- **Tags:** Nodejs, Javascript, Hnsw, Async Client, JavaScript Bindings
- **Updated:** 2026-04-29 11:31
- **Canonical page:** https://vectordb.ever.works/items/hnswlib-node

## Details

## Overview

hnswlib-node is a JavaScript/TypeScript SDK providing Node.js bindings to HNSWLib for approximate nearest-neighbor vector search.

## SDK Features

- Async operations for non-blocking queries
- Multi-threading support
- Distance metrics: L2 (Euclidean), Cosine, Inner Product
- File persistence: save/load indices to disk
- Custom filter functions
- LangChain vector store integration

## Use Cases

- Integrate vector search into Node.js web apps
- Serverless RAG pipelines
- Real-time recommendation systems
- Semantic search backends

## Comparisons

- Official community JS bindings vs. Python hnswlib
- Lighter than full DBs (e.g., Chroma, LanceDB) for JS stacks

## Installation

```bash
npm install hnswlib-node
```

## Pricing

Free and open-source (Apache 2.0).

---

_This Markdown mirror is generated by Ever Works for AI agents. The canonical HTML page is at https://vectordb.ever.works/items/hnswlib-node._
