Obsidian Spaced Repetition

repository·main·Indexed 24 days ago

https://github.com/st3v3nmw/obsidian-spaced-repetition

A plugin for Obsidian that implements spaced repetition algorithms (SM-2-OSR implemented, FSRS planned) to help users learn via flashcards and whole-note reviews. It supports various flashcard syntaxes, cloze deletions, and hierarchical deck organization using tags. Scheduling data is stored in HTML comments for cards and YAML frontmatter for notes.

Tokens
10.9K
Snippets
24
Records
74
Agent score
82%

What's inside obsidian-spaced-repetition

  1. Overview of Spaced Repetition features

    main

    The Obsidian Spaced Repetition plugin allows you to fight the forgetting curve by reviewing flashcards and notes directly within Obsidian.md.

    Core Capabilities:

    • Flashcards: Create and review individual flashcards using specific syntax (e.g., :: to separate questions and answers).
    • Notes: Review entire notes as part of a spaced repetition schedule.
    • Deck Management: Organize cards and notes into decks using Obsidian tags (e.g., #flashcards/science/physics).
    • Scheduling: The plugin uses repetition algorithms to determine when you should review specific content.
    • Data Storage: Scheduling information is stored within the markdown files themselves using HTML comments, ensuring your data stays with your notes.
  2. Important Constraints for Cloze Cards

    main

    When working with Cloze cards, keep these two rules in mind:

    1. No Mixing Types: You cannot mix different Cloze Types (e.g., Simplified and Classic) in the same note. They use different logic for sorting and identifying cards.
    2. Pattern Conflicts: When creating custom patterns, ensure they do not conflict with existing separators. For example, the Anki-like pattern {{[123::]answer[::hint]}} conflicts with the default single-line flashcard separator ::.
  3. Where plugin options and postponement lists are stored

    main

    The plugin persists configuration and certain runtime data in a file named data.json located within the plugin folder:

    • User Options: All settings configured via the plugin options menu.
    • Card Postponement List: A list of numeric hash codes ("fingerprints") representing cards reviewed today that have sibling cards buried until tomorrow. This list is only populated if the Bury sibling cards until the next day setting is enabled.
  4. Best practices for creating notes for spaced repetition

    main

    To maximize the effectiveness of spaced repetition within Obsidian, follow these principles for note creation:

    • Atomicity: Notes should be atomic, focusing on a single concept.
    • Linking: Notes should be highly linked to other concepts in your vault.
    • Understanding: Do not start reviewing a note until you have a proper understanding of the concept.
    • Feynman Technique: Reviews should be approached using the Feynman technique (explaining a concept in simple terms to ensure deep understanding).
  5. How scheduling information is stored for cards and notes

    main

    The plugin uses two primary methods for storing scheduling data, though the 'Individual Markdown Files' method is the current standard:

    1. For Cards: Scheduling data is stored in an HTML comment immediately following the card text. By default, this is on the line following the card. You can enable the Save scheduling comment on the same line as the flashcard's last line? option to keep it on the same line. Example comment format: <!--SR:!YYYY-MM-DD,ease,interval-->

    2. For Notes: Scheduling data is stored in the YAML frontmatter at the beginning of the Markdown file using specific keys.

    Note: A 'Single Scheduling File' implementation is currently a planned feature and is not yet available.

    <!--SR:!2024-08-16,51,230-->
    
    ---
    sr-due: 2024-07-01
    sr-interval: 3
    sr-ease: 269
    ---
  6. Understand the types of flashcards supported

    main

    The plugin supports two primary flashcard formats defined within standard Obsidian markdown files:

    1. Question & Answer: The flashcard text contains both the question and the answer.
    2. Cloze: The flashcard text identifies specific parts (words or phrases) to be hidden. These hidden parts are called cloze deletions. When the front of the card is shown, the deletions are hidden.

    Note: A markdown file must identify a deck to contain flashcards, but the file does not need to be tagged as a note.

  7. Use the Spaced Repetition Status Area

    main

    The status bar at the bottom of the Obsidian interface contains the Spaced Repetition Status Area. It displays a summary in the format Review: N note(s), where N is the total number of notes to review today (including both today's scheduled notes and overdue notes).

    Clicking this area will automatically open one of your notes for review.

  8. How SM-2-OSR calculates intervals and ease

    main

    The SM-2-OSR algorithm updates the interval and ease based on the user's review rating:

    RatingEase ChangeInterval Change
    easyIncreases by 20old_interval * new_ease / 100 * 1.3 (includes a 1.3 easy bonus)
    goodUnchangedold_interval * old_ease / 100
    hardDecreases by 20old_interval * 0.5 (the 0.5 multiplier is configurable in settings)

    Constraints & Details:

    • Minimum Ease: The minimum ease value is 130.
    • Link Contribution: The initial ease calculation uses link_contribution = max_link_factor * min(1.0, log(link_count + 0.5) / log(64)) to account for uncertainty in linked concepts.
  9. Understand the SM-2-OSR algorithm

    main

    The SM-2-OSR algorithm is the currently implemented scheduling formula. It is a variant of Anki's SM-2 algorithm and supports ternary reviews: hard, good, or easy.

    Key characteristics include:

    • Weighted Initial Ease: The initial ease of a note is calculated using a max_link_factor based on the average ease of linked notes, note importance (determined via PageRank), and a base ease.
    • Fuzzing: For intervals of 8 days or more, a small amount of random "fuzz" (up to 5% of the interval) is added or subtracted to prevent multiple cards from clustering on the same review day.
    • Storage: Scheduling data is stored directly in the note's YAML front matter.
  10. Implement Incremental Writing (Andy Matuschak style)

    main

    Incremental Writing is a method of managing a 'writing inbox' using spaced repetition. Instead of traditional flashcards, you review notes to decide how to evolve them.

    When reviewing notes in this workflow, you typically perform one of four actions (where x < y represents intervals):

    1. Skip note: Increase the interval for x (equivalent to marking as good).
    2. Work on it (fruitful): Decrease the interval (equivalent to marking as hard).
    3. Work on it (unfruitful): Increase the interval for y (equivalent to marking as easy).
    4. Convert to evergreen note: Stop using spaced repetition prompts for this note entirely.