Skip to content

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

License

Notifications You must be signed in to change notification settings

agentfront/vectoriadb

Repository files navigation

VectoriaDB

npm version License TypeScript

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';

const db = new VectoriaDB();
await db.initialize();

// Add documents with metadata
await db.add('doc-1', 'How to create a user account', { category: 'auth' });
await db.add('doc-2', 'Send email notifications', { category: 'notifications' });

// Semantic search
const results = await db.search('creating new accounts');
console.log(results[0].score); // 0.87

Documentation

Topic Link
Get Started Welcome
Installation Setup Guide
Quickstart First Steps
Indexing Core Guide
Search Search Guide
Storage Persistence
Scaling HNSW Overview
TF-IDF Alternative
Production Deployment
API Reference Full 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

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •