Problem
For every search query, the vector index computes cosine similarity with every stored vector. With 10K vectors of 768 dimensions, this is ~7.7M floating-point operations per search.
Location
src/state/vector-index.ts:35-52
Suggested Fix
Use an approximate nearest neighbor algorithm (HNSW, IVF) or a WebAssembly-based library for efficient vector search.
Problem
For every search query, the vector index computes cosine similarity with every stored vector. With 10K vectors of 768 dimensions, this is ~7.7M floating-point operations per search.
Location
src/state/vector-index.ts:35-52Suggested Fix
Use an approximate nearest neighbor algorithm (HNSW, IVF) or a WebAssembly-based library for efficient vector search.