VectoriaDB

2.2.0 · active · verified Wed Apr 22

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.

Common errors

Warnings

Install

Imports

Quickstart

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

view raw JSON →