Lightweight, in-memory vector database for semantic search in JavaScript/TypeScript
- 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
npm install vectoriadbRequires Node.js 18+.
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| 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 |
yarn install # Install dependencies
npx nx test vectoriadb # Run tests
npx nx build vectoriadb # Build libraryApache-2.0
Built with transformers.js by Xenova.