OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  user-cognitive-profiles:分析 ChatGPT 对话导出文件以建立用户认知画像

user-cognitive-profiles:分析 ChatGPT 对话导出文件以建立用户认知画像

 
  index ·  2026-02-25 00:56:28 · 2 次点击  · 0 条评论  

名称: 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 回复会显得低效或令人沮丧

解决方案:
- 分析你真实的对话模式
- 识别你主导的认知原型
- 配置你的智能体以匹配你的沟通风格


快速开始

1. 导出你的 ChatGPT 数据

  1. 进入 ChatGPT → 设置 → 数据控制 → 导出数据
  2. 点击“导出”并确认
  3. 等待邮件(通常在 24 小时内到达)
  4. 从邮件链接下载 ZIP 文件
  5. 解压文件——你将找到 conversations.json

2. 运行分析

cd /path/to/user-cognitive-profiles
python3 scripts/analyze_profile.py \
  --input ~/Downloads/chatgpt-export/conversations.json \
  --output ~/.openclaw/my-cognitive-profile.json \
  --archetypes 3

3. 应用于你的智能体

添加到你的 SOUL.mdAGENTS.md 中:

## 用户认知画像
<!-- 来源:由 user-cognitive-profiles 技能生成 -->
- **主要原型:** 效率优化者
- **平均消息长度:** 47 词
- **上下文切换:** 高(专业模式 vs. 个人模式)
- **关键模式:** 偏好直接答案,重视实例胜过理论

### 沟通校准
- 默认提供简洁的回复
- 提供“实例 + 理论 + 实践步骤”的组合
- 留意专业/个人模式的切换

认知原型

分析基于四个维度识别原型:

维度
消息长度 简短指令 扩展分析
结构 有机流动 系统分解
深度 实用导向 理论探索
语气 事务性 协作性

常见原型

🔧 效率优化者

  • 消息: 简短、直接、行动导向
  • 需求: 快速答案,最少解释
  • AI 角色: 完成任务工具
  • 示例: “设置邮箱。用密码。开始。”

🏗️ 系统架构师

  • 消息: 冗长、结构化、全面
  • 需求: 深度分析、权衡考量、战略思考
  • AI 角色: 解决复杂问题的协作伙伴
  • 示例: 包含多重考量的 300 词技术分析

🧭 哲学探索者

  • 消息: 变化大,质疑假设
  • 需求: 意义、模式、跨领域联系
  • AI 角色: 启发洞察的苏格拉底式伙伴
  • 示例: “这与[完全不同的领域]有何关联?”

🎨 创意整合者

  • 消息: 连接不同想法,使用类比
  • 需求: 新颖组合,模式识别
  • AI 角色: 构思伙伴和模式映射者
  • 示例: “这就像爵士即兴演奏...”

自定义

定义你自己的原型

创建 ~/.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

理解输出

画像 JSON 结构

{
  "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

输出:

## 用户沟通画像
- 主要风格:系统架构师(详细、分析型)
- 次要风格:效率优化者(简洁、务实)
- 上下文切换:高(留意模式转换)
- 偏好:实例 + 理论 + 实践步骤
- 视为:高级技术伙伴,而非助手

故障排除

“未找到 conversations.json”

导出 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 集成

自动加载画像

添加到你的 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 真正理解自己的人类而构建。 🤖🤝🧠

2 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor