Skip to main content

Emotions

Emotions are organized in a two-level hierarchy: Category → Emotion. They are used to tag dialog scene blocks, enabling the emotional arc analysis feature on scenes.

Data models

EmotionCategory

FieldTypeDescription
idnumberPrimary key
namestringCategory label (e.g. "Negative", "Positive")
descriptionstringOptional explanation

Emotion

FieldTypeDescription
idnumberPrimary key
categoryIdnumberParent category
namestringEmotion label (e.g. "Melancholy")
colorstringHex color for visualization

Emotional arc analysis

POST /scenes/:id/analyze-emotional-arc calls the LLM service with the scene's dialog blocks (each tagged with an emotion ID) and returns a timeline of emotional shifts. The result is displayed as a chart in the Scene Studio panel.

Requires SCENE_EMOTIONAL_ARC_GENERATE.

Frontend

The emotion picker (EmotionSelect) loads from GET /emotions/categories/with-emotions. The selection is stored on the scene_block.emotionId field and is visible in the block editor.

Permission scopes

ScopeWhat it guards
EMOTION_CREATECreating an emotion
EMOTION_EDITEditing name / color
EMOTION_DELETEDeleting an emotion
EMOTION_CATEGORY_CREATECreating a category
EMOTION_CATEGORY_EDITEditing a category
EMOTION_CATEGORY_DELETEDeleting a category
SCENE_EMOTIONAL_ARC_GENERATERunning arc analysis