Releases: Mkrolick/Anki-Plugin
v0.1.0 — Smart Grader + Book to Cards
First tagged release of the Anki-Plugin repo. Two add-ons, both buildable from source via ./build.sh.
Install
Download the .ankiaddon files below, then in Anki: Tools → Add-ons → Install from file…, pick the file. Restart Anki. Set your OpenAI API key in each add-on's Config.
What's in this release
smart_grader
Typed-answer grading on cards with a Keywords field. On submit:
- Strict AND keyword check (case-insensitive, word boundaries).
- Cosine similarity between user-answer embedding and reference embedding.
- Compared against a per-card calibrated threshold.
- Shows pass/fail + word-level diff + similarity number.
Calibration (Tools menu, on selected notes) asks GPT for 12 "good" paraphrases and 6 "bad" near-misses, embeds them all, and fits a threshold so good paraphrases land above and bad ones below. Keywords are AI-generated if the field is empty. The reference embedding is stored on the note so review embeds only the user's answer.
JS injection now happens via mw.reviewer.web.eval() in reviewer_did_show_question (modern Anki strips <script> tags from card HTML).
book_to_cards
PDF → Anki flashcards via a four-stage pipeline.
- Extract — pdfminer.six (vendored) pulls text per page.
- Map — sliding 5-page chunks with 1-page overlap; one LLM call per chunk returns
{text, quote, topic, source_pages}per noteworthy fact. Source pages are forced to the chunk's actual page list (the LLM's returned indices were unreliable). - Merge — embedding-based topic clustering (cosine threshold 0.25), no LLM calls.
- Reduce — per canonical topic, one LLM call produces 0-5 atomic flashcards. Prompt now includes the full text of every page touched by the topic's aspects as context, plus the verbatim quotes as the actual evidence.
- Calibrate — runs in a worker thread with
ThreadPoolExecutor(default 8 parallel). Embeddings are batched: 19 calls per card collapsed to 1. - Insert — main thread, fast: writes pre-computed calibration data to each new note.
The new pre-calibrate stage means Anki's main thread is never blocked during card generation. Resumable across all five stages via JSON checkpoints in the addon's user_files/<book_hash>/.
End-to-end verified on Baudrillard's Simulacra and Simulation (172 pages):
- 320 atomic flashcards in the deck after Anki's dedup
- ~16 minutes wall-clock total
- ~$0.50 in OpenAI charges
- 4-6× speedup on calibration vs the original serial implementation
Tests
36 unit tests pass; 1 skipped (the deck-writer test needs Anki's bundled Python).
Spec & plan
docs/superpowers/specs/2026-05-22-book-to-cards-design.mddocs/superpowers/plans/2026-05-22-book-to-cards.mddocs/superpowers/reports/2026-05-22-book-to-cards-smoke.mddocs/superpowers/reports/2026-05-22-baudrillard-real-book-run.md