deckhearth/.convoys/scan-visual-catalog-search/brief-2-backfill-embeddings.md
varutasu 8f09ed1ef6
feat(scanner): Layer-0 visual catalog search (Phase 3) (#160)
Add pgvector embeddings on cards, server-side cohere/embed-v4.0 via AI
Gateway, kNN identify route, and L0→L1→L2 client orchestration with
empty-index fast escalate and id-cursor backfill job.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 21:46:39 -05:00

24 lines
642 B
Markdown

---
convoy: scan-visual-catalog-search
brief_number: 2
depends_on: [1]
recommended_model: composer-2.5-fast
model_tier: fast
files:
- lib/card-embed.js
- scripts/backfill-card-embeddings.js
- package.json
- test/lib/card-embed.test.js
---
# Brief 2: Catalog embedding backfill
## Goal
Server-side embed job using `cohere/embed-v4.0` via AI Gateway; idempotent backfill from `cards.image_url`.
## Acceptance criteria
- [ ] `lib/card-embed.js` exports `embedCardImage`, `formatEmbeddingForPg`
- [ ] `npm run backfill-embeddings` script (skips rows with embedding unless FORCE=1)
- [ ] Rate-limited (`SLEEP_MS`) and DRY_RUN support