Skip to main content

Module reminders

Module reminders 

Source
Expand description

System reminder infrastructure for agent guidance.

This module implements the <system-reminder> pattern used by Anthropic’s Claude SDK. System reminders provide contextual hints to the AI agent without cluttering the main conversation. Claude is trained to recognize these tags and follow the instructions inside them without mentioning them to users.

§Example

use agent_sdk::reminders::{wrap_reminder, append_reminder, ReminderTracker};
use agent_sdk::ToolResult;

// Wrap content in system-reminder tags
let reminder = wrap_reminder("Consider verifying the output.");
assert!(reminder.contains("<system-reminder>"));

// Append a reminder to a tool result
let mut result = ToolResult::success("File written successfully.");
append_reminder(&mut result, "Consider reading the file to verify changes.");
assert!(result.output.contains("<system-reminder>"));

Modules§

builtin
Built-in reminder content for primitive tools.

Structs§

ReminderConfig
Configuration for the reminder system.
ReminderTracker
Tracks tool usage for periodic reminder generation.
ToolReminder
A custom reminder for a specific tool.

Enums§

ReminderTrigger
Determines when a tool reminder should be shown.

Functions§

append_reminder
Appends a system reminder to a tool result’s output.
wrap_reminder
Wraps content with system-reminder XML tags.