For each learnable item, store: item_id, user_id, ease_factor (a float representing difficulty, starting around 2.5), interval_days (days until next review), repetition_count, and next_review_date
After each review, apply the SM-2 algorithm: if the user's performance score (0-5) is below 3, reset interval to 1 day and repetition_count to 0; otherwise calculate new_interval = previous_interval * ease_factor, and update ease_factor = ease_factor + (0.1 - (5 - score) * (0.08 + (5 - score) * 0.02))
Clamp ease_factor to a minimum of 1.3 to prevent intervals from collapsing to near-zero for consistently difficult items
Set next_review_date = today + new_interval_days and persist the updated record
At session start, query for all items where next_review_date <= today for the user, prioritizing items with the oldest next_review_date to handle overdue cards first
Known gotchas
Storing next_review_date as a server-side UTC datetime is critical for multi-timezone users; computing 'today' in the user's local timezone at query time avoids items appearing a day early or late
The SM-2 algorithm was designed for vocabulary recall; applying it unchanged to procedural skills (e.g., math problems) without adjusting the performance score rubric leads to miscalibrated intervals
Unbounded interval growth can schedule a card years in the future after only a few correct answers; many implementations cap the interval at 365 days or use a graduated leech threshold to flag items that keep being reset
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp