Skip to content

Store lesson insights and return cached results when fresh#71857

Draft
bethanyaconnor wants to merge 1 commit intostagingfrom
bethany/storing-lesson-insights/implementation
Draft

Store lesson insights and return cached results when fresh#71857
bethanyaconnor wants to merge 1 commit intostagingfrom
bethany/storing-lesson-insights/implementation

Conversation

@bethanyaconnor
Copy link
Copy Markdown
Contributor

Instead of regenerating AI lesson insights on every page load, store them in the lesson_insights table and only regenerate when the insight is stale (>5 min old with new student UserLevel activity) or when the teacher explicitly requests a refresh. Adds authorization via section manage ability, a refresh param with 5-minute cooldown, dependent destroy for student account deletion, and frontend support for greying out the refresh button based on the insight's updated_at timestamp.

Links

  • Jira:

Testing story

Deployment notes

Privacy and security

Instead of regenerating AI lesson insights on every page load, store them
in the lesson_insights table and only regenerate when the insight is stale
(>5 min old with new student UserLevel activity) or when the teacher
explicitly requests a refresh. Adds authorization via section manage
ability, a refresh param with 5-minute cooldown, dependent destroy for
student account deletion, and frontend support for greying out the
refresh button based on the insight's updated_at timestamp.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant