Skip to content

Feat/spaced repetition 2279 - #2284

Merged
KaranUnique merged 2 commits into
Canopus-Labs:featurefrom
Vachhani-Tapan:feat/spaced-repetition-2279
Aug 31, 2026
Merged

Feat/spaced repetition 2279#2284
KaranUnique merged 2 commits into
Canopus-Labs:featurefrom
Vachhani-Tapan:feat/spaced-repetition-2279

Conversation

@Vachhani-Tapan

Copy link
Copy Markdown
Contributor

📝 Pull Request Description

Related Issue

Closes #2279

Summary

This PR implements the SuperMemo-2 (SM-2) algorithm to optimize user study sessions and flashcard retention. Instead of random selection, the backend now utilizes a RepetitionState model to dynamically schedule the optimal next review date based on a user's grade. A daily CRON job aggregates and queries for "due" cards, significantly increasing overall learning efficiency.


Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature
  • ♻️ Refactoring
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • 🔥 Other(please describe) ______

How Has This Been Tested?

  • Deployed the Express backend and verified that the simulated daily CRON job loops reliably and successfully performs the mongoose query for $lte: today on the nextReviewDate.
  • Unit tested the SM-2 utility to verify that a high grade (e.g., 4 or 5) correctly multiplies the interval based on the easinessFactor, while a low grade (e.g., 1 or 2) safely resets the repetitions state back to zero for immediate relearning.

Screenshots (if applicable)

N/A - Backend algorithmic enhancement.


Checklist

  • My code follows the project's guidelines
  • I have tested my changes
  • I have updated documentation where necessary
  • I have linked the related issue
  • My changes do not introduce new warnings or errors

@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request, @Vachhani-Tapan! 🙌
We'll review it as soon as possible.
If there are any specific instructions or feedback regarding your PR, we'll provide them here.
Thanks again for your contribution to our project! 😊

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 54 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a8c4b234-dd2c-467b-b18c-e81ab392cd21

📥 Commits

Reviewing files that changed from the base of the PR and between 420348a and 5c509f0.

📒 Files selected for processing (5)
  • backend/controllers/audioPipelineController.js
  • backend/models/RepetitionState.js
  • backend/server.js
  • backend/utils/sm2.js
  • frontend/src/hooks/useAudioPipeline.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the merge ready PR is mergeable and has no conflicts label Aug 30, 2026
@KaranUnique
KaranUnique changed the base branch from main to feature August 31, 2026 05:42
@KaranUnique
KaranUnique merged commit 213f5ab into Canopus-Labs:feature Aug 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Spaced Repetition Algorithm Engine

2 participants