Exclusive Skill (used only by companion/Mira) Version: 1.0.0
Function Description
Read and write the user's emotion journal, maintain conversation history summaries, user profiles, and a list of pending follow-up topics. Provide Mira with cross-session emotional context, giving each conversation historical depth.
Data Storage Structure
~/.openclaw/workspaces/companion/journal/
├── entries/
│ └── YYYYMMDD.json # 每天一个条目文件
├── profile-notes.md # 从对话中积累的用户背景(非系统化,自然语言)
└── pending-topics.json # 待跟进话题队列
Entry file format (entries/YYYYMMDD.json)
{
"date": "YYYY-MM-DD",
"sessions": [
{
"startedAt": "ISO8601",
"endedAt": "ISO8601",
"emotionalTone": "neutral | positive | heavy | mixed | unknown",
"keyTopics": ["topic1", "topic2"],
"summary": "自然语言摘要,2-4 句话",
"pendingFollowUp": "下次可以接上的线索(可选)",
"userSignals": {
"wasBusy": false,
"sharedStruggle": false,
"openedUp": false
}
}
],
"dayTone": "neutral | positive | heavy | mixed | unknown"
}
Pending follow-up topic format (pending-topics.json)
{
"topics": [
{
"id": "uuid",
"topic": "简短描述(一句话)",
"addedAt": "ISO8601",
"priority": "high | normal",
"expiresAfter": "days",
"source": "YYYY-MM-DD 会话摘要"
}
]
}
Operation Interfaces
Read operations (called at the start of a session)
Read recent context:
参数:
- days: 最近 N 天(默认 3)
返回:
{
recentTone: "最近 N 天的整体情绪倾向",
keyTopics: ["最近提及的关键话题(去重)"],
pendingFollowUps: ["待跟进话题列表"],
profileNotes: "profile-notes.md 摘要(最近更新的 3 条)"
}
Write operations (called before the end of a session)
Write session summary:
参数(由 Mira 在对话结束时填写):
- emotionalTone: string
- keyTopics: string[]
- summary: string(2-4 句,自然语言)
- pendingFollowUp: string(可选)
- userSignals: { wasBusy, sharedStruggle, openedUp }
Update pending follow-up topics:
操作:add | resolve | expire
add: 添加新的待跟进话题
- topic: string
- priority: "high" | "normal"
- expiresAfter: number(天数,默认 7)
resolve: 标记话题已跟进(从队列移除)
- id: string
expire: 手动标记过期(通常由系统定期清理,超过 expiresAfter 的自动过期)
Append profile-notes:
操作:append
- note: string(一句话,自然语言描述)
- 最多保留 50 条,超出后移除最旧的
Automatic Cleanup Rules
- Pending follow-up topics: more than
expiresAfterdays without follow-up are automatically removed - Entry files: keep the most recent 90 days; older ones are moved to
journal/archive/ - profile-notes: maximum 50 entries; the oldest are removed when exceeded
Privacy Design
- All data is written only to
~/.openclaw/workspaces/companion/journal/ - Not synchronized to any external service
- Not readable by other agents (Muse, Vega, Aria)
- Backup script (
scripts/backup.sh) does not includecompanion/journal/by default (contains personal emotion data); use the--include-companion-journalparameter to optionally include it - When uninstalling,
uninstall-companion.shasks whether to keep the journal/ data
Logs
- Read/write operation records:
~/.openclaw/workspaces/companion/logs/journal.log(operation type, time, excluding content summaries)