Evaluate OPFS-backed binary persistence for the vector index (float32 layout instead of serialized IDB objects)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- performance, web-dev
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 3
- Fork
- 2
- Merge trung bình
- 11 giờ 49 phút
- Pull request đã merge (30 ngày)
- 102
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của d-oit/do-knowledge-studio
-
Migrate do-harness.toml to the current [[sensors]] schema (do-harness CLI 0.6.0 cannot parse it)Đang mởchore config priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
d-oit/do-knowledge-studio#1219 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dependabot only scans the root manifest — add workspace packages/* directories, cooldown, and grouped updatesCó thể đã có người làm @d-oit đã nhận hôm nay. Đang mởci config deps priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
d-oit/do-knowledge-studio#1212 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation priority: low
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
d-oit/do-knowledge-studio#1218 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore priority: low skills
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
d-oit/do-knowledge-studio#1217 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-agent enhancement feature priority: low
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
d-oit/do-knowledge-studio#1215 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của d-oit/do-knowledge-studio
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
danielmiessler/LifeOS#3028 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
iOS: last line of a long UITextView text is sometimes not drawn (frame a fraction of a point short)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Koenkk/zigbee2mqtt#33855 ·
Maintainer thường phản hồi trong vòng 1 ngày