Browser-native vector search

Vecal

An ESM-only, zero-dependency vector database with IndexedDB durability and Worker-hosted Exact and HNSW search.

Quick search flow
import { VectorDB } from 'vecal';

const db = await VectorDB.open({
  name: 'docs-search',
  dimension: 3,
  metric: 'cosine',
});

await db.add({
  vector: new Float32Array([0.91, 0.12, 0.04]),
  metadata: { title: 'Vector indexing' },
});

await db.ensureIndex({ type: 'hnsw' });

const results = await db.search(
  new Float32Array([0.88, 0.18, 0.07]),
  { k: 5, strategy: 'auto' },
);

Correct by default

Auto falls back to streaming Exact whenever HNSW is not ready.

Worker owned

Storage, indexing, and retrieval stay away from main-thread compute.

Durable acceleration

Revision-matched typed-array HNSW snapshots restore after refresh.