A TypeScript library that combines HNSWlib approximate nearest neighbor vector search with SQLite persistence for lightweight semantic search. Current stable version is 0.2.1, released on [approx date]. It supports multiple embedding providers (OpenAI, HuggingFace, WebLLM, MediaPipe, TensorFlow.js) and provides a CLI tool. Key differentiators: no external dependencies beyond SQLite and HNSWlib, TypeScript-first with full type declarations, batch operations, and a plugin system for embedding generation. Suitable for building semantic search and recommendation systems.
npm install hnswsqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic initialization, adding a document with a dummy 5-dimensional embedding, searching with the same vector, and closing the store.
Update to new constructor: new VectorStore(dbPath, dim)
Watch for breaking changes in plugin import paths.
Always use try/finally or async disposers (if added).
Ensure all embeddings have the same length as the dimension passed to constructor.
Install build tools (e.g., 'npm install -g node-gyp') or use prebuild binaries.
Run: npm install hnswlib-node
Ensure the directory exists and is writable, or use an absolute path.
Use import { VectorStore } from 'hnswsqlite' and ensure version >=0.1.0.