Commit Graph
3 Commits
Author SHA1 Message Date
sneak 643485bdb3 Content-similarity search surface over the CLIP index (closes #50)
check / check (push) Successful in 16s
Adds lib.mldata search over the CLIP index (#49): forFile returns a
file's stored payload; similar ranks nearest files by cosine on the CLIP
embedding; searchByEmbedding ranks the index against a caller-supplied
query vector. All RAM-only, reusing the packed Float32Array index and id
list. No text encoder is bundled — the caller provides the query vector.

Redo of the reverted first cut: under noUncheckedIndexedAccess the cosine
loops read query[k]/embeddings[base+k]/fileIDs[i] as number|undefined, so
tsc (make build) failed though make check passed. Every such read is now
in range by the surrounding bounds check (query length, packed layout),
so the reads are asserted non-null rather than paying a per-element guard
in the hot ~50k×512 loop. Gated on both make check and make build.

Model: opus-4-8
2026-09-22 18:33:23 +00:00
clawbot 61dfec8d38 Revert ML search (#50) to restore a green next (build fix pending)
check / check (push) Successful in 18s
Reverts the #50 merge (224bd101): mlsearch.ts failed tsc in the CI build (make check does not run make build, so it slipped past review). next restored to green; #50 to be redone with make build in its gate.

Model: opus-4-8
2026-09-22 18:21:54 +02:00
clawbot 224bd101ab Content-similarity search surface over the CLIP index (closes #50)
check / check (push) Failing after 23s
Adds lib.mldata search over the CLIP index (#49): forFile returns a file's stored payload; similar ranks nearest files by cosine on the CLIP embedding; searchByEmbedding ranks the index against a caller-supplied query vector. All RAM-only, reusing the packed Float32Array index and id list. No text encoder is bundled — the caller provides the query embedding.

Model: opus-4-8
2026-09-22 18:14:13 +02:00