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