AI Explainer

AnkiWeb addon 1870119736

Generates concise, exam-focused HTML explanations from selected card fields using OpenAI or Gemini, during review or batch, writing output to a chosen field.
AI-generated summary; may contain mistakes.

ainote-management

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
0 (👍 0 · 👎 0)
Updated
2026-01-11
Anki versions
23.10~
License
MIT (from the GitHub repository)
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

stale

  • Last update or commit: 2026-02-18 (256 days before the snapshot).
  • GitHub Actions workflows: 3.
  • The GitHub repo is shared with 1 other addon; its commits, issues and releases are not specific to this one.
  • Commits in the last year: 51.
  • Issues: 0 open, 1 closed.
  • Pull requests: 0 open, 6 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
23.10+2026-01-11
History across monthly snapshots

Loading…

Similar addons

AnkiExplain

Adds an Explain button and dockable sidebar that uses Gemini AI to generate flashcard explanations, mnemonics, related concepts, and follow-up chat, with streaming responses and customizable prompts.

aireview-flowshortcutsaccessibility

6 votes 61% approval 👍 6 · 👎 0 Anki 2.1.1~ Updated 2026-02-12
AI Language Explainer

Generates contextual written explanations and spoken audio for target words in sentence cards using OpenAI models and selectable TTS engines, with one-click or batch processing.

card-creationaisync-integrationdictionary

10 votes 72% approval 👍 10 · 👎 0 ⭐ 9 Anki 2.1.66~ Updated 2025-10-07
AI Card Explainer

Provides instant AI-generated explanations for flashcards via a keyboard shortcut or button, requiring a locally stored OpenAI API key at roughly one cent per hundred explanations.

aireview-flowshortcuts

2 votes 34% approval 👍 2 · 👎 0 Anki 2.1.1~ Updated 2025-11-17

Description




THIS ADDON WILL BE UPDATED AS ANOTHER ADDON,
AND WILL NO LONGER BE UPDATED ON THIS PAGE.

NEW ADDON → AI Explainer Enhanced


==================================================

Good cards ask questions — great cards also explain why.

Automatically add concise, exam-focused explanations to your existing Anki cards.
No rewriting, no clutter — just the context you actually need.

Key features

• Generates short explanations from your Q&A fields
• Works during review or in batch mode
• Supports OpenAI and Gemini (configurable)

How to use

Run it on the current card or on a batch selection; explanations are written to your chosen field.

Source code

GitHub: https://github.com/yuwayanagitani/anki-ai-explainer




==================================================

Manual

1. You can access to the config via "Tool" → "Add-ons" → "AI Tutor for Anki"

2. Here, you can select your preferable provider, and set your API key. (You can get the keys from provider's website. You don't have to input your keys if you already set them on your computer as envirnmental variables)



3. Here, You can specify the names of question and answer fields of your template. (Default is "Front", "Back", and "Explanation")



4. Here, You can select the language of explanation and explanation style.



5. Here, You can select how to add explanation to your field.

  • Append → If something is already written in the field, explanation will be added at the end of the existing one.
  • Overwrite → If something is already written, that will be overwritten by new explanation.



How to add new field to your template

1. This is how you can add new field (default for this add-on is "Explanation") to your card type.



2. And, This is how you can add the newly-added field to your template of that card type.



If you have any question, please ask me on the comment or GitHub.


==================================================

API Key Required

This add-on uses external AI services and requires your own API key.
Supported providers include OpenAI and Google Gemini.
No API key is included or provided by this add-on.

How to Set the API Key (Environment Variable)

The API key must be stored as an environment variable so that Anki can access it securely.

macOS
Run the following command in Terminal:
launchctl setenv OPENAI_API_KEY your_api_key_here
or for Gemini:
launchctl setenv GEMINI_API_KEY your_api_key_here
Restart Anki after setting the variable.

Note: On macOS, environment variables set with launchctl may be cleared after an OS reboot.
To avoid re-setting them every time, define the variables persistently using a LaunchAgent or your shell profile.

Windows

  1. Open "Environment Variables" from System Settings. (You can access it by searching "environment" in your start menu (windows button).
  2. Add a new user variable:
      Variable name: OPENAI_API_KEY or GEMINI_API_KEY
      Variable value: your_api_key_here
  3. Restart Anki after saving.

Once the environment variable is set, the add-on will automatically detect it on startup.


==================================================

Version Updade

  • Version 0.2.0 - Improve the prompt for the api. More coherent explanations will be responded. (2025-12-14)
  • Version 0.2.1 - FIxed bug on AI response html modificating function (2025-12-14)/li>
  • Version 0.3.0 - Multiple languages supported and general questions will be answered, not only medical questions (2025-12-15)
  • Version 0.3.1 - Improved the prompt for general questions. (2025-12-16)
  • Version 0.3.2 - More adhesive answers from AI. (2025-12-20)
  • Version 0.3.3 - This addon can generate even if only question or answer field is found. (2026-1-2)

==================================================

Supports

This tool is built to support medical students and residents.
Support via thumbing up 👍 on this page and Buy Me a Coffee ☕ motivates me a lot!!


README

Anki AI Explainer

Anki add-on that generates an HTML explanation for the current card (or for a batch of notes) using an LLM.

This add-on is designed to be simple and highly generic:

  • You can write any prompt you want (single “User prompt”).
  • You can choose any number of input fields to send to the model (no hard limit).
  • The add-on enforces that the model returns HTML only (to paste directly into an Anki field).
  • Prompts support:
    • {{fields}} : all selected fields concatenated as FieldName:\nvalue
    • {{FieldName}} : access an individual field value directly (e.g. {{Question}}, {{Answer}})

The add-on intentionally does not provide built-in settings like language, style, or length. Put those instructions in your prompt.


Features

  • Generate explanation for the current reviewer card (via shortcut / reviewer context menu)
  • Batch-generate explanations for notes matched by an Anki search query (Tools menu)
  • Flexible behavior when the destination field already has content:
    • Skip / Overwrite / Append (with custom separator)
  • Works with either:
    • OpenAI (Chat Completions API)
    • Google Gemini (Generative Language API)

Installation

From AnkiWeb

Install via AnkiWeb (recommended).
(AnkiWeb URL will be added after publishing.)

Manual install (GitHub)

  1. Download this repository as a zip
  2. Extract into your Anki add-ons folder:
    • Tools → Add-ons → View Files
  3. Restart Anki

Quick Start

  1. Open add-on settings: Tools → Add-ons → Anki AI Explainer → Config
  2. Set your provider and API key
  3. Choose:
    • Input fields you want the model to read (e.g. Question, Answer, Extra)
    • Explanation field to write the output to (default: Explanation)
  4. Write your User prompt
  5. Generate explanations:
    • In review: press the shortcut (default Ctrl+Shift+L)
    • Or: open reviewer “More…” menu → Generate AI Explanation
    • Or: Tools → AI Card Explainer: generate for search results

Prompt Placeholders

{{fields}}

Expands to all selected input fields, concatenated in order:

Example expansion:

Question:
What is ATP?

Answer:
Adenosine triphosphate

{{FieldName}}

Expands to the value of the individual field.

Example:

  • {{Question}} → value of the Question field
  • {{Answer}} → value of the Answer field

If a placeholder refers to a field that is missing/unavailable, it is replaced with an empty string.


Example Prompts

Minimal (recommended)

Explain the following Anki note in concise HTML.

{{fields}}

Q/A style

<p><b>Q:</b> {{Question}}</p>
<p><b>A:</b> {{Answer}}</p>

Requirements:
- HTML only
- No greetings
- Use <ul><li> for lists
- Highlight key words with <b>

Settings

Key settings (in config.json):

  • 01_provider: openai or gemini
  • 01_openai_api_key, 01_openai_model
  • 01_gemini_api_key, 01_gemini_model
  • 02_input_fields: array of field names to read (order matters)
  • 02_explanation_field: field name to write HTML output into
  • 03_user_prompt: your prompt template
  • 04_on_existing_behavior: skip / overwrite / append
  • 04_append_separator: used when appending
  • 05_max_notes_per_run: batch limit
  • 05_review_shortcut: reviewer shortcut

Notes / Safety

  • The add-on requests the model to return HTML only. Some models may still wrap output in Markdown fences (```html).
    The add-on attempts to strip a single surrounding fence to reduce friction.
  • Field values are passed to the model as-is (including any HTML contained in the note fields). Do not include sensitive data in notes if you do not want to send it to your provider.

License

MIT License