Decision: SRS algorithm — SM-2, FSRS, or custom variant? #8

Closed
opened 2026-08-20 14:34:32 +02:00 by gaetan · 1 comment
Owner

Part of #1

Question

Which spaced repetition algorithm should power the review scheduling?

The content model is settled (Q&A + Vrai/Faux, SM-2 fields in the DB), so we can now choose the algorithm.

Options:

  • SM-2 — The original Anki algorithm. Simple, well-understood, 5 rating buttons (Again, Hard, Good, Easy). Proven effective. ~50 lines of code.
  • FSRS (Free Spaced Repetition Scheduler) — Anki's newer ML-based algorithm. Better interval distribution, fewer reviews needed. More complex (~200+ lines), needs parameter training.
  • Custom simplified SM-2 — SM-2 with fewer ratings (e.g. 3 buttons: Wrong, Okay, Easy). Simpler UI but less granular scheduling.
  • SuperMemo 2 variant — SM-2 with adjustments (e.g. different ease factor decay, different interval multipliers).

Key considerations:

  • The rating mechanism (how the user signals recall quality) is tightly coupled to the algorithm
  • SM-2 uses 4 ratings (Again=1, Hard=2, Good=3, Easy=4) mapped to the algorithm's parameters
  • FSRS uses 4 ratings but interprets them differently (probability of recall)
  • A 3-button rating (Wrong/Okay/Right) is simpler but less precise

This decision shapes the review UI (rating buttons) and the scheduling logic.

Dependencies

  • Depends on: #4 Tech stack (framework choice affects implementation)
Part of #1 ## Question Which spaced repetition algorithm should power the review scheduling? The content model is settled (Q&A + Vrai/Faux, SM-2 fields in the DB), so we can now choose the algorithm. Options: - **SM-2** — The original Anki algorithm. Simple, well-understood, 5 rating buttons (Again, Hard, Good, Easy). Proven effective. ~50 lines of code. - **FSRS (Free Spaced Repetition Scheduler)** — Anki's newer ML-based algorithm. Better interval distribution, fewer reviews needed. More complex (~200+ lines), needs parameter training. - **Custom simplified SM-2** — SM-2 with fewer ratings (e.g. 3 buttons: Wrong, Okay, Easy). Simpler UI but less granular scheduling. - **SuperMemo 2 variant** — SM-2 with adjustments (e.g. different ease factor decay, different interval multipliers). Key considerations: - The rating mechanism (how the user signals recall quality) is tightly coupled to the algorithm - SM-2 uses 4 ratings (Again=1, Hard=2, Good=3, Easy=4) mapped to the algorithm's parameters - FSRS uses 4 ratings but interprets them differently (probability of recall) - A 3-button rating (Wrong/Okay/Right) is simpler but less precise This decision shapes the review UI (rating buttons) and the scheduling logic. ## Dependencies - Depends on: #4 Tech stack (framework choice affects implementation)
gaetan self-assigned this 2026-08-20 14:47:44 +02:00
Author
Owner

Resolution

SRS algorithm decided:

Algorithm: SM-2 (Anki's original). ~50 lines of code. Proven, simple, adequate for 100-200 cards.

Rating buttons: 4 buttons (Again=red, Hard=orange, Good=blue, Easy=green) + keyboard shortcuts (1=Again, 2=Hard, 3=Good, 4=Easy). Review a card in under 3 seconds.

SM-2 parameters:

  • Initial interval: 1 day (after first "Good")
  • Interval cap: 30 days (for "Good" rating)
  • After 30 days: intervals grow by ease_factor * previous_interval
  • Ease factor: starts at 2.5, adjusted per answer
  • Lapse (Again on known card): reset repetitions to 0, interval to 0 (review again today)
  • New card limit: max 10 new cards per day

SM-2 formula:

new_interval = old_interval * ease_factor * adjustment
adjustment: Again=0, Hard=1.2, Good=2.5, Easy=4.0
ease_factor = ease_factor + (0.1 - (5 - rating) * (0.08 + (5 - rating) * 0.02))

Review flow:

  1. Query cards where next_review <= now (due cards)
  2. Prioritize: new cards first, then reviews by next_review ascending
  3. Show card → reveal answer → rate → update progress → next card
  4. When all due cards reviewed, show dashboard
## Resolution SRS algorithm decided: **Algorithm**: SM-2 (Anki's original). ~50 lines of code. Proven, simple, adequate for 100-200 cards. **Rating buttons**: 4 buttons (Again=red, Hard=orange, Good=blue, Easy=green) + keyboard shortcuts (1=Again, 2=Hard, 3=Good, 4=Easy). Review a card in under 3 seconds. **SM-2 parameters**: - Initial interval: 1 day (after first "Good") - Interval cap: 30 days (for "Good" rating) - After 30 days: intervals grow by `ease_factor * previous_interval` - Ease factor: starts at 2.5, adjusted per answer - Lapse (Again on known card): reset repetitions to 0, interval to 0 (review again today) - New card limit: max 10 new cards per day **SM-2 formula**: ``` new_interval = old_interval * ease_factor * adjustment adjustment: Again=0, Hard=1.2, Good=2.5, Easy=4.0 ease_factor = ease_factor + (0.1 - (5 - rating) * (0.08 + (5 - rating) * 0.02)) ``` **Review flow**: 1. Query cards where `next_review <= now` (due cards) 2. Prioritize: new cards first, then reviews by next_review ascending 3. Show card → reveal answer → rate → update progress → next card 4. When all due cards reviewed, show dashboard
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
gaetan/knowledgify#8
No description provided.