Skip to content

Cache embeddings in memory and improve search UX#29

Merged
twaugh merged 2 commits intomainfrom
search-cache
Mar 17, 2026
Merged

Cache embeddings in memory and improve search UX#29
twaugh merged 2 commits intomainfrom
search-cache

Conversation

@twaugh
Copy link
Copy Markdown
Owner

@twaugh twaugh commented Mar 17, 2026

Summary

  • In-memory embedding cache: load embeddings from IndexedDB once per search session, reuse for subsequent searches. Cache is invalidated on IDB writes, when the modal opens, and when indexing completes. Evicted after 60s idle.
  • Increase debounce to 500ms: reduces unnecessary API calls while typing fast
  • Enter to search: pressing Enter triggers an immediate search when no result is selected, instead of waiting for the debounce

Test plan

  • All 56 tests pass
  • Manual test: verify search results appear correctly
  • Manual test: verify repeated searches within a session feel faster
  • Manual test: verify Enter triggers immediate search

🤖 Generated with Claude Code

twaugh and others added 2 commits March 17, 2026 10:05
Load embeddings from IndexedDB on first search, then reuse the cached
array for subsequent searches within the same modal session. The cache
is invalidated on IDB writes, when the modal opens, and when indexing
completes. An eviction timer releases memory 60s after the modal closes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reduce unnecessary API calls while typing by increasing the debounce
delay. Allow pressing Enter to trigger an immediate search when no
result is selected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@twaugh twaugh merged commit 1242bdf into main Mar 17, 2026
1 check passed
@twaugh twaugh deleted the search-cache branch March 17, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant