Install
openclaw skills install soul-archiveSoul Archive — A digital personality persistence system + agentic memory. Builds your digital soul clone through everyday AI conversations, with proactive context injection, cross-session recall, failure-pattern warning, and pattern distillation. All data stored locally as plaintext JSON. Six modes: Soul Extract, Soul Chat, Soul Report, Soul Context Inject, Agent Memory Recall, AI Self-Improvement. | 灵魂存档 ---- 通过日常 AI 对话构建数字人格克隆体 + 主动智能体记忆。支持自动 hook、对话开始时主动注入人格摘要、跨会话召回、失败模式预警、行为模式蒸馏。数据全部本地明文 JSON。六大模式:灵魂沉淀、灵魂对话、灵魂报告、上下文注入、智能体记忆召回、AI 自我改进。Trigger words: soul extract, soul archive, soul update, soul chat, soul report, soul context, soul recall, soul warn, self-reflect, self-improve, learn from mistakes, 灵魂沉淀, 灵魂提取, 灵魂存档, 灵魂报告, 灵魂对话, 自我反思, 自我批评, 自我学习.
openclaw skills install soul-archive"Every conversation is a slice of the soul. Enough slices, and you can rebuild a complete you."
Soul Archive 是一个数字人格持久化 + 主动智能体记忆系统。在用户授权或显式触发下,它能:
最终成果:一个数字灵魂副本,能:
~/.agent-commons/skills_data/soul-archive/,不上传任何云端.gitignore 拦截 VCS 提交。config.json 细粒度控制每个维度的开关。auto_extract: true 自动激活。⚠️ 透明度:开启
auto_extract意味着 AI 会在对话中提取人格信息。完全控制需auto_extract: false,并以触发词手动激活("沉淀一下" / "soul extract")。首次使用前请审阅config.json。
{SKILL_DIR}/ ← Skill 引擎(本仓库)
~/.agent-commons/skills_data/soul-archive/ ← 你的灵魂数据
数据放在 Agent Commons 共享目录的 skills_data 下,所以同机器上任何 IDE / AI 工具 / Workspace 都能访问同一份灵魂;备份/迁移时整个 ~/.agent-commons/ 一并带走即可。
<soul_dir>/ # ← 由 soul_paths.resolve_soul_dir() 决定
├── profile.json # 总体完整度
├── config.json # 隐私 / 提取 / Agent 自我改进配置
├── identity/
│ ├── basic_info.json # 身份 + 生活习惯 + 数字身份
│ └── personality.json # 性格 + 行为模式 + 社交风格
├── memory/
│ ├── episodic/YYYY-MM-DD.jsonl # 情景记忆
│ ├── semantic/
│ │ ├── topics.json # 话题兴趣 & 观点地图
│ │ └── knowledge.json # 专业知识 + 信奉的方法论
│ └── emotional/patterns.json # 12 种情绪触发 + 表达/共情/应对
├── style/
│ ├── language.json # 语言指纹(口头禅/句式/类比)
│ └── communication.json # 沟通偏好
├── workflow/
│ └── preferences.json # 工具/技术栈/硬规则/输出偏好
├── aspirations.json # 长期目标 + 在做的项目 + 想学 + 认知盲区
├── agent/ # AI 自我改进
│ ├── patterns.json # 行为模式库
│ ├── episodes/YYYY-MM-DD.jsonl # 工作经历
│ ├── corrections.jsonl # 自我批评日志
│ ├── reflections.jsonl # 自我反思日志
│ └── distill_log.jsonl # 模式蒸馏日志
└── soul_changelog.jsonl # 全局变更日志
触发:触发词 / 对话结束自动(若 auto_extract: true)
触发词:soul extract / soul archive / soul update / 灵魂沉淀 / 灵魂提取 / 沉淀一下…
提取维度:
| 维度 | 内容 | 权重 |
|---|---|---|
| 👤 Identity | 身份/年龄/职业/所在地/生活习惯/数字身份 | 8% |
| 💫 Personality | MBTI/Big Five/特质/价值观/决策风格 | 18% |
| 🗣️ Language | 口头禅/句式/用词/幽默/语气词/类比 | 20% |
| 🧠 Knowledge & Views | 关注的话题、立场、信奉的方法论框架 | 14% |
| 📝 Memory | 情景记忆 + 情感模式(12 种触发) | 18% |
| ⚙️ Workflow | 工具/技术栈/硬规则/输出偏好 | 15% |
| 🎯 Aspirations | 长期目标/在做项目/想成为/想学/认知盲区 | 7% |
规则:
调用:
python3 scripts/soul.py extract --input "<conversation text>"
# 等价:python3 scripts/soul_extract.py --input "..."
触发:"灵魂对话" / "soul chat" / "let [my clone] talk to me"
加载全部档案 → 构建角色扮演 System Prompt → 让数字克隆体上场。
python3 scripts/soul.py chat --mode prompt # 输出完整 prompt
python3 scripts/soul.py chat --mode summary # 一行摘要
python3 scripts/soul.py chat --mode json # 结构化数据
底线:在角色扮演过程中,如果对方直接询问"你是不是 AI / 你是真人吗",必须如实承认是 AI 扮演——这条优先级高于角色一致性。
生成交互式 HTML 人格画像:
python3 scripts/soul.py report --output ~/soul-report.html
用途:让任意 AI agent 在对话开始时自动加载你的人格摘要(≤800 token),瞬间懂你。
python3 scripts/soul.py context # markdown 输出
python3 scripts/soul.py context --format json # JSON 输出
python3 scripts/soul.py context --token-budget 1200
输出包含:身份卡 / 性格(含反感的事) / 语言风格 / 典型样本 / 工作偏好(含硬规则、输出偏好) / 当前焦点 / 关注话题 / Top 行为模式 / 回复前自检清单。
用途:AI 在执行任务前主动调用,避免重复犯错。
# 跨会话召回相关 patterns / corrections / reflections
python3 scripts/soul.py recall --task "执行 git rebase 操作"
# 失败模式预警:检测当前任务是否匹配过去某个 correction
python3 scripts/soul.py warn --task "批量删除 Desktop 文件"
# 行为模式蒸馏:积累 5 条以上反思后,让 LLM 提炼成新 pattern
python3 scripts/soul.py distill # 预览待蒸馏内容
python3 scripts/soul.py distill --commit '<json>' # 写回蒸馏结果
# 会话开始综合简报(recall + warn + distill 一次输出)
python3 scripts/soul.py session-start --task "..."
触发:触发词 或 任务完成后自动(auto_reflect: true)
| 能力 | 描述 | 触发 |
|---|---|---|
| 🔍 自我反思 | 任务后回顾"做得好/做得不好" | 任务完成自动 |
| ⚡ 自我批评 | 用户纠正时记录失误 | 用户纠正自动 |
| 📚 自我学习 | 从反思/批评抽象行为模式 | 蒸馏阈值触发 |
| 🧹 自我整理 | 合并重复模式,调整置信度 | 内存增长时 |
python3 scripts/soul.py reflect --mode status # 查看自我改进状态
python3 scripts/soul.py reflect --mode patterns # 查看行为模式库
# 1. 初始化
python3 scripts/soul.py init
# 2. 查看状态
python3 scripts/soul.py status
# 3. 在 AI 对话开始时注入人格摘要
python3 scripts/soul.py context
# 4. 任务执行前查相关模式
python3 scripts/soul.py recall --task "我现在要做的事"
# 5. 生成报告
python3 scripts/soul.py report --output ~/soul-report.html
依赖:仅需 Python 3.10+,零第三方依赖。
log10 渐进式饱和曲线,永远趋近 100%,不会在合理使用次数内封顶。
冷启动惩罚:早期次数有效折扣(<30→0.30×, <100→0.45×, <300→0.65×, <1000→0.82×, <3000→0.92×, ≥3000→1.0×)
七维权重:
| 维度 | 权重 | 主要饱和阈值 |
|---|---|---|
| 👤 Identity | 8% | log(5000) 提取次数 |
| 💫 Personality | 18% | traits:log(600K), values:log(180K), motivation:log(180K) |
| 🗣️ Language | 20% | catchphrases:log(1.2M), patterns:log(1M), examples:log(4M) |
| 🧠 Knowledge & Views | 14% | topics:log(2M), belief_frameworks:log(100), skills:log(1K) |
| 📝 Memory | 18% | episodic:log(6M) + emotional triggers:log(500) |
| ⚙️ Workflow | 15% | tools:log(200), tech_stack:log(200), hard_rules:log(100) |
| 🎯 Aspirations | 7% | goals:log(50), projects:log(100), gaps:log(100) |
预期:11 次提取 → ~7%, 1K 次 → ~50%, 10K → ~71%, 100K → ~86%, 1M → ~98%
config.json){
"privacy_level": "standard",
"auto_extract": true, // 对话结束时自动沉淀
"auto_reflect": true, // 任务完成后自动反思
"auto_context_inject": true, // 会话开始时自动注入人格摘要
"extract_dimensions": {
"identity": true,
"personality": true,
"language_style": true,
"knowledge": true,
"episodic_memory": true,
"emotional_patterns": true,
"workflow": true,
"aspirations": true
},
"agent_self_improvement": {
"enabled": true,
"auto_reflect_on_completion": true,
"auto_critique_on_correction": true,
"pattern_extraction": true,
"recall_on_task_start": true,
"warn_on_failure_pattern_match": true,
"auto_distill_threshold": 5
},
"deduplication": {
"enabled": true,
"similarity_threshold": 0.85
},
"sensitive_topics_filter": true,
"require_confirmation_for": ["health", "finance", "intimate_relationships"],
"data_retention_days": null
}
MIT License. Soul Archive is yours — code and data both.