VectoriaDB is a lightweight, production-ready, in-memory vector database designed for efficient semantic search in JavaScript and TypeScript environments. It is currently at stable version 2.2.0, with frequent minor releases in the 2.x line addressing performance, security, and new features like geospatial support. The library differentiates itself by providing a complete, privacy-first solution for vector search within a single Node.js process, leveraging `transformers.js` to generate embeddings locally using a default `Xenova/all-MiniLM-L6-v2` model. It features optimized HNSW indexing for sub-millisecond search on 100k+ documents, robust TypeScript support, and minimal dependencies, making it ideal for embedded search in applications, CLIs, or desktop environments where external vector database services are undesirable or unnecessary. Unlike distributed vector databases, VectoriaDB focuses on performance and simplicity for in-memory, single-node deployments.
npm install vectoriadbVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize VectoriaDB, add new text documents with associated metadata, and perform a semantic search query.
Ensure your development and production environments use Node.js 18+ and TypeScript 5.0+.
Upgrade to VectoriaDB v2.2.0 or newer. Ensure `db.close()` is called on your `VectoriaDB` instance to trigger proper resource disposal via the new `dispose` method in `EmbeddingService`.
Upgrade to VectoriaDB v2.1.3 or newer to benefit from the patched authentication vulnerability.
Evaluate your use case carefully. For distributed, persistent, or extremely large-scale vector search, consider alternatives like Pinecone, Weaviate, or Milvus.
Ensure your project is configured for ES modules (e.g., add `"type": "module"` to `package.json`) or use dynamic `import()` for CommonJS contexts.
Use the named import syntax: `import { VectoriaDB } from 'vectoriadb';`Upgrade to VectoriaDB v2.2.0 or newer, which explicitly sets `dtype` to 'fp32' in `EmbeddingService` to suppress these warnings.
Upgrade your Node.js environment to version 18 or newer.