Skip to content

AI-Anki: From a Lecture PDF to Spaced-Repetition Cards

AINewss Editorial

A source-checked look at 'AI-Anki', focused on the open-source project harjotst/ai-anki. Learn how it teaches before it generates cards, why re-exports are idempotent, what its measured caching findings were, and what the 0.20 dollar estimate actually covers. The article separates verifiable measurements from estimates and flags an Android release that is still absent.

View 1 reference
0 views 0 likes

Allow the functional cookie to save your likes. Privacy details

A study deck flowing from a lecture PDF into spaced-repetition flashcards

What does "AI-Anki" refer to?

AI-Anki is used by several unrelated GitHub projects, so scope matters. This article describes harjotst/ai-anki, an iPhone app that converts a lecture PDF, chapter, slide deck or spreadsheet into lessons and Anki flashcards, then keeps those cards current when the source changes.

The project README is the primary source for every claim below. Other repositories with similar names solve different problems, so check the owner before comparing tools.

Why teach a topic before generating cards?

Because drilling a card about something you never understood stores a wrong model in long-term memory, and the scheduler will faithfully keep it there. This project generates a lesson first: concepts in dependency order, a worked example, and the misconceptions people actually hold. Only then does it write reinforcing cards.

How does the deck plan work?

Pass one reads the whole document and proposes a plan you can edit before expensive generation runs. Topics become ::-nested Anki decks, each with a difficulty rating, a written reason, a note type and a card count reflecting what is worth remembering. You see the plan and its cost before approving it.

What happens when the lecture changes?

Most "PDF in, flashcards out" tools cannot be run twice. Re-importing after corrected slides duplicates everything and loses weeks of scheduling history. Here a Deck outlives the Jobs run against it: every card has a stable identity, the model declares which existing card a new one revises, and the server verifies that claim by fingerprint similarity before honouring it.

A card whose text has not changed is omitted from the export entirely. Anki never sees that note, so its scheduling, tags and leech flags survive untouched. The project tests the generated .apkg by importing it into a real Anki collection.

What did the author actually measure?

Four findings are reported as measurements. Pass one wrote a prompt-cache entry pass two could not read, because a different JSON schema creates a different cache lineage; pass one is now uncached. Five concurrent topic calls all missed the cache, so the first topic now runs alone: five topics in 11 seconds with one write and four reads.

Anki also silently ignores an export whose timestamp does not advance, and pg_dump refuses to dump a server newer than itself. The caching numbers were measured on Anthropic's API, which the project used until September 2026; the call ordering carries over to OpenAI, but the numbers were not re-measured there.

What does it cost to generate a deck?

At the model rates quoted in the README, a 200,000-token document planned into eight topics comes to roughly 0.20 US dollars for lessons and cards together. That is a documented estimate against a specific plan, not a price guarantee. Spend is bounded by a per-job token ceiling, rolling 24-hour budgets, a kill switch and a provider-side monthly cap.

How is the app built and where does it stand?

The phone app is Expo and React Native on TestFlight; the backend is FastAPI on Fly.io with Postgres and Supabase sign-in. Generation uses the OpenAI Responses API, and FSRS scheduling is rebuilt by replaying an append-only review log. The README reports 310 tests.

It says generation, lessons, in-app study, per-topic mastery and Anki import and export work end to end. An Android release and a tutor triggered by decaying review history are not built.

FAQ: common questions about AI-Anki

Can I use it today?

The backend is live and the iPhone app is in internal TestFlight, so general availability is limited. The repository is public if you want to read the design documents or run the test suite, which requires Docker for its containerised Postgres.

Does it replace Anki?

No. It exports to Anki rather than replacing it. The point of the stable card identities is that repeated exports update your existing collection instead of adding duplicates.

Is the cost estimate reliable?

It is an estimate tied to one document size, one topic count and the rates listed in the project's provider document. Actual cost depends on the plan you approve and on current model pricing, so read the figure as an example calculation.

How does the study loop fit together?

Generation is only the first half. The app teaches each topic, writes cards, schedules reviews with FSRS and rebuilds that schedule by replaying an append-only review log. The result is a study history you can reconstruct rather than a black-box score.

  1. Upload a source and approve or edit the proposed deck plan.
  2. Read the lesson for a topic, including the common misconceptions.
  3. Review the generated cards in the app, where FSRS chooses the next interval.
  4. Export to Anki; later exports update unchanged notes rather than duplicating them.
  5. When the source changes, generate again and let stable card identities preserve scheduling.

One design choice worth copying even outside this project is the separation between a Deck and the Jobs run against it. Most generation pipelines overwrite their output. Here the long-lived object is the deck, and each run is an event that may or may not change it. That distinction is what makes repeated generation safe.

Bottom line and limits

This project's distinctive contribution is the update model: cards keep identities across generations, so a revised lecture does not destroy review history. The evidence is unusually specific, but the app is still in testing and the caching numbers come from a provider it no longer uses. Verify the current README before acting on any figure.

References

  1. harjotst/ai-anki — README and measured findingsgithub.com