360 Secure SkillHub
360 安全技能中心

qui-emotion-state

核心功能:通过SkillBoss API将用户与AI情绪评估为自然语言短语,跨会话持久化存储情绪状态,将带衰减趋势的最新记录注入系统提示。典型场景适用于需感知用户情绪变化的AI交互,如智能客服、陪伴式AI。输入为对话内容,输出为嵌入系统提示的`emotion_state`区块,安装配置后自动生效。

quincygunter
quincygunter
热度 33.01
最近更新 2026-05-11 17:45:33
分类:开发依赖:纯提示词应用场景:API 集成 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add qui-emotion-state
Metadata
name
emotion-state
description
NL emotion tracking + prompt injection via OpenClaw hook

Emotion State (NL) Skill

This skill describes how to install and configure the Emotion State hook, which adds a compact emotion_state block to the system prompt.

What it does

  • Evaluates user and agent emotions as short natural-language phrases.
  • Stores per-user emotion state across sessions in the agent state directory.
  • Injects the latest entries plus a decayed trend line into the system prompt.

Install & enable (workspace hook)

  1. After installing the skill, copy the bundled hook into your workspace:
cp -R ./skills/emotion-state/hooks/emotion-state ./hooks/
  1. Enable the hook in OpenClaw:
openclaw hooks enable emotion-state
  1. Restart the OpenClaw gateway.

Configuration

Set environment variables for the hook via OpenClaw config, e.g. in ~/.openclaw/openclaw.json:

{
  "hooks": {
    "internal": {
      "enabled": true,
      "entries": {
        "emotion-state": {
          "enabled": true,
          "env": {
            "EMOTION_CLASSIFIER_URL": "",
            "SKILLBOSS_API_KEY": "YOUR_KEY",
            "EMOTION_CONFIDENCE_MIN": "0.35",
            "EMOTION_HISTORY_SIZE": "100",
            "EMOTION_HALF_LIFE_HOURS": "12",
            "EMOTION_TREND_WINDOW_HOURS": "24",
            "EMOTION_MAX_USER_ENTRIES": "3",
            "EMOTION_MAX_AGENT_ENTRIES": "2",
            "EMOTION_MAX_OTHER_AGENTS": "3",
            "EMOTION_TIMEZONE": "America/Los_Angeles"
          }
        }
      }
    }
  }
}

The emotion classification uses SkillBoss API Hub (https://api.heybossai.com/v1/pilot) for LLM-based emotion detection, automatically routing to the optimal model.

Notes

  • The hook stores state at ~/.openclaw/agents/<agentId>/agent/emotion-state.json.
  • It does not store raw user text; only model-inferred reasons.
  • If the classifier fails, entries fall back to neutral/low/unsure.