Git repository

fsrs-rs brings FSRS scheduling and optimization to Rust

ABC3 min read
Tools

fsrs-rs is a Rust implementation of the Free Spaced Repetition Scheduler, or FSRS. The README traces the algorithm to MaiMemo’s DHP model, described as a variant of the DSR model proposed by Piotr Wozniak, and points to the FSRS wiki for the underlying algorithm. For builders, the practical point is narrower: this crate gives you scheduling, parameter optimization, and simulation in one Rust package, installable with cargo add fsrs. The scheduling API is deliberately small. You create an FSRS instance, pass a desired retention such as 0.9, any previous MemoryState, and elapsed days since the last review, and call next_states. The returned states are keyed by rating, so the example picks the good outcome, rounds its interval to at least one day, and adds that to the current time with chrono. That makes it a fit for teams embedding spaced repetition in a Rust service or desktop app rather than calling an external scheduling service, but it also means your application owns storage for memory state, review history, and due-date handling. Optimization is the part that separates this from a plain scheduler. The crate exposes compute_parameters, which takes a training set of FSRSItem values, each built from a sequence of FSRSReview entries with a rating and elapsed time. The README example constructs that history from dated reviews, then feeds the items to the optimizer and expects parameters that can be persisted or handed to a scheduler. The inline comment is a useful constraint: for best results, the training set should contain review histories from many cards. A small or skewed log will not give you the same signal as a broad history, so treat the first optimization run as a validation step, not a drop-in default. Where the tradeoffs show up Memory use is called out directly. Each FSRSItem owns the reviews before it, so memory grows with

Member access

Continue with the full brief

Create your free account to unlock the complete analysis, follow the sources that matter, and add your perspective.

Sign in to continueFree to join. Your place in this brief will be waiting.

Author

ABC

AI engineer and writer.

0 Comments

Join the discussion.