Anki Semantic Search

AnkiWeb addon 751846187

Enables semantic and keyword search across selected Anki notes, generating cited AI answers through local or cloud providers.
AI-generated summary; may contain mistakes.

aisearch

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
3 (πŸ‘ 3 Β· πŸ‘Ž 0)
Updated
2026-06-15
Anki versions
25.09.2~
License
MIT (from the license file in the package)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, JSON
Description language
en

Maintenance

active

  • Last update or commit: 2026-06-15 (139 days before the snapshot).
  • Commits in the last year: 37.
  • Issues: 2 open, 0 closed.
  • Pull requests: 0 open, 0 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
25.09.2+2026-06-15
History across monthly snapshots

Loading…

Similar addons

Easy Search

Enables offline AI semantic and keyword hybrid card search on local CPU, with a browser semantic: prefix, a search dialog for previewing and suspending cards, and automatic model download.

aisearch

2 votes 9% approval πŸ‘ 1 Β· πŸ‘Ž 1 Anki 2.1.1~ Updated 2026-05-30
AnkiVec

Generates local Ollama vector embeddings for Anki cards, stored in ChromaDB, enabling semantic natural-language searches via "vec:" queries that can combine with keyword filters.

aisearch

1 votes 21% approval πŸ‘ 1 Β· πŸ‘Ž 0 ⭐ 0 Anki 23.09~ Updated 2025-11-20
Semantic search

Enables natural-language semantic card search via Voyage AI embeddings, optional Claude reranking and smart search, plus duplicate finding, card actions, and clinical vignette/guideline review modes.

aiduplicatessearch

8 votes 68% approval πŸ‘ 8 Β· πŸ‘Ž 0 Anki 2.1.1~ Updated 2026-04-05
Smart Search

Adds a local AI panel in Anki's Browser that turns plain-English requests into Anki searches, expands synonyms, and finds matching cards privately.

aisearch

1 votes 21% approval πŸ‘ 1 Β· πŸ‘Ž 0 ⭐ 1 Anki 2.1.2~ Updated 2026-06-27
AttendingAI

Grades written Anki answers using an LLM, retrieves supporting material via semantic RAG, offers tutor explanations, analytics, batch assessment, and optional interval suggestions.

aischedulingreview-flowstatisticsquiz

1 votes 21% approval πŸ‘ 1 Β· πŸ‘Ž 0 ⭐ 1 Anki 25.02.6~ Updated 2026-01-10

Description

Anki Semantic Search is a smart AI search tool for your Anki collection.

Search your cards by meaning, not just exact words. Ask a question, find the most relevant notes, and optionally generate an AI answer grounded in your own cards with source citations.

It is useful for large medical decks, lecture notes, personal knowledge bases, and any collection where normal Anki search feels too narrow.

First-time setup

  1. Install the add-on from AnkiWeb, then restart Anki.
  2. Open Anki Semantic Search from the side drawer or from the add-on settings.
  3. Open Settings.
  4. In API Settings, choose an answer provider. You can use a local server such as Ollama or LM Studio, or a cloud/API provider.
  5. Choose an embedding provider for semantic search. You can use the same provider as answering when supported, or select a separate local/cloud embedding provider.
  6. In Note Types & Fields, choose the decks, note types, and fields you want the add-on to search.
  7. Go to Search & Embeddings and click Create/Update Embeddings.
  8. After embeddings finish, open the search window and ask a question.

For a private local setup, run a local model server first, such as Ollama or LM Studio, then enter its local server URL in Settings. For cloud providers, enter the required API key in Settings before testing the connection or creating embeddings.

What it does

  • Search selected Anki notes with keyword search, embedding search, or hybrid retrieval.
  • Ask natural-language questions and get AI answers grounded in your own cards.
  • Review the matching notes behind each answer, with citations and links back into Anki.
  • Open selected results directly in the Anki Browser.
  • Build and refresh an embedding index for the decks, note types, and fields you choose.
  • Keep search history so you can return to previous questions.
  • Tune retrieval with relevance thresholds, result limits, preview length, and optional advanced ranking.

Search and answer workflow

  1. Choose which decks, note types, and fields should be searchable.
  2. Configure an answer provider and an embedding provider.
  3. Create or update embeddings.
  4. Open Anki Semantic Search from the side drawer or add-on settings.
  5. Search by question or concept, review the matching notes, and generate an answer when needed.

The answer panel keeps the response tied to source notes. Citation links can highlight the relevant result rows, and selected notes can be opened in the Anki Browser for review or editing.

Provider support

The add-on supports both local-first and cloud workflows.

Local options include:

  • Ollama
  • LM Studio
  • Jan
  • LocalAI
  • vLLM
  • Other OpenAI-compatible local servers

Cloud and API options include:

  • OpenAI-compatible chat APIs
  • Anthropic Claude
  • Google Gemini
  • OpenRouter
  • Voyage AI embeddings
  • OpenAI embeddings
  • Cohere embeddings

You can use the same provider for answers and embeddings when supported, or configure separate providers for each role.

Retrieval features

  • Keyword-only search for fast lexical matching.
  • Embedding-only search for semantic matching.
  • Hybrid RRF search to combine keyword and semantic results.
  • Optional Cross-Encoder reranking with sentence-transformers.
  • Optional query expansion for related terms and medical synonyms.
  • Optional HyDE search, which generates a hypothetical answer/document before retrieval.
  • Context-aware ranking and relevance filtering.
  • Embedding status checks, stale index detection, and ineligible-note review.

Settings and customization

The settings window is split into focused areas for:

  • API and provider configuration.
  • Search strategy and embedding controls.
  • Deck, note type, and field selection.
  • Presets for searchable note scopes.
  • Search window styling and layout preferences.
  • Optional dependency checks and install guidance.

This lets you keep irrelevant fields out of the index, reduce noise from large decks, and adapt the search UI to your workflow.

Privacy

Privacy depends on the providers you choose.

If you use local providers for both answers and embeddings, note content can stay on your machine. If you use cloud providers, selected note text may be sent to the chosen embedding provider during indexing/search and to the chosen answer provider when generating answers.

API keys are stored in the add-on configuration. Debug logs are designed to redact sensitive values.

Requirements

  • Anki 2.1.66 or newer.
  • Restart Anki after installing or updating the add-on.
  • At least one answer provider, local or cloud.
  • At least one embedding provider for semantic search.

Optional features may require extra Python packages:

pip install sentence-transformers anthropic pyspellchecker
  • sentence-transformers enables Cross-Encoder reranking.
  • anthropic enables Anthropic streaming support.
  • pyspellchecker enables spell checking in the search box.

On Windows, using an external Python for Cross-Encoder reranking is recommended if PyTorch has trouble loading inside Anki.

Screenshots

Search composer

Ask Notes answer with source results

API and embedding settings

Notes

This add-on is designed for both medical and general Anki workflows. It works best after you carefully choose the decks, note types, and fields that should be searchable, then rebuild embeddings after major changes to your collection or provider settings.

Developed by Zahi-Essam.

Latest update - 2026-06-15

This update adds a new chat-style search workflow, local retrieval memory, image support for vision models, and improved source controls.

  • New Ask AI and Ask Notes composer flow: ask directly, or search your Anki notes and answer with citations.
  • Added local memory for retrieval planning. It stores compact local snippets from final answer context, keeps them non-citable, and can use hybrid memory retrieval when embeddings are available.
  • Added image attachment support for vision-capable models. You can attach PNG, JPG, or WebP images from the search composer, and image fields can be used in Review Ask AI context.
  • Improved Review Ask AI with follow-up chat, current-card context preview, image-aware note context, selected-answer follow-up questions, and a shortcut to search the whole collection from the review card.
  • Refined the search window into a chat-style conversation with separate Ask AI, Ask Notes, Find Related Notes, and Clear Chat actions.
  • Improved source handling with collapsible source notes, note previews, relevance bars, a single threshold control, and Show All Source Notes for lower-relevance retained results.
  • Improved search history with reloadable previous searches and clearer history controls.
  • Improved embedding/index diagnostics, stale-index detection, ineligible-note review, and safer retry behavior for changed or missing embeddings.
  • Added more tests around answer formatting, prompts, memory runtime, image attachments, and search history display.

README

Anki Semantic Search

Semantic search and AI answers for your Anki collection. The add-on helps you find relevant notes by meaning, then can generate an answer grounded in the matching cards.

AnkiWeb code: 751846187

What It Does

  • Searches your selected Anki notes by keyword, embeddings, or hybrid retrieval.
  • Generates AI answers from the matching notes.
  • Shows cited notes and lets you open selected results in the Anki Browser.
  • Supports local-first workflows with Ollama, LM Studio, Jan, or other OpenAI-compatible local servers.
  • Supports cloud providers for higher-quality answers or embeddings.
  • Lets you choose exactly which decks, note types, and fields are searchable.
  • Builds and refreshes an embedding index for semantic search.
  • Includes optional medical/clinical retrieval tuning, re-ranking, query expansion, HyDE, and context-aware ranking.
  • Keeps search history and lets you reload previous searches.

Requirements

  • Anki 2.1.66 or newer.
  • Restart Anki after installing or updating the add-on.
  • One of the following:
    • Local server for private/local answers or embeddings.
    • Cloud API key for cloud answers or embeddings.

Optional features may require Python packages listed in requirements-optional.txt.

Quick Start

  1. Install the add-on from AnkiWeb with code 751846187, or place this folder in Anki2/addons21/.
  2. Restart Anki.
  3. Open the add-on from the side drawer or from Anki's add-ons/config area.
  4. Open Settings.
  5. Configure an answer provider in the API Settings tab.
  6. Configure an embedding provider in the API Settings tab or keep it set to use the same provider when supported.
  7. Choose decks, note types, and fields in Note Types & Fields.
  8. Go to Search & Embeddings and click Create/Update Embeddings.
  9. Open the search dialog and ask a question.

Access Points

  • Side drawer button in the Anki main window.
  • Add-ons manager config entry.
  • Settings button inside the search dialog.

Main Search Workflow

  1. Type a question in the search box.
  2. Press Search or use Ctrl+Enter.
  3. Review Matching Notes.
  4. Select notes if you want to inspect or open them.
  5. Read the AI answer and use citation links to jump to supporting notes.
  6. Use Show only cited notes when you want to narrow the result table to notes used in the answer.

Search UI features:

  • Search history dropdown.
  • Clear history button.
  • Matching notes table with relevance bars.
  • Preview length slider for result snippets.
  • Select all and deselect all controls.
  • View Selected and View All buttons for opening notes in Anki Browser.
  • Copy button for the AI answer.
  • Source/status labels showing answer/search state.

Settings Tabs

Settings use a shared dark theme across tabs, with consistent rows, controls, tables, section headers, and scrollbars. The API and Styling tabs are width-constrained for comfortable reading on wide monitors, while Search & Embeddings and Note Types & Fields remain full-width work surfaces.

API Settings

Configure answer and embedding providers.

Answer providers:

  • Local Server: Ollama, LM Studio, Jan, LocalAI, vLLM, or other OpenAI-compatible servers.
  • Cloud API: OpenAI-compatible APIs, Anthropic Claude, Google Gemini, OpenRouter, and custom endpoints supported by the add-on configuration.

Embedding providers:

  • Use same provider as answering when supported.
  • Local server embedding endpoint.
  • Voyage AI.
  • OpenAI embeddings.
  • Cohere embeddings.

Useful controls:

  • API key input with Show/Hide.
  • Automatic provider detection.
  • Local server URL and model name.
  • Local server autodetect for running Ollama, LM Studio, or Jan instances and loaded models.
  • Local connection test.
  • Cloud embedding provider selection.
  • Embedding API key input.

Search & Embeddings

Controls retrieval behavior and embedding indexing.

Search strategies:

  • Keyword Only.
  • Keyword + Re-rank.
  • Hybrid (RRF).
  • Embedding Only.

AI-assisted retrieval:

  • Query Expansion: adds related medical/semantic terms.
  • Filter Filler Words: uses AI to reduce generic query terms.
  • HyDE: generates a hypothetical answer/document first, then searches with it.

Clinical accuracy tuning:

  • Minimum relevance threshold as a global retrieval quality floor.
  • Max results pool.
  • Hybrid embedding weight.
  • Relevance from answer.
  • Relevance Threshold slider: one visible cutoff for shown notes and AI context, while retrieval keeps a low internal floor for reranking breadth.

Re-ranking:

  • Cross-Encoder re-ranking through sentence-transformers.
  • External Python path support, recommended on Windows to avoid Anki torch/DLL issues.
  • Autodetect, browse, install/show command, and check-again controls.
  • Context-aware ranking.

Technical diagnostics:

  • Verbose search debug.
  • Extra stop words.
  • Max characters per note.
  • Advanced Anki Python dependency install option.

Embedding actions:

  • Create/Update Embeddings.
  • Review Ineligible Notes.
  • Test Connection.
  • Reset to Clinical Defaults.

Note Types & Fields

Choose what can be searched and embedded.

  • Include all note types or choose specific note types.
  • Include all decks or choose specific decks.
  • Choose fields per note type.
  • Search all fields option.
  • Use first field fallback when a note type has no selected fields.
  • Count notes with current settings.
  • Save, load, and delete presets.
  • Refresh note type, field, and deck lists.

This tab is the main place to prevent irrelevant cards from entering the search index.

Styling

Controls visual and layout preferences.

  • Question input font size.
  • AI answer font size.
  • Matching notes font size.
  • Label font size.
  • Default window width and height.
  • Answer/notes layout mode.
  • Section spacing.
  • Answer line spacing.
  • Centered, compact settings layout for easier use on wide displays.

Embeddings And Indexing

Semantic search needs embeddings. Click Create/Update Embeddings after:

  • First install.
  • Changing embedding provider/model.
  • Changing searchable decks, note types, or fields.
  • Adding many new notes.
  • Editing note content you want reflected in semantic search.

The add-on stores embedding data under user_files/ and uses status checks to detect stale or incomplete indexing.

If a note is excluded from indexing, use Review Ineligible Notes to inspect why.

Local Memory

When Local Memory is enabled, the add-on stores compact snippets from the final notes selected for an answer. These snippets stay in user_files/agent_memory.db and are used only to help future retrieval planning.

  • Memory snippets are not added to the answer prompt as numbered notes.
  • Memory snippets are marked non-citable; final citations still refer only to visible Anki notes.
  • Text memory works without embeddings.
  • Hybrid memory can use the configured embedding provider for local memory retrieval; if embedding is slow or unavailable, it falls back to text retrieval.
  • Use Settings -> Memory Summary or Inspect Memory to review stored snippets, prune, rebuild memory embeddings, or clear memory.

Local AI Setup

Ollama

  1. Install Ollama.
  2. Pull a chat model, for example:
ollama pull llama3.2
  1. Pull an embedding model, for example:
ollama pull nomic-embed-text
  1. In Settings, use:
http://localhost:11434

LM Studio, Jan, LocalAI, vLLM, or OpenAI-Compatible Servers

Use the server's OpenAI-compatible base URL, commonly:

http://localhost:1234/v1

Make sure the server exposes the endpoints needed for your selected role:

  • Chat/completions for answers.
  • Embeddings endpoint for semantic search.

Cloud Provider Setup

Enter API keys in Settings. Typical choices:

  • Anthropic Claude for answers.
  • OpenAI-compatible APIs for answers.
  • Voyage AI for embeddings.
  • OpenAI for embeddings.
  • Cohere for embeddings.

Provider detection helps identify some keys automatically. Custom endpoints can be set through the API URL field where supported.

Optional Dependencies

Optional packages are not required for basic search, but enable extra features.

Install into the correct Python environment:

  • Anki Python for in-process UI features.
  • External Python for Cross-Encoder re-ranking when configured.

Packages:

pip install sentence-transformers anthropic pyspellchecker

Feature mapping:

  • sentence-transformers: Cross-Encoder re-ranking.
  • anthropic: Anthropic streaming support.
  • pyspellchecker: spell check and right-click suggestions in the search box.

On Windows, using an external Python for sentence-transformers is recommended because torch can fail to load inside Anki's Python.

Privacy

What may be sent externally depends on your provider choices.

  • Local-only setup: if both answers and embeddings use a local server, note content stays on your machine.
  • Cloud embeddings: selected searchable note fields are sent to the embedding provider when building/searching embeddings.
  • Cloud answers: your query and selected matching note context are sent to the answer provider.
  • Local Memory: compact snippets from final answer context are stored locally for future retrieval planning. If hybrid memory is enabled with a cloud embedding provider, those snippets may be sent to that embedding provider to create memory vectors.

API keys are stored in config.json in the add-on folder. Do not share this file.

Logs and user data are stored under user_files/ where possible. Logs redact sensitive values.

Troubleshooting

Search finds nothing

  • Check Note Types & Fields.
  • Confirm the deck is included.
  • Rebuild embeddings after changing search scope.
  • Lower the minimum relevance threshold.
  • Try Hybrid (RRF).

Results look irrelevant

  • Use Note Types & Fields to limit searchable fields.
  • Enable Query Expansion for medical synonyms.
  • Enable Cross-Encoder re-ranking if installed.
  • Raise the Relevance Threshold for a stricter visible result set, or lower it to show more matches.
  • Review extra stop words.

Embeddings fail

  • Use Test Connection in Search & Embeddings.
  • Check API key or local server URL.
  • Confirm the embedding model exists.
  • For Ollama, pull the embedding model first.
  • If provider/model changed, rebuild embeddings.

Cross-Encoder is not ready

  • Set an external Python path.
  • Click Install / show command for external Python.
  • Run the shown command if needed.
  • Click Check again.

Text in Matching Notes runs together

The add-on formats note display text separately from search text so HTML blocks and selected fields remain readable in previews and tooltips. Reopen the search dialog or rerun the search after updating.

License

MIT

Credits

Author: Zahi-Essam

Built for medical and general Anki search workflows with semantic retrieval, local AI support, and cloud provider support.