Interface: SentimentTrackingConfig
Defined in: packages/agentos/src/cognition/substrate/personas/IPersonaDefinition.ts:259
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
Examples
// Minimal: enable with defaults
sentimentTracking: { enabled: true }
// Full: custom thresholds; 'llm' sends a HybridUtilityAI's scoring to its LLM-backed class
sentimentTracking: {
enabled: true,
method: 'llm',
historyWindow: 10,
frustrationThreshold: -0.3,
satisfactionThreshold: 0.3,
consecutiveTurnsForTrigger: 2,
presets: ['frustration_recovery', 'confusion_clarification'],
}
Properties
consecutiveTurnsForTrigger?
optionalconsecutiveTurnsForTrigger:number
Defined in: packages/agentos/src/cognition/substrate/personas/IPersonaDefinition.ts:314
Number of consecutive turns with same sentiment pattern before triggering event. Prevents over-triggering on single outlier messages.
Default
2
enabled
enabled:
boolean
Defined in: packages/agentos/src/cognition/substrate/personas/IPersonaDefinition.ts:266
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
frustrationThreshold?
optionalfrustrationThreshold:number
Defined in: packages/agentos/src/cognition/substrate/personas/IPersonaDefinition.ts:301
Sentiment score threshold below which frustration is detected. Score range: -1 (very negative) to 1 (very positive).
Default
-0.3
historyWindow?
optionalhistoryWindow:number
Defined in: packages/agentos/src/cognition/substrate/personas/IPersonaDefinition.ts:294
Number of recent turns to keep in sentiment history (sliding window). Higher = better pattern detection, slightly more memory.
Default
10
method?
optionalmethod:"llm"|"lexicon_based"|"trained_classifier"
Defined in: packages/agentos/src/cognition/substrate/personas/IPersonaDefinition.ts:275
The method the tracker passes to the GMI's utility class with each turn. The utility class decides how a
turn is scored: LLMUtilityAI makes a provider call for each turn (and a repair call when its reply does not
parse) and StatisticalUtilityAI scores with a word lexicon and makes none, whatever this names. A HybridUtilityAI that holds both sends 'llm' to its
LLM-backed class and 'lexicon_based' or 'trained_classifier' to its statistical class.
Default
'lexicon_based'
modelId?
optionalmodelId:string
Defined in: packages/agentos/src/cognition/substrate/personas/IPersonaDefinition.ts:281
The modelId an LLMUtilityAI scores a turn with, else the persona's defaultModelId.
StatisticalUtilityAI does not read it.
presets?
optionalpresets: ("all"|"frustration_recovery"|"confusion_clarification"|"satisfaction_reinforcement"|"error_recovery"|"engagement_boost")[]
Defined in: packages/agentos/src/cognition/substrate/personas/IPersonaDefinition.ts:328
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)
providerId?
optionalproviderId:string
Defined in: packages/agentos/src/cognition/substrate/personas/IPersonaDefinition.ts:287
Provider ID for LLM-based methods. Falls back to persona defaultProviderId if not specified.
satisfactionThreshold?
optionalsatisfactionThreshold:number
Defined in: packages/agentos/src/cognition/substrate/personas/IPersonaDefinition.ts:307
Sentiment score threshold above which satisfaction is detected.
Default
0.3