Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Proactive Reminders & Interventions: Triggers & Logic

Introduction

In our last lesson, we designed the foundational data model and state-machine logic for a discipline-tracking agent. That system is robust and reactive: it operates on a defined schedule, prompts for check-ins, and processes updates. However, its intelligence is limited to a fixed timeline. It reacts, but it doesn't anticipate.

This lesson builds directly on that foundation to fulfill our current learning outcome: to specify triggers and logic for an agent to generate proactive, context-aware reminders and interventions. We will evolve our agent from a passive timekeeper into a proactive collaborator.

A purely reactive system still requires you to carry the "mental load" of strategic oversight—assessing your own momentum, noticing when you're falling behind, and deciding when to adjust your plan. A proactive agent aims to offload that cognitive work by identifying meaningful patterns in your progress and intervening at precisely the right moment with the right message. We will design the specific mechanisms that enable this shift from reaction to initiative.

1. The Proactive Shift: From Response to Initiative

Before we design the "how," we must be precise about the "what." Proactive AI is not about more frequent notifications; it's about a fundamental change in orientation from responding to user commands to anticipating user needs.

Proactive AI Agents: Build Systems That Suggest and Act

To start, let's establish a clear definition. The article 'Proactive AI Agents: Build Systems That Suggest and Act' by Emil Ingelmar Karlsson provides a succinct contrast between reactive and proactive systems.

Read the first two sections, 'What Are Proactive AI Agents?' and 'Reactive vs Proactive AI'. Focus on the core distinction: proactive agents operate persistently, monitor environments, and generate suggestions without explicit prompts, guided by goals and context.

This proactive stance depends on three ingredients: observation, context, and timeliness. An agent must observe your actions, understand them in the context of your goals, and choose the opportune moment to intervene.

Proactive Agents – Kath Korevec, Google Labs

This next video from Google Labs, while focused on coding agents, provides an excellent conceptual framework for proactivity. The speaker, Kath Korevec, outlines the key ingredients and provides relatable analogies.

Watch the following segments: The 'Mental Load' Analogy (00:39 - 03:22): This frames the core value proposition of proactive agents. Four Essential Ingredients (04:23 - 05:41): Pay close attention to Observation, Personalization, Timeliness, and Seamless Workflow integration. Familiar Examples (05:41 - 06:42): The Google Nest and autonomic nervous system examples demystify proactivity, showing it's about creating a 'good collaborator'.

The goal is to create an agent that feels less like a command-line tool and more like an attentive partner who intuits when and how to help, without needing to be asked.

2. Architecting Proactive Triggers (The "When")

In the last lesson, our triggers were simple: checkin_due (time-based) and user_submitted_log (event-based). To become proactive, our agent needs a more sophisticated set of triggers based on an analysis of the user's performance. These triggers are the "signals" the agent observes.

Drawing upon the structured data model we designed (Goal, Metric, ProgressLog), we can define a set of performance-based triggers that are calculated by the agent's deterministic core logic.

Performance-Based Triggers

These triggers require the agent to analyze the ProgressLog data to identify trends and patterns.

  1. Progress Velocity Trigger:

    • Logic: The agent calculates the user's current rate of progress and compares it to the rate required to meet the goal.
    • Example Calculation (in pseudocode):
      
      
      
      # Data from our Goal and Metric objects
      target_value = metric.target
      deadline = metric.deadline
      start_date = goal.start_date
      
      
      
      
      # Required velocity
      days_total = (deadline - start_date).days
      required_velocity = target_value / days_total # e.g., 5 pages/day
      
      
      
      
      # Current velocity
      days_so_far = (today - start_date).days
      current_progress = metric.current_value
      current_velocity = current_progress / days_so_far # e.g., 4.5 pages/day
      
      
      
      
      # Trigger condition
      if current_velocity < required_velocity * 0.9: # e.g., if velocity is <90% of required
          return "TRIGGER_NEGATIVE_VELOCITY_TREND"
      
    • This trigger fires not because a deadline was missed, but because the trajectory is off.
  2. Streak Maintenance Trigger:

    • Logic: The agent checks the ProgressLog for a consistent pattern of success or failure.
    • Trigger condition (Success): If the user successfully meets a daily/weekly target for N consecutive periods, trigger TRIGGER_POSITIVE_STREAK.
    • Trigger condition (Failure): If the user fails to meet a daily/weekly target for M consecutive periods, trigger TRIGGER_NEGATIVE_STREAK.
  3. Stagnation Trigger:

    • Logic: The agent monitors the time since the last ProgressLog entry.
    • Trigger condition: If the time since the last log exceeds a predefined threshold (e.g., 3 days for a daily goal), trigger TRIGGER_STAGNATION. This is more intelligent than a simple missed check-in; it indicates a pattern of disengagement.
  4. Milestone Trigger:

    • Logic: The agent checks if metric.current_value has crossed a significant threshold.
    • Trigger condition: If current_value crosses 25%, 50%, or 75% of the target, trigger TRIGGER_MILESTONE_REACHED.

These calculated triggers form the "Signals Layer" of our proactive system. The agent isn't just waiting for a specific time; it's continuously evaluating the state of progress against the goal.

3. Designing Context-Aware Logic (The "What")

Once a trigger fires, the agent must decide what to do. This is the Reasoning Layer. A crude system might send a generic "You're falling behind!" message. A sophisticated agent maps specific triggers to nuanced intervention types, using the rich context from our data model to tailor the response.

Here is a mapping of our new triggers to potential intervention types:

Trigger Intervention Type Rationale
TRIGGER_POSITIVE_STREAK Encouragement Reinforce positive behavior and build momentum.
TRIGGER_MILESTONE_REACHED Celebration Acknowledge significant progress to maintain motivation.
TRIGGER_NEGATIVE_VELOCITY_TREND Nudge / Inquiry Gentle, non-judgmental prompt to investigate the dip.
TRIGGER_NEGATIVE_STREAK Course Correction A more direct intervention, perhaps suggesting a specific action.
TRIGGER_STAGNATION Re-engagement An open-ended query to understand the blocker.
CONSISTENT_OVERACHIEVEMENT Adaptive Suggestion Propose modifying the goal itself to match performance.

The final step is the Action Layer, where the agent generates and delivers the message. This is the ideal place to strategically use an LLM. The deterministic logic selects the intervention_type, and the LLM crafts the human-like message.

Example Workflow:

  1. Signal: The monitoring loop runs its calculations. It finds that current_velocity is 85% of required_velocity. It fires TRIGGER_NEGATIVE_VELOCITY_TREND.
  2. Reasoning: The core logic maps this trigger to the Nudge intervention type. It gathers context: goal_description, current_velocity, required_velocity.
  3. Action (LLM Prompt):
    You are a supportive discipline coach. Your user's goal is to "{goal_description}".
    Their required pace is {required_velocity} per day, but their current average is {current_velocity} per day.
    Generate a brief, encouraging, and non-judgmental message of type 'Nudge' that flags this trend and asks if they need to adjust their plan. Do not be alarming.
    
  4. Output Message: "Hey, just checking in on your goal to 'run a sub-4-hour marathon'. I noticed your weekly mileage has dipped slightly. Is everything on track, or would it be helpful to brainstorm a revised training schedule for this week?"

This approach keeps the core system predictable while leveraging the LLM for its strength in nuanced communication.

To see how these concepts are packaged in a real-world tool, you can explore the ProactiveAgent library. It formalizes this process into a decision-making cycle.

GitHub - leomariga/ProactiveAgent

The open-source 'ProactiveAgent' library provides a concrete implementation of the concepts we're discussing. Its documentation explains how it separates the decision of 'when' to act from the action itself.

Read the following sections of the README file: 'What is ProactiveAgent?': Notice how it describes agents that 'Decide when to speak' and 'Understand context'. 'How It Works': This is the most important section. Focus on the 3-step cycle: 'Decision Engine' (our triggers), 'Message Generation' (our action), and 'Sleep Calculator' (our monitoring loop). 'Decision Engines' and 'Sleep Time Calculators': Skim these sections to see how the logic for triggering and timing can be customized. This mirrors our design of performance-based triggers.

Conclusion

In this lesson, we have specified the triggers and logic that elevate an agent from a reactive task-manager to a proactive partner. By moving beyond simple time-based events, we've designed a system that can truly collaborate with a user to achieve long-term goals.

Key Takeaways:

  • Proactivity is Anticipation: A proactive agent anticipates needs based on observed signals and context, reducing the user's cognitive load.
  • Triggers are Calculated Signals: Proactive triggers are not just alarms. They are calculated from performance data (like velocity, streaks, and stagnation) derived from the agent's data model.
  • Logic Maps Triggers to Interventions: A robust reasoning layer uses deterministic rules to map specific triggers (the "when") to intervention types (the "what"), such as a nudge, an alert, or encouragement.
  • LLMs Craft the Message: The final action—generating the nuanced, context-aware message—is the ideal application for an LLM, ensuring the intervention is both intelligent and human-like.

Preview of the Next Lesson:

We have now designed how the agent proactively communicates with the user. But communication is a two-way street. In our next lesson, we will design a feedback loop for the agent to interpret user responses and adapt its strategy. We will explore how the agent can learn from your replies to its interventions, making it an even more effective and personalized collaborator.

Can't find a good explanation? Sign up and we'll make it for you

Sign up