π EdgeVec
High-performance vector search for Browser, Node, and Edge
β STATUS: Alpha Release Ready β All performance targets exceeded.
What's New in v0.4.0
Documentation & Quality Sprint
docs/TUTORIAL.mdβ Complete getting started guidedocs/PERFORMANCE_TUNING.mdβ HNSW parameter optimizationdocs/TROUBLESHOOTING.mdβ Top 10 errors and solutionsdocs/INTEGRATION_GUIDE.mdβ Third-party embedding integrationsdocs/MIGRATION.mdβ Migration from hnswlib, FAISS, Pinecone
Benchmark Dashboard
- Interactive visualization at
/wasm/examples/benchmark-dashboard.html - EdgeVec vs hnswlib-node vs voy comparison
- Real-time performance charts with Chart.js
Quality Infrastructure
- Chaos Testing β 15 edge case tests (empty index, max dimensions, etc.)
- Load Testing β 100k vector stress tests, sustained search load
- P99 Latency Tracking β P50/P99/P999 percentile benchmarks
- CI Regression Detection β 10% threshold enforcement
Previous (v0.3.0)
- Soft delete API with O(1) tombstone-based deletion
- Compaction API for reclaiming space
- Full WASM bindings for soft delete operations
- Persistence format v0.3 with automatic migration
What is EdgeVec?
EdgeVec is an embedded vector database built in Rust with first-class WASM support. It's designed to run anywhere: browsers, Node.js, mobile apps, and edge devices.
Key Features
- Sub-millisecond search β 0.23ms at 100k vectors (768d, quantized)
- HNSW Indexing β O(log n) approximate nearest neighbor search
- Scalar Quantization (SQ8) β 3.6x memory compression
- WASM-First β Native browser support via WebAssembly
- Persistent Storage β
IndexedDBin browser, file system elsewhere - Minimal Dependencies β No C compiler required, WASM-ready
- Tiny Bundle β 227 KB gzipped (55% under 500KB target)
Quick Start
Installation
For Rust users: To achieve optimal performance, ensure your .cargo/config.toml includes:
[]
= ["-C", "target-cpu=native"]
Without this configuration, performance will be 60-78% slower due to missing SIMD optimizations.
Browser/Node.js Usage
import init from 'edgevec';
.;
Load Existing Index
import init from 'edgevec';
await ;
const index = await ;
const results = index.;
Rust Usage
use ;
use ;
Batch Insert (Rust)
For inserting many vectors efficiently, use the batch insert API:
use ;
use BatchInsertable;
use BatchError;
Features: Progress tracking, best-effort semantics, and unified error handling.
Soft Delete (Rust)
Delete vectors without rebuilding the index (v0.3.0+):
use ;
Soft Delete (JavaScript)
import init from 'edgevec';
await ;
const config = ;
const index = ;
// Insert vectors
const vector = .;
const id = index.;
// Soft delete
const wasDeleted = index.;
console.log;
// Statistics
console.log;
console.log;
console.log;
// Compact when needed
if
| Operation | Time Complexity | Notes |
|---|---|---|
soft_delete() |
O(1) | Set tombstone byte |
is_deleted() |
O(1) | Read tombstone byte |
search() |
O(log n) | Automatically excludes tombstones |
compact() |
O(n log n) | Full index rebuild |
Interactive Examples
Try EdgeVec directly in your browser with our NVIDIA-grade cyberpunk demo suite:
Demo Gallery
Running Locally
# Clone the repository
# IMPORTANT: Start server from project root!
# Open in browser (include full path)
# http://localhost:8080/wasm/examples/index.html
β οΈ Note: Do NOT start server from
wasm/examples/β WASM module requires/pkg/access from root.
Development Status
EdgeVec follows a military-grade development protocol. No code is written without an approved plan.
β Alpha Release Ready (v0.1.0)
All Performance Targets Exceeded:
- β Search Mean: 0.23ms (4.3x under 1ms target)
- β Search P99 (estimated): <600Β΅s (based on Mean + 2Ο)
- β Memory: 832 MB for 1M vectors (17% under 1GB target)
- β Bundle Size: 227 KB (55% under 500KB target)
What Works Now:
- β HNSW Indexing β Sub-millisecond search at 100k scale
- β Scalar Quantization (SQ8) β 3.6x memory reduction
- β SIMD Optimization β AVX2/FMA for 60-78% speedup
- β Crash Recovery (WAL) β Log-based replay
- β Atomic Snapshots β Safe background saving
- β Browser Integration β WASM Bindings + IndexedDB
- β
npm Package β
edgevec@0.4.0published
Development Progress:
- Phase 0: Environment Setup β β COMPLETE
- Phase 1: Architecture β β COMPLETE
- Phase 2: Planning β β COMPLETE
- Phase 3: Implementation β β COMPLETE
- Phase 4: WASM Integration β β COMPLETE
- Phase 5: Alpha Release β β READY
Future Roadmap (v0.5.0+)
- ARM/NEON Optimization β Cross-platform SIMD verification
- Mobile Support β iOS Safari and Android Chrome formalized
- CLI Tools β Optional developer command-line interface
- Enhanced Metadata Storage β Native metadata support
Path to v1.0
EdgeVec will reach v1.0 after:
- Production usage feedback from v0.4.0/v0.5.0
- Security audit
- API stability guarantee commitment
π Performance (Alpha Release)
Search Latency (768-dimensional vectors, k=10)
| Scale | Float32 | Quantized (SQ8) | Target | Status |
|---|---|---|---|---|
| 10k vectors | 203 Β΅s | 88 Β΅s | <1 ms | β 11x under |
| 50k vectors | 480 Β΅s | 167 Β΅s | <1 ms | β 6x under |
| 100k vectors | 572 Β΅s | 329 Β΅s | <1 ms | β 3x under |
Note: Mean latencies from Criterion benchmarks (10 samples). Max observed: 622Β΅s (100k Float32). Outliers: 0-20% (mostly high mild/severe). P99 estimates are all <650Β΅s. See docs/benchmarks/ for full analysis.
Memory Efficiency (768-dimensional vectors)
| Mode | Memory per Vector | 1M Vectors | Compression |
|---|---|---|---|
| Float32 | 3,176 bytes | 3.03 GB | Baseline |
| Quantized (SQ8) | 872 bytes | 832 MB | 3.6x smaller |
Memory per vector includes: vector storage + HNSW graph overhead (node metadata + neighbor pool).
Measured using index.memory_usage() + storage.memory_usage() after building 100k index.
Bundle Size
| Package | Size (Gzipped) | Target | Status |
|---|---|---|---|
edgevec@0.4.0 |
227 KB | <500 KB | β 55% under |
Competitive Comparison (10k vectors, 128 dimensions)
| Library | Search P50 | Insert P50 | Type | Notes |
|---|---|---|---|---|
| EdgeVec | 0.20ms | 0.83ms | WASM | Fastest WASM solution |
| hnswlib-node | 0.05ms | 1.56ms | Native C++ | Requires compilation |
| voy | 4.78ms | 0.03ms | WASM | KD-tree, batch-only |
EdgeVec is 24x faster than voy for search while both are pure WASM. Native bindings (hnswlib-node) are faster but require C++ compilation and don't work in browsers.
Key Advantages
- β Sub-millisecond search at 100k scale
- β Fastest pure-WASM solution β 24x faster than voy
- β Zero network latency β runs 100% locally (browser, Node, edge)
- β Privacy-preserving β no data leaves the device
- β Tiny bundle β 227 KB gzipped
- β No compilation required β unlike native bindings
Test Environment
- Hardware: AMD Ryzen 7 5700U, 16GB RAM
- OS: Windows 11
- Rust: 1.94.0-nightly (2025-12-05)
- Criterion: 0.5.x
- Compiler flags:
-C target-cpu=native(AVX2 SIMD enabled)
Development Protocol
The Agents
| Agent | Role |
|---|---|
| META_ARCHITECT | System design, data layouts |
| PLANNER | Roadmaps, weekly task plans |
RUST_ENGINEER |
Core Rust implementation |
WASM_SPECIALIST |
WASM bindings, browser integration |
BENCHMARK_SCIENTIST |
Performance testing |
| HOSTILE_REVIEWER | Quality gate (has veto power) |
| DOCWRITER | Documentation, README |
Development Environment
Local CI Simulation
Before pushing changes, run the local CI simulation to catch issues:
# Run full CI check with timing validation
# Run pre-release validation (CI + docs + publish dry-run)
The ci-check command:
- Sets CI environment variables (
RUSTFLAGS,PROPTEST_CASES,NUM_VECTORS) - Runs formatting, clippy, tests, and WASM checks
- Validates each step completes within CI timeout limits
Timing Budgets (xtask / CI timeout):
| Step | Local Limit | CI Timeout | Typical |
|---|---|---|---|
| Formatting | 30s | 5min | <1s |
| Clippy | 180s | 10min | ~20s |
| Tests | 600s | 30min | ~50s |
| WASM Check | 120s | 10min | <1s |
If a step exceeds its local limit, the build fails to catch performance regressions before CI.
Environment Variables
| Variable | Local Default | CI Value | Purpose |
|---|---|---|---|
RUSTFLAGS |
(native) | -C target-cpu=x86-64-v2 |
Prevent SIGILL on CI runners |
PROPTEST_CASES |
256 | 32 | Reduce proptest runtime |
NUM_VECTORS |
10000 | 1000 | Reduce integration test runtime |
Building
# Standard build
# WASM build
# Run tests
# Run benchmarks
Release Process
See CONTRIBUTING.md for the full release process, including:
Origins
EdgeVec builds upon lessons learned from binary_semantic_cache, a high-performance semantic caching library. Specifically:
Salvaged (MIT Licensed):
- Hamming distance implementation (~10 lines)
- Binary quantization math (~100 lines)
Built Fresh:
- HNSW graph indexing
- WASM-native architecture
IndexedDBpersistence- Everything else
Acknowledgments
- Thanks to the Reddit community for identifying a potential alignment issue in the persistence layer, which led to improved safety via
bytemuckin v0.2.1. - Thanks to the Hacker News community for feedback on competitive positioning and benchmarking.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Built with π¦ Rust + πΈοΈ WebAssembly
Correctness by Construction