名称: user-cognitive-profiles
描述: "分析 ChatGPT 对话导出数据,以发现用户的认知原型并优化人机沟通模式。基于检测到的用户画像,实现个性化的智能体交互。"
主页: https://github.com/openclaw/user-cognitive-profiles
元数据:
{
"openclaw":
{
"emoji": "🤖🤝🧠",
"requires": { "bins": ["python3"] },
"tags": ["communication", "persona", "user-research", "optimization", "nlp"],
},
}
🤖🤝🧠 探索你与 AI 的沟通方式,优化你的智能体交互体验。
本技能通过分析你的 ChatGPT 对话历史,识别认知原型——即你在思考、沟通和协作中反复出现的模式。利用这些洞察来校准你的 OpenClaw 智能体,实现更高效、个性化的交互。
人机沟通并非千篇一律。正如你在不同场景(工作会议 vs. 闲聊)中会调整沟通风格一样,有效的 AI 辅助需要匹配你的认知架构。
问题所在:
- 默认的 AI 行为假设用户是通用的
- 你的沟通风格因场景(专业 vs. 个人)差异巨大
- 不匹配的 AI 回复会显得低效或令人沮丧
解决方案:
- 分析你真实的对话模式
- 识别你主导的认知原型
- 配置你的智能体以匹配你的沟通风格
conversations.jsoncd /path/to/user-cognitive-profiles
python3 scripts/analyze_profile.py \
--input ~/Downloads/chatgpt-export/conversations.json \
--output ~/.openclaw/my-cognitive-profile.json \
--archetypes 3
添加到你的 SOUL.md 或 AGENTS.md 中:
## 用户认知画像
<!-- 来源:由 user-cognitive-profiles 技能生成 -->
- **主要原型:** 效率优化者
- **平均消息长度:** 47 词
- **上下文切换:** 高(专业模式 vs. 个人模式)
- **关键模式:** 偏好直接答案,重视实例胜过理论
### 沟通校准
- 默认提供简洁的回复
- 提供“实例 + 理论 + 实践步骤”的组合
- 留意专业/个人模式的切换
分析基于四个维度识别原型:
| 维度 | 低 | 高 |
|---|---|---|
| 消息长度 | 简短指令 | 扩展分析 |
| 结构 | 有机流动 | 系统分解 |
| 深度 | 实用导向 | 理论探索 |
| 语气 | 事务性 | 协作性 |
创建 ~/.openclaw/my-archetypes.yaml:
archetypes:
- name: "研究模式"
keywords:
- "研究"
- "分析"
- "比较"
- "权衡"
patterns:
- long_messages
- multiple_questions
- citation_requests
- name: "快速模式"
keywords:
- "快速"
- "简要"
- "简单"
- "直接"
patterns:
- short_messages
- imperative_tone
- minimal_context
使用自定义原型运行:
python3 scripts/analyze_profile.py \
--input conversations.json \
--archetypes-config ~/.openclaw/my-archetypes.yaml
更多原型 = 更细粒度,但更难操作:
# 简单:2-3 个原型
python3 scripts/analyze_profile.py --archetypes 2
# 详细:5-7 个原型
python3 scripts/analyze_profile.py --archetypes 5
# 复杂:10+ 个(适合高级用户)
python3 scripts/analyze_profile.py --archetypes 10
{
"metadata": {
"total_conversations": 3784,
"date_range": "2024-01-01 至 2025-01-31",
"analysis_date": "2026-02-02"
},
"archetypes": [
{
"id": 0,
"name": "系统架构师",
"confidence": 0.87,
"metrics": {
"avg_message_length": 382,
"avg_response_length": 450,
"question_ratio": 0.23,
"code_block_ratio": 0.45
},
"keywords": ["架构", "设计", "权衡", "系统"],
"sample_conversations": ["uuid-1", "uuid-2"],
"recommendations": {
"ai_role": "高级架构师",
"communication_style": "详细、系统、协作",
"response_length": "长",
"structure": "层级化"
}
}
],
"context_shifts": [
{
"trigger": "technical_keywords",
"from_archetype": "效率优化者",
"to_archetype": "系统架构师"
}
],
"insights": {
"primary_mode": "系统架构师",
"context_switching": "高",
"communication_preferences": [
"先实例后理论",
"动手实践",
"跨领域类比"
]
}
}
| 指标 | 描述 | 重要性 |
|---|---|---|
avg_message_length |
用户每条消息的平均词数 | 短 = 效率模式,长 = 探索模式 |
question_ratio |
提问回合的百分比 | 高 = 协作性,低 = 指令性 |
code_block_ratio |
包含代码的消息百分比 | 技术性 vs. 概念性焦点 |
context_shifts |
检测到的模式转换 | 表明存在多个原型 |
confidence |
聚类内聚度分数 | 越高 = 模式越明显 |
所有处理均在本地进行。 脚本:
- ✅ 完全在你的机器上运行
- ✅ 从不将数据上传到外部服务
- ✅ 将结果存储在你的本地 OpenClaw 工作空间
- ✅ 你控制分享的内容(如有)
推荐工作流:
1. 导出 ChatGPT 数据
2. 在本地运行分析
3. 查看 my-cognitive-profile.json
4. 手动将相关洞察添加到 SOUL.md
5. (可选)删除导出文件和原始画像
追踪你的沟通方式如何演变:
# 一月分析
python3 scripts/analyze_profile.py \
--input conversations_jan.json \
--output profile_jan.json
# 六月分析
python3 scripts/analyze_profile.py \
--input conversations_jun.json \
--output profile_jun.json
# 比较
python3 scripts/compare_profiles.py profile_jan.json profile_jun.json
为 Claude、GPT 或其他智能体生成提示片段:
python3 scripts/analyze_profile.py \
--input conversations.json \
--format prompt-snippet \
--output agent-prompt.txt
输出:
## 用户沟通画像
- 主要风格:系统架构师(详细、分析型)
- 次要风格:效率优化者(简洁、务实)
- 上下文切换:高(留意模式转换)
- 偏好:实例 + 理论 + 实践步骤
- 视为:高级技术伙伴,而非助手
导出 ZIP 包含多个文件。确保你指向:
chatgpt-export/
├── conversations.json <-- 这个文件
├── user.json
└── ...
你的导出可能为空或已损坏。检查:
head -20 conversations.json
应显示:[{"title": "...", "messages": [...]}, ...]
尝试调整聚类数量:
# 过于细分
python3 scripts/analyze_profile.py --archetypes 10
# 尝试简化
python3 scripts/analyze_profile.py --archetypes 3
对于大型对话历史(10k+ 条消息):
# 采样以加速分析
python3 scripts/analyze_profile.py \
--input conversations.json \
--sample 1000 # 分析随机的 1000 个对话
添加到你的 OpenClaw 工作空间 AGENTS.md:
## 会话开始时
1. 如果存在,读取 `~/.openclaw/my-cognitive-profile.json`
2. 根据主要原型调整沟通风格
3. 留意上下文切换的指示器
适用于能在对话中切换模式的智能体:
# 智能体集成的伪代码
def detect_mode_shift(current_message, profile):
for shift in profile["context_shifts"]:
if shift["trigger"] in current_message:
return shift["to_archetype"]
return profile["insights"]["primary_mode"]
有行之有效的新原型?提交 PR 时请包含:
1. examples/ 目录下的原型定义
2. 样本数据(匿名化)
3. 验证其聚类具有独特性
references/methodology.md — 聚类算法的技术细节references/archetype-taxonomy.md — 完整的原型定义examples/ — 样本画像和配置为希望 AI 真正理解自己的人类而构建。 🤖🤝🧠