Browser requirements
-
OPFS (
navigator.storage.getDirectory, Chrome/Edge 86+, secure context) - IndexedDB
-
navigator.storage.estimate() -
navigator.storage.persist()
What this demo does not do yet
- Not yet: HNSW (Sprint 6, after the TD-17 note), quantisation, compaction, encryption at rest, and a measurement on an 8 GB laptop (not measured on 8 GB).
- There is no compaction: deleting a document hides its chunks from every query but the bytes stay until the namespace is cleared. Nothing is encrypted at rest: any script on this origin, and anyone with this browser profile, can read what is stored.
- The vector index and the documents are flat scans: every query scores every row. The figures on this page are measured in this tab on this device; the README figures are from an Apple M5 Pro 48 GB and nothing here is an 8 GB figure.
- The documents on this page are three synthetic, made-up documents with seeded vectors. There is no PDF reading, no text extraction and no embedding model here: that pipeline is the dockit demo.
-
The
storage.*events reach only the list on this page: it registers anEventSinkand renders what it receives. This page does not load the runtime, so the Airplane Mode DevTools panel does not show them; an app wires both by passing the same sink tocreateStore({ events }). The cost of events on a large workload has not been measured. - Not published: the npm scope and package name are not reserved; not tagged.
- The key-value side has no cross-tab coordination: two tabs writing the same namespace can leave the accounting record stale until the next read repairs it. (The vector index and the documents take a Web Lock per namespace.)
-
Chrome under-reports IndexedDB usage in
estimate(), so the browser figure and the SDK figure will not match on the indexeddb driver. -
persist()may be refused without user engagement with the site; a refusal is shown asfalse, not as an error. - No service worker: offline after the first load is best effort (Chrome's HTTP cache), not guaranteed.
Store
No store open.
set / get / delete
Open a store first.
navigator.storage (live, refreshed every 2 s and after each action)
| estimate().usage | - |
|---|---|
| estimate().quota | - |
| usage / quota | - |
| persisted() | - |
storage.* events (live)
This page registers an EventSink with createStore({ events }) and lists every event it receives, newest first, last 50 only. Each event carries the namespace, the driver, an outcome, a byte count and a duration. It never carries a key, a prefix or a value.
Vector index
Deterministic synthetic vectors (dimension 384) with 256-byte synthetic chunks, written with putVectors into the namespace demo-vectors on OPFS (IndexedDB when OPFS is missing). No real documents and no model.
100k rows use about 183 MB of this browser's storage (shared with other Airplane Mode Labs demos on this origin); Delete index removes it.
| Query | - |
|---|---|
| Time (createStore to first answer) | - |
| Kernel, rows | - |
| JS heap: approximate (performance.memory) | - |
| WASM memory | - |
| Index bytes | - |
| Matches naive reference | - |
Measured in this tab on this device. The README figure is from an Apple M5 Pro 48 GB; not measured on 8 GB.
Documents
Three synthetic documents of four chunks each (fixed made-up sentences with seeded vectors of dimension 384; no real document and no model), stored with putDocument in the namespace demo-docs and found again with queryChunks, which returns each chunk's text and the page it came from. The page uses its own store (OPFS, else IndexedDB) and closes it after every action, so Reload page followed by List documents is a genuine reopen.
Delete hides a document's chunks in one commit; Clear namespace removes every file or record of the namespace, and the line above shows the browser's own count afterwards. Measured in this tab; not measured on 8 GB.
Quota fill
Writes 4 MiB chunks of random bytes (crypto.getRandomValues, synthetic) as
keys fill-000001, fill-000002, ... under namespace
demo-fill until the SDK soft quota or the browser reports
quota_exceeded, Stop is pressed, or the ceiling is reached.
Hard ceiling 512 MiB per run; this consumes quota the runtime demo also uses; use Clear fill afterwards