Open-source FSRS Spaced Repetition Engine — the algorithm powering Quanta, the AI-powered STEM learning platform for students in the DACH region.
This is the complete spaced repetition engine extracted from Quanta. It implements the Free Spaced Repetition Scheduler (FSRS) by Ye et al. (2022, ACM KDD), with Quanta-specific extensions for STEM learning:
- FSRS Core — Stability (S), Difficulty (D), Retrievability (R) tracking per card
- STEM-Optimized Weights — Calibrated for academic MINT/STEM content (formulas, proofs, reaction mechanisms)
- Exam-Aware Scheduler — Multi-exam study plan generation with risk-based prioritization
- Interleaving Engine — Topic-interleaved card ordering (Rohrer & Taylor, 2007)
- Readiness Score — FSRS-derived exam readiness metric with confidence intervals
- Mastery Calculation — Per-topic mastery based on stability distribution + answer history
| Paper | Key Finding | How Quanta Uses It |
|---|---|---|
| Ye et al. 2022, ACM KDD | FSRS is 22% more precise than SM-2 (Log-Loss 0.35 vs 0.45) | Core scheduling algorithm |
| Karpicke & Roediger 2008, Science | Active Recall improves long-term retention by 50% vs re-reading | Q&A flashcard format |
| Rohrer & Taylor 2007 | Interleaving yields 63% vs 20% on delayed tests | interleaving.ts implementation |
| Ebbinghaus 1885 | Exponential forgetting curve: R(t) = 0.9^(t/S) | calculateRetrievability() |
src/
├── fsrs.ts # FSRS core: state updates, retrievability, grades
├── interleaving.ts # Topic-interleaved card ordering (Rohrer 2007)
└── engine/
├── types.ts # TypeScript interfaces for all engine types
├── scheduler.ts # Multi-exam study plan generator with FSRS simulation
├── readiness.ts # Exam readiness score (composite of mastery + coverage + trend)
└── mastery.ts # Per-topic mastery calculation from stability distribution
R(t) = 0.9^(t / S)
Where S = Stability (days until 90% recall probability), t = elapsed days.
S' = S × (1 + e^w8 × (11-D) × S^(-w9) × (e^(w10×(1-R)) - 1) × hard_penalty × easy_bonus)
S' = w11 × D^(-w12) × ((S+1)^w13 - 1) × e^(w14×(1-R))
D' = w7 × D0 + (1 - w7) × (D - w6 × (grade - 3))
- STEM-Calibrated Weights — The 17 default weights are optimized for academic STEM content, not casual vocabulary learning
- Exam-Aware Scheduling — The scheduler doesn't just schedule reviews; it generates multi-day study plans that adapt to exam dates, difficulty, and topic mastery
- Interleaving Built-In — Most FSRS implementations review one topic at a time. Quanta interleaves topics within study sessions (scientifically proven to improve transfer)
- Readiness Score — A novel composite metric that tells students whether they're exam-ready, combining mastery, coverage, trend, and time pressure
- Simulation-First Planning — The scheduler runs FSRS forward-simulations to allocate cards across future days
This engine powers Quanta — a STEM learning platform with:
- FSRS Spaced Repetition for Physics, Chemistry, Math, Biology, Medicine
- AI-powered flashcard generation (Gemini 2.5 Flash)
- LaTeX formula editor (KaTeX) and SMILES molecule builder
- Community deck library with education context filters (university, semester, federal state)
- Quality-controlled content with provenance certificates
MIT — use freely in your own learning apps. Attribution appreciated.
- Quanta Platform: quanta-study.de
- FSRS Paper: Ye et al. 2022, ACM KDD
- FSRS Community: open-spaced-repetition/fsrs4anki
- Quanta Community Decks: quanta-study.de/community