Model or dataset
thiswillbeyourgithub/AnkiAIUtils avatar
thiswillbeyourgithub/AnkiAIUtils

AnkiAIUtils: AI-Generated Explanations, Mnemonics and Illustrations for Failed Anki Cards

AI-powered tools to enhance Anki flashcards with explanations, mnemonics, illustrations, and adaptive learning for medical school and beyond

880 stars33 forksPythonAGPL-3.0

At a glance

What is it?
AnkiAIUtils is a set of Python scripts that write AI explanations, mnemonics and images into your Anki notes when you fail a card. It is built for self-hosted Anki users who are willing to run scripts, and the README itself warns the release was hasty.
Who is it for?
Adopt AnkiAIUtils if you already run Anki with AnkiConnect, are comfortable with Python and API keys, and want explanations, mnemonics and illustrations written into your own note fields. Do not adopt it if you need a click-to-install addon, a stable release, or a maintainer who has time to package one: the README asks for help turning these scripts into addons.
Can I use it commercially?
Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
Is it still maintained?
Yes. The repository last received commits 106 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What AnkiAIUtils does that Anki itself does not

Anki shows you a card, you grade it, and the scheduler decides when you see it again. The card text does not change. AnkiAIUtils targets exactly that gap: the README describes a workflow where every note you fail automatically gains new fields containing an explanation, a mnemonic and an illustration. The stated audience is medical students and anyone with dense factual cards, which matches the example the README gives, a French flashcard about the diagnostic criteria for simple febrile seizures. The project ships six top-level scripts: illustrator.py, explainer.py, mnemonics_creator.py, mnemonics_helper.py, reformulator.py and anchors_to_anki.py. Each one covers a different kind of card improvement rather than a single monolithic pipeline. The reformulator, for instance, rephrases cards that are poorly worded or whose phrasing no longer matches your preferred format, while mnemonics_helper.py exists to build and maintain a mnemonic library that the other tools then reuse.

How the scripts reach your notes: AnkiConnect, datasets and LiteLLM

The mechanism is file and API based, not an Anki addon. The requirements list py-ankiconnect, which means the scripts talk to a running Anki instance through the AnkiConnect addon rather than editing the collection file directly. The README says notes are modified in place, which is why it claims compatibility with Windows, Mac, Linux, Android and iOS clients: the change happens in the synced collection, so every client sees the new fields. Model calls go through litellm, so the same script can point at different providers and models without code changes. The README states the project is provider agnostic and supports all LLM providers and models through LiteLLM. Image generation is narrower: illustrator.py supports DALL-E2, DALL-E3 and Stable Diffusion, and requirements.txt pins stability-sdk for the latter. Two more pieces shape the data flow. First, examples/ holds dataset files such as explainer_dataset.txt, mnemonics_dataset.txt and illustrator_dataset.txt. The README describes adaptive learning through semantic similarity: your cards are matched against the most relevant examples in those datasets, so adding examples changes what the model sees. scikit-learn and rapidfuzz in requirements.txt are consistent with that matching and fuzzy text work. Second, the README states the tools respect your own mnemonics and can use the major system, which is why a separate anchors file exists: examples/anchors.json and anchors_to_anki.py suggest phonetic anchors are stored as data and pushed into Anki as fields.

Installing AnkiAIUtils and preparing a first real run

There is no packaged addon and no release artifact, so installation means cloning the repository and installing its Python dependencies. The README does not give a pip install line for the project itself, so the steps below stay at the level the repository files support: install from requirements.txt, then run a script. The comment inside requirements.txt is worth reading before you start, because the stability-sdk line is the one most likely to fail on a plain machine.

bash
git clone https://github.com/thiswillbeyourgithub/AnkiAIUtils
cd AnkiAIUtils
pip install -r requirements.txt

The scripts expect a running Anki with the AnkiConnect addon, since py-ankiconnect is the bridge. The repository also ships examples/anki_ai_utils_tmux_launcher.sh, which the README does not document in detail, so treat it as a starting point to read rather than a supported entry point. Before running anything against your real collection, check what fields the script will write to: the README's own example output shows a generated image plus a text block that records the topic, anchors, phonetic hints, a step-by-step decomposition and a trailing metadata line with date, version, LLM model and image model. That metadata line is useful for rollback, because it tells you which model produced a given field. The scripts are built on the fire package, listed in requirements.txt, which turns Python functions into command line commands, so the available subcommands come from the source rather than from a fixed documented interface. Start with one note, confirm the new field appears in Anki, then widen the run.

Where AnkiAIUtils breaks or is the wrong choice

The README contains an unusually direct warning from the author: the scripts were released hastily after heavy documentation with aider, some documentation may be slightly off, and some scripts may have been slightly broken during the release process. Take that at face value. This is not a project with a versioned release you can pin; the repository has no releases retrieved, so you are tracking the default branch. The second limitation is structural. Because the tools write into note fields, they consume field slots and change note types. If your collection is shared, or if you sync to a phone where the extra fields make cards render badly, the benefit shrinks. The README claims images are formatted for optimal display, centered and properly sized, but that formatting is applied to the generated image, not to your card template, so you still have to place the field in the template yourself. Third, every run costs money at your LLM and image provider, and the README's example output shows gpt-4-0125-preview and dall-e-3, which are paid endpoints. Fourth, the semantic matching depends on dataset quality. The README says the more examples you add the better it gets, which is also a statement that an empty or mismatched dataset produces weak results. If you want a tool that works with no API key, no Python and no field changes, this is the wrong project.

AnkiAIUtils versus building your own AnkiConnect script

The closest realistic alternative is not another product but your own script: AnkiConnect exposes an HTTP API, and a short Python file can fetch notes you failed and append text from any model. That approach gives you full control over field names, prompts and cost. What AnkiAIUtils adds on top is the parts that are tedious to write: dataset-driven example selection by semantic similarity, a mnemonic library that persists across cards so the same concept keeps the same hook, a mnemonic creation tool, image history, and a multi-step image prompt pipeline that decomposes a card into anchors, phonetic links and a scene description before calling the image model. The README's febrile seizure example shows that decomposition output explicitly. If your cards are simple vocabulary and you only want a one-line explanation, a personal script is less machinery. If your cards are dense clinical criteria and you want consistent visual hooks, the dataset and mnemonic-library machinery is the reason to use this instead. The other axis is packaging: an Anki addon would install from within Anki and need no terminal, and the README explicitly asks readers to help package these scripts into addons, so that option does not exist here yet.

Maintenance, licence and the cost of upgrading

The repository is not archived, and the last push was on 2026-06-01. That is roughly three and a half months before today, so it is recent enough that the project has not gone quiet, but there is no release history to upgrade between: you pull the default branch and take whatever changed. The practical upgrade cost sits in three places. Dependencies move, and requirements.txt pins minimum versions with >= rather than exact versions, so a fresh install can pull newer litellm, scikit-learn or stability-sdk than the author ran. Provider APIs move too, and since model names appear in prompts and logs, a deprecated model string can break a run without any code change in this repository. Finally, the README's own note that some scripts may have been broken at release means you should keep a copy of your collection before the first real run. The licence is AGPL-3.0. For a user running the scripts locally on their own Anki collection, that is the ordinary case. If you modify the scripts and let other people interact with them over a network, the AGPL's network clause is the part to read with a lawyer, because it is broader than a permissive licence. Nothing here is legal advice.

Editorial conclusion

Adopt AnkiAIUtils if you already run Anki with AnkiConnect, are comfortable with Python and API keys, and want explanations, mnemonics and illustrations written into your own note fields. Do not adopt it if you need a click-to-install addon, a stable release, or a maintainer who has time to package one: the README asks for help turning these scripts into addons. Before committing, verify that your Anki notes have free fields for the generated content, that the fields are not synced in a way that breaks your other clients, and that the scripts still run against your current AnkiConnect version, since the README states some scripts may have been slightly broken during the release process.

Frequently asked questions

Is AnkiAIUtils an Anki addon I can install from inside Anki?

No. The repository is a set of Python scripts that talk to Anki through AnkiConnect, and the README asks readers to help package the scripts into addons. Installing it means cloning the repository and installing requirements.txt.

Which AI providers and image models does AnkiAIUtils support?

The README states the project is provider agnostic and supports all LLM providers and models through LiteLLM. For images, illustrator.py supports DALL-E2, DALL-E3 and Stable Diffusion.

Does AnkiAIUtils overwrite my existing Anki cards?

The README says notes are modified in place, adding new fields for explanations, mnemonics and illustrations. It also states there is extensive logging so you can track changes and roll back if needed.

Can AnkiAIUtils reuse the mnemonics I already use?

Yes. The README describes personalized memory hooks that reuse consistent mnemonics from your custom collection, and there is a dedicated tool plus an anchors file for creating and managing that mnemonic library.

Is AnkiAIUtils stable enough for a large medical school deck?

The README warns that the scripts were released hastily, that some documentation may be imprecise, and that some scripts may have been slightly broken during the release process. Test on a small subset and keep a backup before running it across a full deck.

Official sources

  1. Issues
  2. License: AGPL-3.0
  3. README
  4. thiswillbeyourgithub/AnkiAIUtils on GitHub
Community notes

Community notes