Tech News
← Back to articles

Hashcards: A plain-text spaced repetition system

read original related products more articles

hashcards is a local-first spaced repetition app, along the lines of Anki or Mochi. Like Anki, it uses FSRS, the most advanced scheduling algorithm yet, to schedule reviews.

The thing that makes hashcards unique: it doesn’t use a database. Rather, your flashcard collection is just a directory of Markdown files, like so:

Cards/ Math.md Chemistry.md Astronomy.md ...

And each file, or “deck”, looks like this:

Q: What is the role of synaptic vesicles? A: They store neurotransmitters for release at the synaptic terminal. Q: What is a neurite? A: A projection from a neuron: either an axon or a dendrite. C: Speech is [produced] in [Broca's] area. C: Speech is [understood] in [Wernicke's] area.

You write flashcards more or less like you’d write ordinary notes, with lightweight markup to denote basic (question/answer) flashcards and cloze deletion flashcards. Then, to study, you run:

$ hashcards drill

This opens a web interface on localhost:8000 , where you can review the flashcards. Your performance and review history is stored in an SQLite database in the same directory as the cards. Cards are content-addressed, that is, identified by the hash of their text.

This central design decision yields many benefits: you can edit your flashcards with your editor of choice, store your flashcard collection in a Git repo, track its changes, share it on GitHub with others (as I have). You can use scripts to generate flashcards from some source of structured data (e.g. a CSV of English/French vocabulary pairs). You can query and manipulate your collection using standard Unix tools, or programmatically, without having to dig into the internals of some app’s database.

Why build a new spaced repetition app? Mostly because I was dissatisfied with both Anki and Mochi. But also, additionally, because my flashcards collection is very important to me, and having it exist either in some remote database, or as an opaque unusable data blob on my computer, doesn’t feel good. “Markdown files in a Git repo” gives me a level of ownership that other approaches lack.

... continue reading