Evaluate OPFS-backed binary persistence for the vector index (float32 layout instead of serialized IDB objects)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- performance, web-dev
Direzione di ricerca
Start with src/lib/search/vector-store.ts and src/lib/search/search-worker.ts, then run vector-store.bench.test.ts using vitest.bench.config.ts to establish the IndexedDB baseline. Evaluate OPFS sync access handles and the existing incremental re-embed path without removing the IndexedDB fallback. The evaluation is done when benchmark evidence and browser-support findings are recorded as an ADR under plans/ADRs/; implementation is only warranted if the issue’s “clears the bar” criterion is made explicit.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The semantic vector index persists in IndexedDB (src/lib/search/vector-store.ts:11). IndexedDB serializes every entry through structured clone, which is expensive for large float arrays. The 2026 local-first pattern for this exact access shape — "one enormous opaque payload, accessed positionally" — is a contiguous Float32Array packed into a single binary file in OPFS (navigator.storage.getDirectory()), read/written positionally by the search worker with sync access handles, and rebuilt incrementally from the existing content-hash digests.
Evidence
src/lib/search/vector-store.ts— IndexedDB persistence behind model/preprocessing/corpus fingerprints.src/lib/search/semantic-digest.ts,vector-store-incremental.test.ts— incremental re-embed machinery already exists, which is the prerequisite for an append-friendly binary layout.- The search worker (
src/lib/search/search-worker.ts) is the right thread for OPFS sync access handles.
Impact
- Memory + startup: no structured-clone deserialization of thousands of vectors at boot; a single mmap-able-style buffer scan.
- Query latency: single-pass dot-product over a contiguous buffer beats per-entry IDB reads, especially at the corpus sizes the semantic budget (
semantic-budget.ts) allows. - Caveats to weigh: OPFS-in-worker browser support matrix; the current IDB path must remain the fallback; eviction semantics are shared with the corpus quota (pairs with the
navigator.storage.persist()work).
Proposed approach
- Spike: measure current load time and memory for a representative corpus (the bench harness
vitest.bench.config.ts+vector-store.bench.test.tsgives the baseline tooling). - If it clears the bar, implement a dual-mode store (OPFS primary, IDB fallback) behind the existing
vector-storeinterface; extend fingerprinting to cover the layout version. - Record the decision as an ADR in
plans/ADRs/per repo workflow. - Only pursue after the
navigator.storage.persist()issue lands so eviction semantics are controlled.
References
- OPFS vs IndexedDB for large binary data (2026): https://anirone.com/blog/general/opfs-vs-indexeddb-binary-storage
- Client-side RAG with OPFS-packed embeddings (2026 pattern): https://dev.to/codingcatdev/zero-backend-client-side-rag-in-the-browser-with-webgpu-transformersjs-mediapipe-and-opfs-245g
- MDN Origin Private File System: https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system
- Lingua principale
- TypeScript
- Stelle
- 3
- Fork
- 2
- Merge medio
- 11h 49m
- PR unite (30g)
- 102
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di d-oit/do-knowledge-studio
-
Migrate do-harness.toml to the current [[sensors]] schema (do-harness CLI 0.6.0 cannot parse it)Apertachore config priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
d-oit/do-knowledge-studio#1219 ·
I maintainer di solito rispondono entro 1 giorno
-
Dependabot only scans the root manifest — add workspace packages/* directories, cooldown, and grouped updatesForse già presa @d-oit l’ha presa oggi. Apertaci config deps priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
d-oit/do-knowledge-studio#1212 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation priority: low
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
d-oit/do-knowledge-studio#1218 ·
I maintainer di solito rispondono entro 1 giorno
-
chore priority: low skills
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
d-oit/do-knowledge-studio#1217 ·
I maintainer di solito rispondono entro 1 giorno
-
ai-agent enhancement feature priority: low
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
d-oit/do-knowledge-studio#1215 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di d-oit/do-knowledge-studio
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
danielmiessler/LifeOS#3028 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
iOS: last line of a long UITextView text is sometimes not drawn (frame a fraction of a point short)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
Koenkk/zigbee2mqtt#33855 ·
I maintainer di solito rispondono entro 1 giorno