edgevec

Library Listed

High-performance embedded vector database for Browser, Node, and Edge

Checked · Sources

Downloads
14
Dependents
1
Stars
100
Forks
6
Contributors
2
Commits
244
Latest release
0.9.0 ·

About

From the project README ·

The first WASM-native vector database. Dense + sparse vectors, hybrid search, binary quantization, metadata filtering — 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: HNSW + FlatIndex, sparse vectors with BM25, hybrid search (RRF fusion), 32x smaller binary codes, metadata filtering, soft delete, persistence, and sub-millisecond search.


Why EdgeVec?

FeatureEdgeVechnswlib-wasmPinecone
Vector SearchYesYesYes
Binary QuantizationYes (32x)NoNo
Metadata FilteringYesNoYes
Sparse VectorsYesNoYes
Hybrid Search (RRF)YesNoYes
FlatIndex (exact)YesNoLimited
BinaryFlatIndexYesNoNo
SQL-like QueriesYesNoYes
Memory Pressure APIYesNoNo
Soft DeleteYesNoYes
PersistenceYesNoYes
Browser-nativeYesYesNo
No server requiredYesYesNo
Offline capableYesYesNo

EdgeVec is the only WASM vector database with binary quantization, sparse vectors, hybrid search, BinaryFlatIndex, and filtered search.


Try It Now

Build filters visually, see live results, copy-paste ready code:

Filter Playground - Interactive filter builder with live sandbox

Read the full README
  • Visual filter construction
  • 10 ready-to-use examples
  • Live WASM execution
  • Copy-paste code snippets (JS/TS/React)

Quick Start

npm install edgevec
import init, { EdgeVec, EdgeVecConfig } from 'edgevec';

await init();

// Create index (768D for embeddings like OpenAI, Cohere)
const config = new EdgeVecConfig(768);
const db = new EdgeVec(config);
config.free();

// 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.searchWithFilter(query, 'category = "books" AND price < 50', 10);

// Enable BQ explicitly, then rescore binary candidates with retained F32 vectors
db.enableBQ();
const fastResults = db.searchBQRescored(query, 10, 5);

// 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:

DemoDescription
Entity-RAG DemoEntity-enhanced search on 1000 SQuAD paragraphs, boost ON/OFF toggle (NEW!)
Filter Playground v0.7.0Visual filter builder with live sandbox
v0.6.0 Cyberpunk DemoBQ vs F32 comparison, metadata filtering, memory pressure
Demo HubAll demos in one place

Run locally:

DemoPath
SIMD Benchmarkwasm/examples/simd_benchmark.html
Benchmark Dashboardwasm/examples/benchmark-dashboard.html
Soft Delete Demowasm/examples/soft_delete.html
Main Demowasm/examples/index.html
# Run demos locally
git clone https://github.com/matte1782/edgevec.git
cd edgevec
python -m http.server 8080
# Open http://localhost:8080/wasm/examples/index.html

Entity-Enhanced RAG

EdgeVec supports metadata boosting for entity-enhanced retrieval — improve search relevance by incorporating entity signals (ORG, PERSON, GPE) extracted via NER, without building a knowledge graph.

use edgevec::filter::{MetadataBoost, FilteredSearcher, FilterStrategy};
use edgevec::metadata::MetadataValue;

let boosts = vec![
    MetadataBoost::new("entity_type".to_string(), MetadataValue::String("ORG".to_string()), 0.3)?,
];
let results = searcher.search_boosted(&query, 10, &boosts, None, FilterStrategy::Auto)?;

Boosts are soft signals that rerank results by reducing distance for matches. Combine with FilterExpression for hard constraints + soft boosting in a single query.

Try the in-browser demo — 1,000 SQuAD paragraphs, entity boost ON/OFF toggle, zero API calls.

Read more: Entity-Enhanced RAG in 300KB


Performance

EdgeVec supports SIMD builds for modern browsers. The checked-in package and GitHub Pages demo intentionally use a scalar compatibility build for older Safari versions. The native benchmark figures below are separate from that browser artifact.

Distance Calculation (Native Benchmark)
DimensionDot ProductL2 DistanceThroughput
12855 ns66 ns2.3 Gelem/s
384188 ns184 ns2.1 Gelem/s
768374 ns358 ns2.1 Gelem/s
1536761 ns693 ns2.1 Gelem/s
Search Latency (768D vectors, k=10)
ScaleEdgeVecTargetStatus
1k vectors380 us<1 ms2.6x under
10k vectors938 us<1 msPASS
Hamming Distance (Binary Quantization)
OperationTimeThroughput
768-bit pair4.5 ns40 GiB/s
Batch 10k79 us127 Melem/s
Browser Support
BrowserSIMD build support
Chrome 91+Yes
Firefox 89+Yes
Safari 16.4+ (macOS, iOS, iPadOS)Yes
Edge 91+Yes
Safari 15–16.3Use the scalar build

Safari 16.4 added WebAssembly SIMD. SIMD and scalar are separate compile-time builds; there is no automatic runtime fallback. The default source build (npm run build) enables SIMD. To reproduce the checked-in compatibility artifact, use this Bash command:

RUSTFLAGS="-C target-feature=-simd128" npm run build
Bundle Size
Checked-in scalar artifactBytesBytes (gzip)
WASM698,412266,010
JavaScript glue162,84329,492
Combined861,255295,502

Current artifact validation records the compiler, build flags, hashes, and measured performance.

Full benchmark report ->


Database Features

Binary Quantization (v0.6.0)

Binary codes use 1 bit per dimension, 32x smaller than F32 payloads. Enabling BQ on a float index retains the original F32 vectors for rescoring.

// BQ requires dimensions divisible by 8 and explicit enablement
const config = new EdgeVecConfig(768);
const db = new EdgeVec(config);
config.free();
db.enableBQ();
db.insert(vector);

// Raw BQ search (~85% recall, ~5x faster)
const bqResults = db.searchBQ(query, 10);

// BQ + rescore (~95% recall, ~3x faster)
const rescoredResults = db.searchBQRescored(query, 10, 5);
ModeVector payloads (100k × 768D)SpeedRecall@10
F32 (baseline)~293 MiB1x100%
BQ raw on a float index~302 MiB (F32 + codes)5x~85%
BQ + rescore(5)~302 MiB (F32 + codes)3x~95%

Payload sizes exclude graph, metadata, and capacity overhead. Speed and recall depend on the data and hardware. BQ memory details.

Metadata Filtering (v0.6.0)

Insert vectors with metadata, search with SQL-like filter expressions:

// Insert with metadata
db.insertWithMetadata(vector, {
    category: "electronics",
    price: 299.99,
    tags: ["featured", "sale"]
});

// Search with filter
db.searchWithFilter(query, 'category = "electronics" AND price < 500', 10);
db.searchWithFilter(query, 'tags ANY ["featured"]', 10);  // Array membership

// Complex expressions
db.searchWithFilter(query,
    '(category = "electronics" OR category = "books") AND price < 100',
    10
);

Operators: =, !=, >, <, >=, <=, AND, OR, NOT, ANY

Filter syntax documentation ->

Memory Pressure API (v0.6.0)

Monitor and control WASM heap usage:

const pressure = db.getMemoryPressure();
// { level: 'normal', usedBytes: 52428800, totalBytes: 268435456, usagePercent: 19.5 }

if (pressure.level === 'warning') {
    db.compact();  // Free deleted vectors
}

if (!db.canInsert()) {
    console.warn('Memory critical, inserts blocked');
}
Soft Delete & Compaction
// O(1) soft delete
db.softDelete(id);

// Check status
console.log('Live:', db.liveCount());
console.log('Deleted:', db.deletedCount());

// Reclaim space when needed
if (db.needsCompaction()) {
    const result = db.compact();
    console.log(`Removed ${result.tombstones_removed} tombstones`);
}
Persistence
// Save to IndexedDB (browser)
await db.save("my-vector-db");

// Load existing database
const db = await EdgeVec.load("my-vector-db");

// Or persist anywhere yourself (files in Tauri/Electron/Node.js, OPFS, uploads)
const bytes = db.toBytes();            // Uint8Array
const restored = EdgeVec.fromBytes(bytes);
Scalar Quantization

SQ8 is available in the native Rust storage API through StorageType::QuantizedU8(QuantizerConfig { min, max }). The WASM EdgeVecConfig has no SQ8 option; assigning config.quantized does not enable quantization. For WASM, use the explicit BQ API shown above.

FlatIndex (v0.9.0)

Brute-force exact nearest neighbor search for small datasets. No graph overhead, 100% recall guarantee.

use edgevec::{FlatIndex, FlatIndexConfig, DistanceMetric};

let config = FlatIndexConfig::new(768)
    .with_metric(DistanceMetric::Cosine)
    .with_capacity(10_000);
let mut index = FlatIndex::new(config);

// Insert vectors
let id = index.insert(&embedding)?;

// Exact search (100% recall)
let results = index.search(&query, 10)?;

// Persistence via snapshot
let snapshot = index.to_snapshot()?;
let restored = FlatIndex::from_snapshot(&snapshot)?;

When to use FlatIndex: Datasets under ~50K vectors where exact recall matters more than speed.

Sparse Vectors (v0.9.0)

CSR-format sparse vector storage with inverted index for fast keyword-style retrieval.

use edgevec::SparseVector;
use edgevec::sparse::{SparseStorage, SparseSearcher};

// Create a sparse vector (e.g., BM25 term weights)
let sv = SparseVector::new(
    vec![10, 42, 999],       // term indices
    vec![0.8, 1.2, 0.3],    // term weights
    30_000,                   // vocabulary size
)?;

// Store and search
let mut storage = SparseStorage::new();
let id = storage.insert(&sv)?;

let searcher = SparseSearcher::new(&storage);
let results = searcher.search(&query_sv, 10);
Hybrid Search (v0.9.0)

Combine dense (HNSW) and sparse retrieval with Reciprocal Rank Fusion (RRF) or linear fusion.

use edgevec::hybrid::{HybridSearcher, HybridSearchConfig, FusionMethod};

// Set up: HNSW index + sparse storage already populated
let searcher = HybridSearcher::new(&hnsw_index, &dense_storage, &sparse_storage);

let config = HybridSearchConfig::new(
    50,   // dense_k: candidates from HNSW
    50,   // sparse_k: candidates from sparse
    10,   // final_k: results after fusion
    FusionMethod::Rrf { k: 60 },  // RRF with k=60
);

let results = searcher.search(&dense_query, &sparse_query, &config)?;
for r in &results {
    println!("ID: {}, score: {:.4}, dense_rank: {:?}, sparse_rank: {:?}",
        r.id, r.score, r.dense_rank, r.sparse_rank);
}
BinaryFlatIndex (v0.9.0)

Native binary vector storage with Hamming distance search. 32x memory reduction, sub-microsecond inserts.

use edgevec::BinaryFlatIndex;

// 768-bit binary vectors (96 bytes each)
let mut index = BinaryFlatIndex::new(768)?;

// Insert packed binary vectors
let id = index.insert(&binary_vector)?;

// Hamming distance search
let results = index.search(&query, 10)?;
for r in &results {
    println!("ID: {}, distance: {}", r.id, r.distance);
}

Use cases: Semantic caching, large-scale deduplication, insert-heavy workloads (~1us insert vs ~2ms for HNSW).


Rust Usage

use edgevec::{HnswConfig, HnswIndex, VectorStorage};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = HnswConfig::new(768);
    let mut storage = VectorStorage::new(&config, None);
    let mut index = HnswIndex::new(config, &storage)?;

    // Insert
    let vector = vec![0.1; 768];
    let id = index.insert(&vector, &mut storage)?;

    // Search
    let query = vec![0.1; 768];
    let results = index.search(&query, 10, &storage)?;

    // Soft delete
    index.soft_delete(id)?;

    Ok(())
}

Documentation

DocumentDescription
TutorialGetting started guide
Filter SyntaxComplete filter expression reference
Database OperationsCRUD operations guide
FlatIndex APIFlatIndex reference
Sparse VectorsSparse vector storage and search
Hybrid SearchDense + sparse fusion guide
BinaryFlatIndexBinary vector index reference
Performance TuningHNSW parameter optimization
Migration GuideMigrating from hnswlib, FAISS, Pinecone
ComparisonWhen 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.9.0 — Sparse vectors (CSR), hybrid search (RRF + linear fusion), FlatIndex, BinaryFlatIndex (PR #7 by @marlon-costa-dc)
  • v0.8.0 — Vue 3 composables, functional filter API, SIMD Euclidean, tech debt reduction
  • v0.7.0 — SIMD acceleration (2x+ speedup), First Community Contribution (@jsonMartin — 8.75x Hamming)
  • 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

Contributors

Thank you to everyone who has contributed to EdgeVec!

ContributorContribution
@jsonMartinSIMD Hamming distance (PR #4) — 8.75x speedup
@marlon-costa-dcBinaryFlatIndex + clippy quality fixes (PR #7, PR #8)

License

Licensed under either of:

at your option.


Built with Rust + WebAssembly

GitHub | npm | crates.io | Demos

Runs on
GPU support unknown
What shows it
  • no dependency or feature matches a backend row
Native code
None found
  • No native code found
Python bindings
No Python binding crate found
License
Apache-2.0 OR MIT

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.

edgevec beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
edgevec This page Listed

High-performance embedded vector database for Browser, Node, and Edge

14 downloads over 30 days 1 100 0.9.0 GPU support unknown No native code found Apache-2.0 OR MIT
kiddo Featured

A high-performance, flexible, ergonomic k-d tree library. Ideal for geo- and astro- nearest-neighbour and k-nearest-neighbor queries

481,504 downloads over 30 days 56 179 6.3.0 GPU support unknown Build uses a native toolchain: cc (feature cpp_competitors) Apache-2.0 OR MIT
qdrant App Featured

Qdrant - High-performance, massive-scale Vector Database and Vector Search Engine for the next generation of AI. Also available in the cloud https://cloud.qdrant.io/

34,017 binary downloads per release Not applicable 35,478 Not measured Not measured Apache-2.0
ruvector Listed

High-performance Rust vector database core with HNSW indexing

39,411 downloads over 30 days 51 4,675 2.5.0 CUDA, WebGPU, Metal Binds native code: libsqlite3-sys, napi-sys, ort-sys, pgrx-pg-sys, pqcrypto-internals and 5 more MIT
regexr Listed

A high-performance regex engine built from scratch with JIT compilation and SIMD acceleration

8,809 downloads over 30 days 4 28 0.6.2 GPU support unknown No native code found Apache-2.0 OR MIT

[H] HyperspaceDB is a high-performance, vector database. It features 1-bit quantization, async replication, and native support for hierarchical datasets (Lorentz, Poincaré ball & Hybrid models).

96 downloads over 30 days 3 163 4.2.0 GPU support unknown Binds native code: ort-sys (feature local-onnx) MIT
satoriDB App Listed

High performance embedded vector database

0 binary downloads per release Not applicable 245 Not measured Not measured MIT
Why ListedNo archive, New or Featured rule places it, so it is Listed.

What it lacks for Featured

  • It has 1 active dependents and 1 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 100 stars, 6 forks and 2 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.

What else the check found

  • The last activity is on 20 Oct 2026, 20 days ago. The rules expect an update within 365 days. Dormancy rule

Exact rules: Listed, Featured library. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: version 0.9.0 base 140, raised to the 365-day floor: E = 365 days
  • dormancy: last activity 2026-10-20, 20 days ago, E = 365: active
  • featured: not featured: active_users 1 < 11 and new_adopters 1 < 9 and repository route stars 100 (needs 4539), forks 6 (needs 434), contributors 2 (needs 79)
  • listed: listed: no archive, new or featured rule applies

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources6 sources
Adoption1 active dependents, 1 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents1crates.io database dumpYes
New dependents (365 days)1crates.io database dumpYes
Peak active dependents1crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 20 days ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-10-20GitHub repositoryYes
Latest release2026-02-27crates.io database dumpYes
First release2025-12-15crates.io database dumpYes
Latest version0.9.0crates.io database dumpYes
Days the oldest outside issue waits for a reply0GitHub repositoryYes
Maintainer replies over 365 days6GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution8 releases, 14 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases8crates.io database dumpYes
Downloads over 30 days14crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository100 stars, 6 forks, 2 contributors, 244 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars100GitHub repositoryYes — one part of the repository route
GitHub forks6GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account2GitHub contributorsYes — one part of the repository route
Commits on the default branch244GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseApache-2.0 OR MITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesNo native code foundcrates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly1crates.io database dumpNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.