# hnswlib-node: 4.8 out of 10

Keep, but not for new work. 9th of 9 in [Vector databases and clients](https://elestia.ai/opensource/vector-dbs/index.md).

hnswlib-node gives Node.js bindings to the C++ hnswlib library, for fast in-memory nearest-neighbour search with an index you can save to a file. It works and is fast, but it has had no release since March 2024 and it compiles native code on install. For new work, a maintained embedded store such as LanceDB, or pgvector if you already run Postgres, is usually the better pick.

**Best for:** Node.js developers who want a small, in-process HNSW index with no server, and who can build native addons.

## Scores

- **Overall: 4.8** (likely 3.7 to 5.9)
  - Claude Opus 5.5 (4.0): It is a fast, working in-process HNSW index, and LangChain users may already have it. But it has had no release in over two years, its native install is fragile, and it lacks the storage and filtering that peers offer. Its growth trails the category. Keep it where it runs; for new work pick LanceDB for embedded use, pgvector if you run Postgres, or a hosted client.
  - GPT-6.2 Sol (5.6): The typed API and native search make it a reasonable choice for a local index on a controlled Node.js deployment. For most new embedded vector stores, LanceDB offers queryable metadata and a more recent release. A long npm release gap and native build friction limit the recommendation, while the scarce head-to-head evidence leaves room for it to score higher on workloads that only need nearest-neighbor search.
- **Needed by many: 3.6** (likely 2.6 to 4.7)
  - Claude Opus 5.5 (4.0): Many AI apps need vector search, but this project covers only one slice of that job: an in-process index on Node.js. Teams that need a shared or hosted store, or that run on browser or edge runtimes, cannot use it. That makes it a clear niche inside a large category.
  - GPT-6.2 Sol (3.2): Embedding search is useful for semantic search and AI memory. This native binding serves the narrower group that wants a RAM-resident index inside a Node.js process. Surveys show that Node.js is widely used, but they give little indication of how many projects need this particular setup.
- **Helps a lot: 5.8** (likely 4.7 to 6.8)
  - Claude Opus 5.5 (5.0): The core HNSW search is fast and accurate, and the API is small and typed. But it is a bare index: no metadata, no filtering and no async search. Native builds often fail on install. Open issues on install errors, a wrong initIndex signature, and a process abort on wrong-typed input show rough edges. Embedded peers like LanceDB do more of the job.
  - GPT-6.2 Sol (6.5): Version 3.0.0 provides tunable HNSW, exact search, and typed methods for saving and loading an index. The small API and examples give developers and coding agents a clear starting point, though queries are synchronous and metadata stays in application code. A downstream project reported good recall on its own embeddings, while install friction, a reported native crash, and limited head-to-head testing of the Node binding keep the range wide.
- **Holds up over time: 4.0** (likely 2.6 to 5.5)
  - Claude Opus 5.5 (3.5): Commits continue (107 last year), but nearly all are Dependabot bumps and tooling changes. There has been no npm release since March 2024. One person maintains it, and install-bug issues from 2023 are still open. The repository is not abandoned, but it looks like keep-alive maintenance, and the ecosystem is moving towards full embedded stores.
  - GPT-6.2 Sol (4.5): GitHub recorded 107 commits in the past year, and the build history shows ongoing dependency upkeep. The npm version has stood since March 2024, and several user issues have been open for years. LanceDB and Vectra both shipped in 2026, while future release cadence and maintainer coverage here remain uncertain.
- **Used widely: 4.0** (likely 2.9 to 5.1)
  - Claude Opus 5.5 (4.5): 514k downloads in 4 weeks, up 2.5x on a year ago. That is below the 4.1x median, so it is losing ground, and most peers grew 3x to 19x. Many installs likely come through LangChain and AI app templates rather than direct choice. Its 424 dependent repos are a solid count against the peers, which points to a few thousand projects that chose it.
  - GPT-6.2 Sol (3.5): Four-week downloads rose from about 207,000 to 514,000, or 2.48 times, below the 4.1 catalog median. The 424 indexed dependent repositories exceed Chroma's 294 and Qdrant's 97, but trail Pinecone's 1,487. Optional downstream installs make direct choices hard to estimate, and the tracked social sources show no attention.
- **Vouched for: 4.3** (likely 3.2 to 5.5)
  - Claude Opus 5.5 (4.0): Its main endorsement is LangChain.js, which uses it for the HNSWLib vector store. The quality evidence is about the upstream C++ hnswlib, not these bindings. I found no surveys, production write-ups or Node benchmarks of this package.
  - GPT-6.2 Sol (4.6): LangChain.js shipped an integration, and Agentic QE adopted the binding and published recall tests. LangChain has since sunset the community package that houses the integration. Most independent benchmarks cover the underlying Hnswlib engine, so evidence for the Node binding in production remains limited.
- **Safe: 6.2** (likely 4.7 to 7.4)
  - Claude Opus 5.5 (6.5): It has no known advisories, only two runtime dependencies and an Apache-2.0 licence. But it compiles C++ at install time. There is no Scorecard data. One maintainer publishes releases. An open issue reports that wrong-typed input aborts the whole process, which is a stability risk for servers.
  - GPT-6.2 Sol (5.8): The Apache-2.0 license is permissive, the package has two direct npm dependencies, and OSV lists zero advisories. Installation builds native code, and a reported process-abort bug still has an open fix. The long release gap, missing public security policy, and unavailable Scorecard leave uncertainty about how quickly fixes would reach npm.

## Good

- Fast approximate nearest-neighbour search from the well-known hnswlib C++ library, with no server to run.
- Small, simple API to build, query, save and load an index, and it ships its own TypeScript types.
- LangChain.js uses it for its HNSWLib vector store, so there are many examples to copy.
- Apache-2.0 licence, only two runtime dependencies, and no known advisories.

## Bad

- No npm release since 3.0.0 in March 2024; recent commits are mostly Dependabot updates.
- It compiles native code on install, and several open issues report failed installs on Windows, M-series Macs and Linux.
- It is only an index: there is no metadata filtering, no document-level storage and no concurrent persistence. You build those yourself.
- It runs on Node.js only, so it does not work in browsers or edge runtimes, and serverless platforms need a native build.

## The numbers

- Downloads, 4 weeks: 514k
- In a year: ×2.5
- GitHub stars: 139
- Commits, 12 months: 107
- Last npm release: Mar 2024
- Advisories, 24 months: 0
- Licence: Apache-2.0
- GitHub: https://github.com/yoshoku/hnswlib-node
- npm: https://www.npmjs.com/package/hnswlib-node

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
