Skip to content

feat(reminders): add reminder system to perform long-term goals in the background #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 24, 2025

Conversation

mudler
Copy link
Owner

@mudler mudler commented May 22, 2025

This is an attempt to cover #128 and #72 . The idea is to have a set of actions to manage reminders (add, list and remove), and if the agent is enabled to perform background tasks, it will check the reminders periodically and fire new jobs.

Results are then returned to the user as new conversations with a summary of what was done.

mudler added 2 commits May 22, 2025 23:03
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
…tions

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@Copilot Copilot AI review requested due to automatic review settings May 22, 2025 21:05
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a reminder framework so the agent can schedule, list, and remove recurring or one-time jobs that run in the background, then report results back to the user.

  • Introduces new actions (set, list, remove reminders) and ties them into the action registry
  • Extends AgentSharedState with a reminder store and updates periodicallyRun to trigger and summarize reminders
  • Implements core reminder logic and CLI for actions in core/action/reminder.go

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
services/actions.go Registered new reminder actions in constants and builder
go.mod Added cron/v3 dependency for scheduling
core/types/state.go Defined ReminderActionResponse and added reminders to state
core/agent/templates.go Added reminderTemplate for reminder processing
core/agent/agent.go Implemented periodic reminder checks and summaries
core/action/reminder.go Created set, list, and remove reminder actions
Comments suppressed due to low confidence (2)

core/action/reminder.go:1

  • New reminder actions have no accompanying unit tests; consider adding tests for setting, listing, and removing reminders to validate cron parsing, state updates, and error cases.
package action

core/agent/agent.go:1028

  • [nitpick] There are large blocks of commented‐out code in periodicallyRun; consider removing or moving these to a design doc to keep the implementation focused and readable.
// TODO: Would be nice if we have a special action to

Comment on lines 105 to 106
// Add the reminder action
allActions = append(allActions, action.NewReminder())
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You register only the "set_reminder" action here but not the list or remove actions; append action.NewListReminders() and action.NewRemoveReminder() as well so those tools are available during planning.

Suggested change
// Add the reminder action
allActions = append(allActions, action.NewReminder())
// Add the reminder actions
allActions = append(allActions, action.NewReminder())
allActions = append(allActions, action.NewListReminders())
allActions = append(allActions, action.NewRemoveReminder())

Copilot uses AI. Check for mistakes.

2. A follow-up action that you decided to do later
3. A recurring task that needs periodic attention

Current Reminder: {{.Message}}
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template references {{.Message}} but renderTemplate doesn't supply a Message field in its execution context—either include Message or use an existing field like Reasoning.

Copilot uses AI. Check for mistakes.

Comment on lines 33 to 40
)

require github.com/JohannesKaufmann/dom v0.2.0 // indirect
require (
github.com/JohannesKaufmann/dom v0.2.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
)

require (
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] You have multiple require blocks—consider consolidating them into one to improve readability of module dependencies.

Copilot uses AI. Check for mistakes.

mudler added 6 commits May 23, 2025 22:52
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler mudler merged commit 9a90153 into main May 24, 2025
1 check failed
@mudler mudler deleted the feat/reminders branch May 24, 2025 20:15
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