Interface SentimentTrackingConfig

Configuration for sentiment-aware metaprompt tracking. Controls whether the GMI analyzes user sentiment and triggers event-based metaprompts in response to detected emotional states.

Interface

SentimentTrackingConfig

Example

// Minimal: enable with defaults
sentimentTracking: { enabled: true }

Example

// Full: LLM-based analysis with custom thresholds
sentimentTracking: {
enabled: true,
method: 'llm',
historyWindow: 10,
frustrationThreshold: -0.3,
satisfactionThreshold: 0.3,
consecutiveTurnsForTrigger: 2,
presets: ['frustration_recovery', 'confusion_clarification'],
}
interface SentimentTrackingConfig {
    enabled: boolean;
    method?: "llm" | "lexicon_based" | "trained_classifier";
    modelId?: string;
    providerId?: string;
    historyWindow?: number;
    frustrationThreshold?: number;
    satisfactionThreshold?: number;
    consecutiveTurnsForTrigger?: number;
    presets?: ("all" | "frustration_recovery" | "confusion_clarification" | "satisfaction_reinforcement" | "error_recovery" | "engagement_boost")[];
}

Properties

enabled: boolean

Master switch: enables/disables sentiment analysis on user input. When false (default), no sentiment analysis runs and no events are emitted. Turn_interval metaprompts (like gmi_self_trait_adjustment) still work regardless.

Default

false
method?: "llm" | "lexicon_based" | "trained_classifier"

Sentiment analysis method.

  • 'lexicon_based': Fast (~10-50ms), no LLM cost, basic accuracy (VADER-style)
  • 'llm': Uses LLM call, higher accuracy, ~500-1000ms latency, costs tokens
  • 'trained_classifier': Uses trained ML model (if available)

Default

'lexicon_based'
modelId?: string

Model ID for LLM-based or trained_classifier methods. Falls back to persona defaultModelId if not specified.

providerId?: string

Provider ID for LLM-based methods. Falls back to persona defaultProviderId if not specified.

historyWindow?: number

Number of recent turns to keep in sentiment history (sliding window). Higher = better pattern detection, slightly more memory.

Default

10
frustrationThreshold?: number

Sentiment score threshold below which frustration is detected. Score range: -1 (very negative) to 1 (very positive).

Default

-0.3
satisfactionThreshold?: number

Sentiment score threshold above which satisfaction is detected.

Default

0.3
consecutiveTurnsForTrigger?: number

Number of consecutive turns with same sentiment pattern before triggering event. Prevents over-triggering on single outlier messages.

Default

2
presets?: ("all" | "frustration_recovery" | "confusion_clarification" | "satisfaction_reinforcement" | "error_recovery" | "engagement_boost")[]

Which preset metaprompts to enable. Options:

  • 'frustration_recovery': Responds to user frustration
  • 'confusion_clarification': Responds to user confusion
  • 'satisfaction_reinforcement': Responds to user satisfaction
  • 'error_recovery': Responds to error accumulation
  • 'engagement_boost': Responds to low engagement
  • 'all': Enables all presets

Only listed presets will be merged. Omit to enable none (use custom metaPrompts instead).

Default

[] (no presets auto-merged)