EdgeVec
The first WASM-native vector database. Binary quantization, metadata filtering, memory management — all in the browser.
EdgeVec is an embedded vector database built in Rust with first-class WebAssembly support. It brings server-grade vector database features to the browser: 32x memory reduction via binary quantization, metadata filtering, soft delete, persistence, and sub-millisecond search.
Why EdgeVec?
| Feature | EdgeVec | hnswlib-wasm | Pinecone |
|---|---|---|---|
| Vector Search | Yes | Yes | Yes |
| Binary Quantization | Yes (32x) | No | No |
| Metadata Filtering | Yes | No | Yes |
| SQL-like Queries | Yes | No | Yes |
| Memory Pressure API | Yes | No | No |
| Soft Delete | Yes | No | Yes |
| Persistence | Yes | No | Yes |
| Browser-native | Yes | Yes | No |
| No server required | Yes | Yes | No |
| Offline capable | Yes | Yes | No |
EdgeVec is the only WASM vector database with binary quantization and filtered search.
Quick Start
import init, { EdgeVec } from 'edgevec';
await init();
// Create index (768D for embeddings like OpenAI, Cohere)
const db = new EdgeVec({ dimensions: 768 });
// Insert vectors with metadata (v0.6.0)
const vector = new Float32Array(768).map(() => Math.random());
const id = db.insertWithMetadata(vector, {
category: "books",
price: 29.99,
inStock: true
});
// Search with filter expression (v0.6.0)
const query = new Float32Array(768).map(() => Math.random());
const results = db.searchFiltered(query, 'category = "books" AND price < 50', 10);
// Fast BQ search with rescoring — 32x less memory, 95% recall (v0.6.0)
const fastResults = db.searchBQ(query, 10);
// Monitor memory pressure (v0.6.0)
const pressure = db.getMemoryPressure();
if (pressure.level === 'warning') {
db.compact(); // Free deleted vectors
}
Interactive Demos
Try EdgeVec directly in your browser:
| Demo | Description |
|---|---|
| v0.6.0 Demo | BQ vs F32 comparison, metadata filtering, memory pressure |
| Filter Playground | Interactive filter syntax explorer with live parsing |
| Benchmark Dashboard | Performance comparison vs competitors |
| Soft Delete Demo | Tombstone-based deletion with compaction |
| Main Demo | Complete feature showcase |
# Run demos locally
# Open http://localhost:8080/wasm/examples/index.html
Performance
Search Latency (768D vectors, k=10)
| Scale | EdgeVec | Target | Status |
|---|---|---|---|
| 10k vectors | 88 us | <1 ms | 11x under |
| 50k vectors | 167 us | <1 ms | 6x under |
| 100k vectors | 329 us | <1 ms | 3x under |
Competitive Comparison (10k vectors, 128D)
| Library | Search P50 | Type | Notes |
|---|---|---|---|
| EdgeVec | 0.20 ms | WASM | Fastest WASM solution |
| hnswlib-node | 0.05 ms | Native C++ | Requires compilation |
| voy | 4.78 ms | WASM | k-d tree algorithm |
EdgeVec is 24x faster than voy for search while both are pure WASM.
Bundle Size
| Package | Size (gzip) | Target | Status |
|---|---|---|---|
| edgevec | 217 KB | <500 KB | 57% under |
Database Features
Binary Quantization (v0.6.0)
32x memory reduction with minimal recall loss:
// BQ is auto-enabled for dimensions divisible by 8
const db = ;
// Raw BQ search (~85% recall, ~5x faster)
const bqResults = db.;
// BQ + rescore (~95% recall, ~3x faster)
const rescoredResults = db.;
| Mode | Memory (100k × 768D) | Speed | Recall@10 |
|---|---|---|---|
| F32 (baseline) | ~300 MB | 1x | 100% |
| BQ raw | ~10 MB | 5x | ~85% |
| BQ + rescore(5) | ~10 MB | 3x | ~95% |
Metadata Filtering (v0.6.0)
Insert vectors with metadata, search with SQL-like filter expressions:
// Insert with metadata
db.;
// Search with filter
db.;
db.; // Array membership
// Complex expressions
db.;
Operators: =, !=, >, <, >=, <=, AND, OR, NOT, ANY
Filter syntax documentation ->
Memory Pressure API (v0.6.0)
Monitor and control WASM heap usage:
const pressure = db.;
// { level: 'normal', usedBytes: 52428800, totalBytes: 268435456, usagePercent: 19.5 }
if
if
Soft Delete & Compaction
// O(1) soft delete
db.;
// Check status
console.log;
console.log;
// Reclaim space when needed
if
Persistence
// Save to IndexedDB (browser) or filesystem
await db.;
// Load existing database
const db = await ;
Scalar Quantization
const config = ;
config. = true; // Enable SQ8 quantization
// 3.6x memory reduction: 3.03 GB -> 832 MB at 1M vectors
Rust Usage
use ;
Documentation
| Document | Description |
|---|---|
| Tutorial | Getting started guide |
| Filter Syntax | Complete filter expression reference |
| Database Operations | CRUD operations guide |
| Performance Tuning | HNSW parameter optimization |
| Migration Guide | Migrating from hnswlib, FAISS, Pinecone |
| Comparison | When to use EdgeVec vs alternatives |
Limitations
EdgeVec is designed for client-side vector search. It is NOT suitable for:
- Billion-scale datasets — Browser memory limits apply (~1GB practical limit)
- Multi-user concurrent access — Single-user, single-tab design
- Distributed deployments — Runs locally only
For these use cases, consider Pinecone, Qdrant, or Weaviate.
Version History
- v0.6.0 — Binary quantization (32x memory), metadata storage, memory pressure API
- v0.5.4 — iOS Safari compatibility fixes
- v0.5.3 — crates.io publishing fix (package size reduction)
- v0.5.2 — npm TypeScript compilation fix
- v0.5.0 — Metadata filtering with SQL-like syntax, Filter Playground demo
- v0.4.0 — Documentation sprint, benchmark dashboard, chaos testing
- v0.3.0 — Soft delete API, compaction, persistence format v3
- v0.2.0 — Scalar quantization (SQ8), SIMD optimization
- v0.1.0 — Initial release with HNSW indexing
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Built with Rust + WebAssembly