fsrs4anki
A modern Anki custom scheduling based on Free Spaced Repetition Scheduler algorithm
Top Related Projects
AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
Quick Overview
FSRS4Anki is an implementation of the Free Spaced Repetition Scheduler (FSRS) algorithm for Anki, a popular flashcard application. It aims to improve the scheduling of flashcards for more efficient learning and memory retention by using a machine learning model to predict the optimal review intervals.
Pros
- Implements an advanced spaced repetition algorithm (FSRS) for potentially more effective learning
- Integrates seamlessly with Anki, a widely-used flashcard application
- Provides customizable parameters for fine-tuning the scheduling behavior
- Includes tools for analyzing and visualizing review data
Cons
- Requires some technical knowledge to set up and configure
- May have a learning curve for users accustomed to Anki's default scheduler
- Potential for over-optimization, which could lead to less natural learning patterns
- Limited compatibility with older versions of Anki
Code Examples
# Example 1: Creating an FSRS object
from fsrs import FSRS, Card, ReviewLog
fsrs = FSRS()
card = Card(due=0)
This code initializes an FSRS object and creates a new card with a due date of 0.
# Example 2: Simulating a review
now = 1600000000
result = fsrs.repeat(card, now)
new_card, review_log = result.card, result.review_log
This example simulates a card review at a specific timestamp and returns the updated card state and review log.
# Example 3: Customizing FSRS parameters
custom_fsrs = FSRS(
request_retention=0.9,
maximum_interval=36500,
w=[0.4, 0.6, 2.4, 5.8, 4.93, 0.94, 0.86, 0.01, 1.49, 0.14, 0.94, 2.18, 0.05, 0.34, 1.26, 0.29, 2.61]
)
This code creates an FSRS object with custom parameters, including desired retention rate, maximum interval, and weight values for the algorithm.
Getting Started
To use FSRS4Anki:
- Install Anki 2.1.45+ and the FSRS4Anki add-on from the AnkiWeb page.
- In Anki, go to Tools > Add-ons > FSRS4Anki > Config to customize settings.
- Create or import a deck and start reviewing cards.
- (Optional) Use the provided analysis tools to visualize your review data:
from fsrs4anki_analyzer import FSRSAnalyzer
analyzer = FSRSAnalyzer()
analyzer.plot_retention_curve()
analyzer.plot_difficulty_distribution()
These steps will get you started with using FSRS4Anki in your Anki studies.
Competitor Comparisons
AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
Pros of Anki-Android
- Full-featured mobile app for Anki, providing a complete spaced repetition experience on Android devices
- Syncs with AnkiWeb, allowing seamless integration with the desktop version of Anki
- Large user base and active community support
Cons of Anki-Android
- Limited customization options for the spaced repetition algorithm
- Potentially overwhelming interface for new users due to the wide range of features
Code Comparison
FSRS4Anki (Python):
def init_model(self):
self.w = [1, 1, 5, -0.5, -0.5, 0.2, 1.4, -0.12, 0.8, 2, -0.2, 0.2, 1]
self.theta = [0.4, 0.6, 2.4, 5, 0.5, 1.0, 1.2, 0.8, 2.0, 0.3, 1.5]
Anki-Android (Java):
public class Scheduler {
private static final int LEARNING_STEPS = 3;
private static final int GRADUATING_INTERVAL = 1;
private static final int EASY_INTERVAL = 4;
private static final int INITIAL_EASE = 2500;
}
The code snippets show different approaches to implementing spaced repetition algorithms. FSRS4Anki uses a more complex model with weights and parameters, while Anki-Android employs a simpler scheduling system with fixed intervals and ease factors.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
FSRS4Anki
⨠A modern spaced-repetition scheduler for Anki based on the Free Spaced Repetition Scheduler algorithm â¨
611Study.ICU
Hi, I'm Jarrett Ye, the creator of FSRS. FSRS is a highly efficient spaced repetition algorithm used by many people worldwide, saving considerable time. It applies cognitive science and educational technology to help students learn more effectively.
However, most Chinese high school students are still forced to study "611" - from 6 AM to 11 PM, six days a week. Tragically, many students have committed suicide or developed serious mental health issues.
The 611Study.ICU project aims to stop this abusive study model and protect students' lives and health.
As a former Chinese student, I experienced overtime study and sleep deprivation during high school. Anki saved my life. I want to use this algorithm to save more lives, but most Chinese high schools still prevent students from using it.
I hope this project can raise awareness and help more students.
Table of contents
- Introduction
- How to Get Started?
- Add-on Compatibility
- Contribute
- Developer Resources
- Stargazers Over Time
Introduction
FSRS4Anki consists of two main parts: the scheduler and the optimizer.
- The scheduler replaces Anki's built-in scheduler and schedules the cards according to the FSRS algorithm.
- The optimizer uses machine learning to learn your memory patterns and finds parameters that best fit your review history. For details about the working of the optimizer, please read the mechanism of optimization.
For details about the FSRS algorithm, please read the algorithm. If you are interested, you can also read my papers:
- A Stochastic Shortest Path Algorithm for Optimizing Spaced Repetition Scheduling (free access), and
- Optimizing Spaced Repetition Schedule by Capturing the Dynamics of Memory (Google Scholar).
FSRS4Anki Helper is an Anki add-on that complements the FSRS4Anki Scheduler. You can read about it here: https://github.com/open-spaced-repetition/fsrs4anki-helper
How to Get Started?
If you are using Anki v23.10 or newer, refer to this tutorial.
If you are using an older version of Anki, refer to this tutorial.
Note that setting up FSRS is much easier in Anki v23.10 or newer.
Add-on Compatibility
Some add-ons can cause conflicts with FSRS. As a general rule of thumb, if an add-on affects a card's intervals, it shouldn't be used with FSRS.
Add-on | Compatible? | Comment |
---|---|---|
Review Heatmap | Yes :white_check_mark: | Doesn't affect anything FSRS-related. |
Advanced Browser | Yes :white_check_mark: | Please use the latest version. |
Advanced Review Bottom Bar | Yes :white_check_mark: | Please use the latest version. |
The KING of Button Add-ons | Yes :white_check_mark: | Please use the latest version. |
Pass/Fail | Yes :white_check_mark: | Pass is the equivalent of Good , Fail is the equivalent of Again. |
AJT Card Management | Yes :white_check_mark: | Compatible with Anki 23.12 and newer. |
Incremental Reading v4.11.3 (unofficial clone) | Unsure :question: | If you are using the standalone version of FSRS, it shows the interval given by Anki's built-in scheduler, not the custom scheduler. This add-on is technically compatible with built-in FSRS, but FSRS was not designed for incremental reading, and FSRS settings do not apply to IR cards because they work in a different way compared to other card types. |
Delay siblings | No :x: | Delay siblings will modify the intervals given by FSRS. However, the FSRS4Anki Helper add-on has a similar feature that works better with FSRS. Please use the FSRS4Anki Helper add-on instead. |
Auto Ease Factor | No :x: | The Ease Factor is no longer relevant when FSRS is enabled, therefore you won't benefit from using this add-on. |
autoLapseNewInterval | No :x: | The New Interval setting is no longer relevant when FSRS is enabled, therefore you won't benefit from using this add-on. |
Straight Reward | No :x: | The Ease Factor is no longer relevant when FSRS is enabled, therefore you won't benefit from using this add-on. |
Let me know via issues if you want me to check compatibility between FSRS and some add-on.
Contribute
You can contribute to FSRS4Anki by beta testing, submitting code, or sharing your data. If you want to share your data with me, please fill out this form: https://forms.gle/KaojsBbhMCytaA7h8
Contributors
Expertium â ï¸ ð ð£ ð¤ ð |
user1823 â ï¸ ð ð£ ð¤ ð |
Christos Longros ð£ ð |
Developer Resources
If you're a developer considering using the FSRS algorithm in your own projects, we've curated some valuable resources for you. Check out the Awesome FSRS repository, where you'll find:
- FSRS implementations in various programming languages
- Related papers and research
- Example applications using FSRS
- Other algorithms and resources related to spaced repetition systems
This carefully curated list will help you better understand FSRS and choose the right implementation for your project. We encourage you to explore these resources and consider contributing to the FSRS ecosystem.
Stargazers Over Time
Top Related Projects
AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot