open-spaced-repetition/fsrs-rs

FSRS for Rust, including Optimizer and Scheduler

What it solves

It provides a high-performance Rust implementation of the Free Spaced Repetition Scheduler (FSRS), a modern algorithm used to optimize the timing of reviews for learning and memory retention. It allows developers to integrate advanced spaced repetition scheduling into their own applications without needing to rely on heavy external dependencies like libtorch.

How it works

The library implements the FSRS algorithm to calculate the next review date for a learning item based on a desired retention rate and the item's memory state. It includes tools to:

  • Schedule reviews: Calculate intervals and due dates based on previous review history and user ratings.
  • Optimize parameters: Use review logs to compute optimal weights for the FSRS model to fit a specific user's memory patterns.
  • Simulate: Run simulations to evaluate scheduling policies, including a specialized "Cost ADR" policy that balances review time costs against retention.
  • Migrate: Convert existing data from older SM-2 style spaced repetition systems.

Who it’s for

Developers building flashcard apps, learning management systems, or any software that requires a memory-based scheduling system for content review.

Highlights

  • Parameter Optimization: Ability to train and optimize FSRS parameters directly from a user's review history.
  • Cost ADR Policy: Includes a single-user optimizer for cost-conditioned desired-retention policies.
  • Cross-Language Support: Offers bindings for C, Python, Node.js, Dart, and PHP.
  • SM-2 Compatibility: Built-in functionality to migrate data from legacy SM-2 systems.

Related

  • Project
  • Project
  • Project
  • Project
  • Project