SQLite for the browser, with vector search built in.
sqlite-vector-wasm distributes SQLite's browser WebAssembly runtime with SQLite-Vector statically integrated. Use SQLite's own browser APIs, with vector search available in every new connection. No compilation or extension registration is needed.
Install version 0.3.0:
npm install @at-rama/sqlite-vector-wasm@0.3.0Serve all eleven runtime files together, for example under /sqlite/. The usage guide provides the copy commands and hosting setup. npm installs the assets; your server must expose their URLs with JavaScript MIME types for .js/.mjs and application/wasm for .wasm.
With those files available under /sqlite/, load the upstream ES module:
import sqlite3InitModule from '/sqlite/sqlite3.mjs';
const sqlite3 = await sqlite3InitModule();
const db = new sqlite3.oo1.DB(':memory:');
try {
console.log(db.selectValue('SELECT vector_version()'));
} finally {
db.close();
}Next, create a vector table and find its nearest neighbors. The guide also covers binary vectors, FTS5, Workers and persistence.
- SQLite's JavaScript, ES module, C-style and OO1 browser APIs.
- Native Float32 similarity search on ordinary tables and BLOB columns, with optional quantization.
- Binary vectors and Hamming-distance search.
- Full-text search through SQLite FTS5.
- Web Worker support through SQLite's direct APIs; upstream Worker1/promiser entries remain available for compatibility.
- Browser persistence through OPFS when supported and correctly hosted.
- Static SQLite-Vector integration: no runtime extension loading.
Target modern browsers with the required WebAssembly and JavaScript support. Keep all WASM, Worker, promiser and OPFS companion assets together when deploying the runtime. OPFS requires a secure context and Workers; some persistent VFS modes additionally require cross-origin isolation. An unavailable requested persistent VFS does not silently fall back to in-memory storage.
The package preserves upstream SQLite/SQLite-Vector behavior. It does not provide a Node.js, native or WASI runtime, a root JavaScript wrapper, or guaranteed compatibility with every bundler. Consult the usage guide and SQLite browser documentation for details.
Archive size depends on the release build. Consult the 0.3.0 release assets for their exact payload and provenance.
The 0.3.0 distribution contains runtime.json, recording the selected SQLite and SQLite-Vector versions, source digests, runtime files and build options. The distribution includes consumer guides for SQLite-Vector.
To build or inspect the distribution, see source acquisition, browser builds and packaging.
This repository uses agent-assisted development, automated verification and human review. See AGENTS.md and the development standards.
Project-authored code and documentation use Apache-2.0, also identified by the npm license field. Bundled upstream components retain their own terms: see NOTICE and the full texts in the package's licenses/ directory.
Built on SQLite and SQLite-Vector.