Registry / vector-search / vectoriadb

vectoriadb

JSON →
library2.2.0jsnpmunverified

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 vectoriadb
INSTALL
IMPORT
SIG · VECTORIADB
V
vectoriadb
vector-searchjavascriptv2.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VectoriaDB
import { VectoriaDB } from 'vectoriadb'
const VectoriaDB = require('vectoriadb')
VectoriaDB is ESM-first and primarily used with ES module imports. Avoid CommonJS `require()` unless using dynamic imports.
SearchOptions
import type { SearchOptions } from 'vectoriadb'
import { SearchOptions } from 'vectoriadb'
Type import for specifying parameters when performing searches. Use `import type` for type-only imports to prevent bundling issues.
Document
import type { Document } from 'vectoriadb'
Type definition for the structure of documents stored in VectoriaDB, typically used with generics for metadata.

This quickstart demonstrates how to initialize VectoriaDB, add new text documents with associated metadata, and perform a semantic search query.

import { VectoriaDB } from 'vectoriadb'; // Create and initialize the database const db = new VectoriaDB(); await db.initialize(); // Add documents await db.add('doc-1', 'How to create a user account', { id: 'doc-1', category: 'auth', author: 'Alice' }); await db.add('doc-2', 'Send email notifications to users', { id: 'doc-2', category: 'notifications', author: 'Bob' }); // Search const results = await db.search('creating new accounts'); console.log(results[0].metadata); // { id: 'doc-1', category: 'auth', ... } console.log(results[0].score); // 0.87
Debug
Known issues
gotchaVectoriaDB requires Node.js version 18 or higher and TypeScript 5.0+ (if using TypeScript). Running with older versions may lead to compatibility issues or errors, particularly due to `transformers.js` dependencies.
fix
Ensure your development and production environments use Node.js 18+ and TypeScript 5.0+.
affects: <=2.2.0
breakingVersions prior to 2.2.0 might not properly release native ONNX resources, potentially leading to resource leaks or native mutex crashes during application shutdown, especially if `EmbeddingService` was used directly.
fix
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`.
affects: <2.2.0
securityVersion 2.1.3 included a patch for a vulnerability in the authentication mechanism. Older versions might be susceptible to security risks if authentication features were used.
fix
Upgrade to VectoriaDB v2.1.3 or newer to benefit from the patched authentication vulnerability.
affects: <2.1.3
gotchaVectoriaDB is designed for in-memory use cases and embedded search. It is not suitable for persistent storage (without external adapters), distributed architectures, or multi-million document scales requiring specialized distributed vector databases.
fix
Evaluate your use case carefully. For distributed, persistent, or extremely large-scale vector search, consider alternatives like Pinecone, Weaviate, or Milvus.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'vectoriadb'
CommonJS environment attempting to import an ES module-first package, or incorrect module resolution setup.
fix
Ensure your project is configured for ES modules (e.g., add `"type": "module"` to `package.json`) or use dynamic `import()` for CommonJS contexts.
TypeError: VectoriaDB is not a constructor
Attempting to instantiate `VectoriaDB` incorrectly, often due to a default import when a named import is required, or CJS `require()` syntax in an ESM context.
fix
Use the named import syntax: `import { VectoriaDB } from 'vectoriadb';`
ONNX runtime warnings regarding 'dtype'
Older versions of VectoriaDB (prior to v2.2.0) implicitly handling `dtype` for ONNX runtime, leading to warning messages.
fix
Upgrade to VectoriaDB v2.2.0 or newer, which explicitly sets `dtype` to 'fp32' in `EmbeddingService` to suppress these warnings.
Error: Node.js version X.X.X is not supported. Please upgrade to Node.js 18 or higher.
Running VectoriaDB on an unsupported Node.js version, which is a dependency requirement for `transformers.js`.
fix
Upgrade your Node.js environment to version 18 or newer.
Upgrade
Version history
2.2.0latest on npm
Audit
Dependencies
@huggingface/transformersrequiredPeer dependency required for local embedding generation using pre-trained transformer models.
Agent activity
51 hits · last 30 days
node
48
OpenAI (training)
1
Resources
vectoriadb — npm install vectoriadb · libregistry