Anki add-on: Semantic search

NOTE: everytime you update Anki you need to reinstall numpy otherwise it will try to compute the index by doing the actual math and kill your ram Semantic Search – Anki Add-on The semantic search add on gives you a browse feature that understands meaning rather than just matching keywords. After a one-time indexing step (which embeds all your cards using Voyage AI's voyage-4-large model — an embedding model that converts each card's content into a 1024-dimensional vector capturing its meaning), you can search your entire collection using natural language... i.e. searching "signs of adhesive capsulitis on exam" will surface cards about restricted passive and active ROM even if they never use those exact words. Results are ranked by cosine similarity and are ranked by relevance score. Optionally, if you add an Anthropic API key, you can rerank the top 50 results through Claude Haiku, which actually reads each card in context and re-orders them with greater understanding. If you're still not getting good results with the basic search function, you can click the "smart search" button. This does a bunch of other hardcore things you can find the technical details on below, but basically it should find what you need! It does requrie an Anthropic API though. There's also other buttons on each card that enable quick actions: to search the deck for potential "meaning" duplicates. to unsuspend/suspend a card to jump to edit function a "schedule" button which randomly sets the due date of the card within a week, in case you find a new card you want to pop up conveniently in your reviews soon The add-on also includes two Claude-powered bonus modes: a Vignette mode where you paste a question bank practice question and Claude extracts the core clinical concepts into an optimised search query and finds relevant cards, and a Guideline Review mode where you paste a new study abstract or UpToDate section etc and the add-on automatically identifies which of your existing cards may be outdated or incomplete — surfacing them with specific suggested amendments. Suspended cards are visually flagged in results and can be unsuspended in one click, making it useful for finding relevant cards to add to your active queue. All card operations (unsuspend, open in editor) work directly from the results panel without leaving the search dialog. Setup (do this once) 1. Install numpy First, you need numpy installed on Anki's python. On Mac, you can run ~/Library/Application\ Support/AnkiProgramFiles/.venv/bin/pip install numpy in Terminal. 2. Get a Voyage AI API key Go to https://voyageai.com → Sign up (free) Dashboard → API Keys → Create new key You get $10 free credit — enough to embed ~8 million cards 4. Enter your API key Anki → Tools → Semantic Search Settings → paste key → Save 5. Build the index Click "⚙ Build Index" in the widget on the home screen. Runs in the background — you can keep using Anki 200k cards takes ~10-15 minutes and costs ~$1.50 Progress bar shows current status Subsequent runs only re-embed new/changed cards (very fast, ~free) 6. Search Press Ctrl+Shift+F (or click "🔍 Search" button) Type a clinical concept, question, or phrase Results show relevance %, card front, card back preview, deck Click any result to open it in the card browser Storage Embeddings are stored in user_files/embeddings.db (SQLite). Approximate size: ~400MB for 200k cards (float16 compression). Change log 26/03 Regular quick search button still there.. but added a new "smart search" button that may take a few more seconds but should be even more accurate. it requires an Anthropic API too. Here's how it works: Step 1 — Claude generates two things from your query: A hypothetical Anki card — what a perfect card on this topic would look like, written in flashcard style (e.g. "Front: Adhesive capsulitis exam findings | Back: Globally restricted ROM in all planes, especially ER; no crepitus...") 2 paraphrases of your query using different medical terminology (eponyms, mechanisms, abbreviations, etc.) Step 2 — Voyage embeds all of them: The hypothetical card is embedded as a document — the same way your real cards were indexed. This is the key insight of HyDE: a document-to-document comparison is more accurate than query-to-document, because the hypothetical card lives in the same vector space as your real cards. The original query + 2 paraphrases are embedded as queries (3 in one batch call) Step 3 — 4 independent searches run against your embedding matrix, one per vector. Step 4 — Reciprocal Rank Fusion merges the results. Each card's final score is Σ 1/(60 + rank) summed across every list it appears in. A card that ranks #4 in the HyDE search, #7 in the original query, and #3 in a paraphrase scores much higher than one that only appeared in one list. Cards that consistently surface across multiple angles of the same concept float to the top. The practical effect: it catches cards where your query language and your card language don't overlap — e.g. you search "heart attack workup" and it finds cards phrased around "STEMI", "troponin kinetics", and "Killip classification" that a single keyword-style or even single-vector search might rank poorly.