Skip to content

Repository files navigation

VectoriaDB

npm versionLicenseTypeScript

Lightweight, in-memory vector database for semantic search in JavaScript/TypeScript

Features

  • Fast - HNSW indexing for O(log n) search on 100k+ documents
  • Lightweight - Minimal dependencies, small footprint
  • Type-Safe - Full TypeScript support with generics
  • Flexible - Custom metadata filtering with batch operations
  • Persistent - File & Redis adapters for caching across restarts
  • Zero-Dep Option - TF-IDF mode for simpler deployments

Installation

npm install vectoriadb

Requires Node.js 18+.

Quick Start

import{VectoriaDB}from'vectoriadb';constdb=newVectoriaDB();awaitdb.initialize();// Add documents with metadataawaitdb.add('doc-1','How to create a user account',{category: 'auth'});awaitdb.add('doc-2','Send email notifications',{category: 'notifications'});// Semantic searchconstresults=awaitdb.search('creating new accounts');console.log(results[0].score);// 0.87

Documentation

TopicLink
Get StartedWelcome
InstallationSetup Guide
QuickstartFirst Steps
IndexingCore Guide
SearchSearch Guide
StoragePersistence
ScalingHNSW Overview
TF-IDFAlternative
ProductionDeployment
API ReferenceFull API

Development

yarn install # Install dependencies
npx nx test vectoriadb # Run tests
npx nx build vectoriadb # Build library

License

Apache-2.0


Built with transformers.js by Xenova.

About

A lightweight, production-ready in-memory vector database for semantic search

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages