Spaced Repetition Skill (FSRS-6)
Adaptive flashcard review system using the FSRS-6 algorithm — the state of the
art in spaced repetition scheduling, backed by 130+ years of memory research.
Algorithm: FSRS (Free Spaced Repetition Scheduler) by Ye et al., 2024.
Open-source reference: open-spaced-repetition/py-fsrs (MIT).
Origin: Developed and refined through the Formation
Fellowship program. The author is not a representative of Formation.
Card File
Cards live in a user-specified markdown file. If not specified, ask once.
Card Format
Each card is a markdown section (### Title) with metadata:
CODEBLOCK0
FSRS fields:
- -
d = difficulty [1–10] (lower is easier) - INLINECODE2 = stability in days (≈ days until 90% recall probability)
- INLINECODE3 = total reviews
- INLINECODE4 = times forgotten (rated Again)
- INLINECODE5 /
next = last review date / scheduled next review
Rating scale:
- - 1 = "Didn't know it" (blanked or completely wrong)
- 2 = "Struggled" (got there but with significant difficulty or errors)
- 3 = "Got it" (recalled correctly with some effort)
- 4 = "Nailed it" (instant, effortless recall)
Review Methodology
Each review should cycle through multiple modes — not just recall:
- 1. Recall — Explain the approach without looking (mental rehearsal)
- Interrogate — Why this approach? Tradeoffs? What changes if requirements change?
- Rewrite — Code/apply it cold, timed. Notice hesitations.
- Retain — Revisit 48+ hours later. Can't reproduce cleanly? → Rate Again (1).
❌ Skipping post-recall phases = 80% effort for 50% results.
Priority guide:
- - P1: Fundamental, comes up everywhere. Review first.
- P2: Common pattern, transferable. Review second.
- P3: Good to know, niche. Skip if time-capped.
Scripts
All scripts in scripts/ — pure Python 3.6+, no external dependencies.
Check what's due
CODEBLOCK1
Submit a review
CODEBLOCK2
Run algorithm self-test
python scripts/fsrs.py
Handling User Requests
"What's due today?" / "Show my queue"
Run
due_cards.py. Present P1 cards prominently.
"I reviewed [card] — rated [X]"
Run
review.py. Show updated stability and next interval.
If they forgot (Again), normalize it — it's data, not failure.
"Add a new card for [topic]"
Insert a new section in their card file. Do NOT add the FSRS line — it
gets created automatically on first review.
Template:
CODEBLOCK4
"How is my retention?" / "Stats"
Parse card file and compute: strong cards (s>30d), struggling cards (lapses>0),
7-day review load forecast.
Interpreting FSRS Numbers (Advanced)
Most users don't need this — the system handles scheduling automatically. For the curious:
- - Stability (s): Days until ~90% recall. s=10 → review in ~10 days.
- Difficulty (d): 1=very easy, 10=very hard. Good cards converge to 3–6.
- After "Didn't know it": Stability drops sharply (e.g., 20d → 3d). Correct behavior.
- After "Nailed it": Stability grows fast. Use sparingly — only for instant recall.
- Key insight: At 90% retention target, interval ≈ stability.
Algorithm Reference
See references/fsrs-algorithm.md for full FSRS math, formulas, and default
weights. Algorithm paper: Ye et al., "A Stochastic Shortest Path Algorithm for
Optimizing Spaced Repetition Scheduling" (2024).
间隔重复技能(FSRS-6)
使用FSRS-6算法的自适应闪卡复习系统——间隔重复排程领域的先进技术,基于130多年的记忆研究成果。
算法: FSRS(自由间隔重复排程器),由Ye等人于2024年提出。开源参考:open-spaced-repetition/py-fsrs(MIT协议)。
起源: 通过Formation奖学金项目开发和完善。作者并非Formation的代表。
卡片文件
卡片存储在用户指定的Markdown文件中。若未指定,则询问一次。
卡片格式
每张卡片是一个带有元数据的Markdown章节(### 标题):
markdown
答案空间上的二分搜索
- - 优先级: P1
- 提示: 给定各种尺寸的物品和N个接收者,找出最大的份额,使每个人至少得到一个。方法?
- 答案: 在答案空间[1, max(items)]上进行二分搜索。可行性判断条件:sum(item // size for item in items) >= recipients。返回hi。
- 追问: 什么时候双指针法会胜过这个?什么使得判断条件是单调的?
- 何时使用: 在可行性检查的约束下最大化/最小化某个值——对答案进行二分搜索。
- FSRS: d=5.50 s=8.20 reps=3 lapses=0 last=2026-03-11 next=2026-03-19
- 历史记录: [2026-03-04 G=3(良好), 2026-03-09 G=1(再次), 2026-03-11 G=3(良好)]
FSRS字段:
- - d = 难度 [1–10](数值越低越容易)
- s = 稳定性(天数)(≈ 90%回忆概率对应的天数)
- reps = 总复习次数
- lapses = 遗忘次数(评为再次)
- last / next = 上次复习日期 / 计划下次复习日期
评分等级:
- - 1 = 不知道(完全空白或完全错误)
- 2 = 很吃力(最终答出但非常困难或有错误)
- 3 = 掌握了(经过一定努力正确回忆)
- 4 = 完美掌握(瞬间、毫不费力地回忆)
复习方法
每次复习应循环多种模式——而不仅仅是回忆:
- 1. 回忆 — 不看资料解释方法(心理演练)
- 追问 — 为什么用这个方法?权衡取舍?如果需求变化会怎样?
- 重写 — 限时从头编写/应用代码。注意犹豫之处。
- 巩固 — 48小时后重新回顾。无法完整复现?→ 评为再次(1)。
❌ 跳过回忆后阶段 = 80%的努力只换来50%的效果。
优先级指南:
- - P1:基础内容,随处可见。优先复习。
- P2:常见模式,可迁移。其次复习。
- P3:了解即可,小众。时间有限时可跳过。
脚本
所有脚本位于scripts/目录——纯Python 3.6+,无外部依赖。
查看到期卡片
bash
python scripts/due_cards.py ~/my-cards.md
python scripts/due_cards.py ~/my-cards.md --all # 包含即将到期的
python scripts/due_cards.py ~/my-cards.md --date 2026-03-20 # 提前规划
提交复习
bash
python scripts/review.py ~/my-cards.md 二分搜索 3
评分:1=不知道 2=很吃力 3=掌握了 4=完美掌握
运行算法自测
bash
python scripts/fsrs.py
处理用户请求
今天有哪些到期? / 显示我的队列
运行due_cards.py。突出显示P1卡片。
我复习了[卡片]——评分为[X]
运行review.py。显示更新后的稳定性和下次间隔。
如果他们忘记了(再次),将其正常化——这是数据,不是失败。
为[主题]添加新卡片
在卡片文件中插入新章节。不要添加FSRS行——它会在首次复习时自动创建。
模板:
markdown
[标题]
- - 优先级: [P1/P2/P3]
- 提示: [问题]
- 答案: [关键见解 + 方法]
- 追问: [权衡取舍?需求变化会怎样?]
- 何时使用: [触发该方法的模式/信号]
- 添加日期: [日期]
- 历史记录: []
我的记忆保持率如何? / 统计
解析卡片文件并计算:强卡片(s>30天)、困难卡片(lapses>0)、7天复习量预测。
解读FSRS数值(进阶)
大多数用户不需要这个——系统会自动处理排程。供好奇者参考:
- - 稳定性(s): 直到约90%回忆概率的天数。s=10 → 约10天后复习。
- 难度(d): 1=非常简单,10=非常困难。好的卡片会收敛到3–6。
- 不知道之后: 稳定性急剧下降(例如,20天→3天)。这是正确行为。
- 完美掌握之后: 稳定性快速增长。谨慎使用——仅用于瞬间回忆。
- 关键见解: 在90%记忆保持率目标下,间隔≈稳定性。
算法参考
完整FSRS数学公式、计算方法和默认权重请参见references/fsrs-algorithm.md。算法论文:Ye等人,一种用于优化间隔重复排程的随机最短路径算法(2024年)。