Repository navigation
Closed
Description
Decision (David, 2026-09-10)
Free desktop users move to on-device screen embeddings first; paid users keep the Gemini upload until phone-side screen search has a server-side encoder. Follow-on to #13456, which ships the local engine opt-in and does not touch the per-frame Gemini call.
Why free first
plan_catalog.jsonalready declaresdesktop_free.cloud_screen_vectors: false, and the backend honours it:grants_cloud_screen_vectorsgates the Pinecone upsert. A free user's Gemini vectors today serve only desktop-local cosine search, so swapping the embedder changes nothing cross-device for them.- The client never reads that catalog value:
RewindIndexer→OCREmbeddingService.embedScreenshot→v1/proxy/gemini/…gemini-embedding-001:embedContentruns on every plan, anddesktop_proxy.pyleavesembedContentoutside_PLAN_GATED_PROXY_ACTIONS(TBD-4 / S24). Modelled spend $28.85/day, ~85% from free users (gcp-cost-efficiency evidence 2026-09-02, lever 6). - Apple
NLContextualEmbeddingmeasured on an M-series Mac: 512-d, ~7 ms per frame, 85 MB OS-managed asset, 2 KB per row vs 12 KB for Gemini 3072-d.
Scope
- Real-engine benchmark first (gate). feat(desktop): opt-in on-device embeddings with FTS hybrid retrieval; backend keyword fallback for screen search #13456's benchmark ran on the
test_hashengine. Runlocal_embedding_benchmarkwithapple_nlceagainst a real Rewind DB that still holds Gemini blobs, and report recall@10 / nDCG@10 for FTS, vector, hybrid, and Gemini on the same queries. The flip proceeds only if hybrid ≥ Gemini-alone within an agreed margin (David rules on the margin). - Entitlement-aware embed path. Gate the per-frame Gemini call in
OCREmbeddingServiceon the cached plan (FloatingBarUsageLimiter.hasPaidPlan/SubscriptionPlanType.hasPaidCapability, cached infloatingBarCachedPlan) and on a passing local probe: free + probe passes → local only, no Gemini; free + probe fails → FTS-only, never Gemini (fail-closed as in feat(desktop): opt-in on-device embeddings with FTS hybrid retrieval; backend keyword fallback for screen search #13456); paid → today's Gemini upload continues, desktop search still routes local when available. - Default flip for free. Replace the opt-in default (
LocalEmbeddingKillSwitches.isEnabled) with plan-derived default: on for free, on for non-production, opt-in for paid until (5). KeepOMI_DISABLE_LOCAL_EMBEDDINGSas the hard kill. - Route the Rewind UI search (
RewindViewModel.swiftOCREmbeddingService.searchSimilar) throughScreenHistorySearchRoutelike the chat tool. - Server side. Mirror the client gate: 402/403
embedContentfor basic ondesktop_proxy.pyonce the client change is released (a server cut before the client ships would blank free users' vectors with no local replacement). Telemetry: count local vs Gemini vs FTS-only routes per plan. - Not in scope: paid users' cross-device parity (needs a shared embedder on device and server — separate follow-on), Intel Macs beyond "probe fails → FTS-only".
Evidence needed before closing
- Benchmark table (real DB, real engine), 8-hour energy/thermal sample on battery with capture on, and one week of route telemetry after release.
Related: #13456 (foundation), TBD-4 / S24 in the local-models-free-tier program.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsIn review
Activity
Git-on-my-level commentedon Sep 11, 2026
Foundation landed on branch
feat/desktop-free-tier-local-embeddings(cut from #13456's head; retarget after that merges):ScreenEmbeddingPolicydecides Gemini/local/FTS-only from the cached plan, capture and backfill enforce it, unknown plan resolves as free.Two dependencies found during review, being fixed in the same PR before it opens:
embedding IS NOT NULL); lossless sync is off on stable. Free users' vectorless rows must stay sync-eligible once OCR is final, or cloud chat and phone time-window browse lose their screen rows.Git-on-my-level commentedon Sep 11, 2026
Opened as #13473 (stacked on #13456; retarget to main after that merges).
Real-fixture benchmark on one Beta DB (144 Gemini-embedded rows,
apple_nlce512-d): hybrid beats FTS-only and vector-only on both slices (held-out self-retrieval recall@1 0.84 hybrid vs 0.71 FTS vs 0.34 vector; recall@10 1.00 / 0.98 / 0.66). Top-10 agreement with Gemini's ranking is 0.30 for hybrid, which shows the rankings differ, not which is better; a labelled query set is needed to settle that. The Apple model alone is a weak retriever; FTS carries the hybrid. Sample is small.aryanorastar commentedon Oct 30, 2026
Fixed on main by #22141 (
6d4ddac81f8f). Free plans setshouldEmbedWithGeminifalse, andembedScreenshotreturns before the Gemini call unless that flag is set.