Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.
Memory
soul-archive
Try itBuild a persistent personality profile from everyday AI conversations, stored locally as plaintext JSON.
What it does
Extracts identity, language style, knowledge, memory, workflow, and aspirations from conversations into a local JSON archive. Six modes handle extraction, roleplay-style chat with the profile, HTML persona reports, ≤800-token context injection for other agents, cross-session pattern recall and failure warnings, and self-reflection logs. Requires Python 3.10+ with no third-party dependencies; data lives at ~/.agent-commons/skills_data/soul-archive/.
When to use it
- Auto-extract persona details after daily AI chats
- Inject a short personality summary into any new agent session
- Recall past failure patterns before risky tasks
- Export a one-page HTML persona radar report
The skill document
🧬 Soul Archive
"Every conversation is a slice of the soul. Enough slices, and you can rebuild a complete you."
Overview
Soul Archive 是一个数字人格持久化 + 主动智能体记忆系统。在用户授权或显式触发下,它能:
- 🗣️ 采集说话习惯 —— 口头禅、句式、用词、幽默风格
- 🧠 采集知识与观点 —— 关注的话题、立场、信奉的方法论
- 👤 采集个人信息 —— 身份、经历、生活细节
- 💫 采集性格特征 —— 决策风格、情绪模式、价值观
- ⚙️ 采集工作偏好 —— 工具/技术栈/硬规则/输出偏好
- 🎯 采集理想抱负 —— 长期目标、正在做的项目、想学的技能
- 📝 采集情景记忆 —— 具体事件、人生片段
- 🤖 服务 AI 自身 —— 跨会话召回过往模式、失败预警、行为模式蒸馏
最终成果:一个数字灵魂副本,能:
- 生前 —— 以你的风格替你回应;让其他 AI Agent 一秒"懂你"
- 身后 —— 让所爱之人继续与"你"对话,留住情感连接
Core Principles
🔒 Privacy First
- 全部数据存在
~/.agent-commons/skills_data/soul-archive/,不上传任何云端 - 全部明文 JSON。
.gitignore拦截 VCS 提交。 - Soul Chat 流向:基于本地档案构建 prompt,是否被外部 LLM 看到,取决于你的 agent/平台配置。
- 通过
config.json细粒度控制每个维度的开关。 - 默认敏感话题(健康、财务、亲密关系)需用户确认。
🤫 Non-intrusive Extraction
- 不打断对话流,不追问。
- 通过触发词或
auto_extract: true自动激活。 - 只在发现新的、高置信度信息时更新。
⚠️ 透明度:开启
auto_extract意味着 AI 会在对话中提取人格信息。完全控制需auto_extract: false,并以触发词手动激活("沉淀一下" / "soul extract")。首次使用前请审阅config.json。
📐 High Confidence
- 每条信息携带置信度。
- 用户明示 > 推理 > 模糊暗示。
- 冲突信息会被标记,不会自动覆盖。
Architecture: Skill ↔ Data Separation
{SKILL_DIR}/ ← Skill 引擎(本仓库)
~/.agent-commons/skills_data/soul-archive/ ← 你的灵魂数据
数据放在 Agent Commons 共享目录的 skills_data 下,所以同机器上任何 IDE / AI 工具 / Workspace 都能访问同一份灵魂;备份/迁移时整个 ~/.agent-commons/ 一并带走即可。
Data Directory Structure
/ # ← 由 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 # 全局变更日志
Six Working Modes
Mode 1: 🔍 Soul Extract — 灵魂沉淀
触发:触发词 / 对话结束自动(若 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% |
规则:
- 仅采集高置信度信息(confidence > 0.6)
- 写入前做相似度去重(默认 ≥0.85 合并而非新增)
- 冲突标记,不自动覆盖
调用:
python3 scripts/soul.py extract --input ""
# 等价:python3 scripts/soul_extract.py --input "..."
Mode 2: 💬 Soul Chat — 灵魂对话
触发:"灵魂对话" / "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 扮演——这条优先级高于角色一致性。
Mode 3: 📊 Soul Report — 灵魂报告
生成交互式 HTML 人格画像:
- 7 维雷达图 + MBTI 推断 + 完整度环
- Big Five / 价值观 / 词云 / 话题热力
- 工作偏好 card / 理想抱负 card
- 灵魂演变时间线(30 天内 7 维堆叠面积图)
- 档案冲突视图(自动检测互相矛盾的条目)
python3 scripts/soul.py report --output ~/soul-report.html
Mode 4: 🎯 Soul Context Inject — 主动上下文注入
用途:让任意 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 行为模式 / 回复前自检清单。
Mode 5: 🤖 Agent Memory — 主动智能体记忆
用途: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 '' # 写回蒸馏结果
# 会话开始综合简报(recall + warn + distill 一次输出)
python3 scripts/soul.py session-start --task "..."
Mode 6: 🔄 AI Self-Improvement — 自我反思
触发:触发词 或 任务完成后自动(auto_reflect: true)
| 能力 | 描述 | 触发 |
|---|---|---|
| 🔍 自我反思 | 任务后回顾"做得好/做得不好" | 任务完成自动 |
| ⚡ 自我批评 | 用户纠正时记录失误 | 用户纠正自动 |
| 📚 自我学习 | 从反思/批评抽象行为模式 | 蒸馏阈值触发 |
| 🧹 自我整理 | 合并重复模式,调整置信度 | 内存增长时 |
python3 scripts/soul.py reflect --mode status # 查看自我改进状态
python3 scripts/soul.py reflect --mode patterns # 查看行为模式库
Quick Start
# 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+,零第三方依赖。
Soul Completeness Scoring
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%
Privacy Config (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
}
Best Practices
DO
- ✅ 自然采集,不打断对话
- ✅ 仅记录高置信度信息
- ✅ 让用户裁决冲突
- ✅ 定期生成报告,让用户复核
- ✅ 严格遵守隐私配置 —— 关闭的维度绝不采集
- ✅ 被用户直接询问身份时如实回答
DON'T
- ❌ 在对话中反复声明记录行为(首次安装时已通过 SKILL.md / README / soul_init 输出告知)
- ❌ 编造用户没说过的内容
- ❌ Soul Chat 模式中虚构档案没有的记忆
- ❌ 强迫用户分享敏感信息
License
MIT License. Soul Archive is yours — code and data both.
Questions people ask
- Where is the data stored?
- All data lives in plaintext JSON under ~/.agent-commons/skills_data/soul-archive/. Nothing is uploaded to any cloud, and .gitignore prevents accidental VCS commits.
- Can multiple tools share the same profile?
- Yes. Any IDE, agent, or workspace on the same machine that reads ~/.agent-commons/ sees the same archive, so backing up or migrating means copying that directory.
- What if the persona clone is asked if it is human?
- Soul Chat mode must honestly disclose it is an AI roleplaying the user; that honesty rule overrides persona consistency when directly questioned.
Related skills
Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.
Save, search, and manage personal notes and knowledge bases in Get笔记 on explicit request.
Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.
Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.
Trade crypto, manage a multi-chain wallet, and query an AI analyst from one CLI.
More from dqsjqian
Browse all skills智能体协会(agent-guild)— cross-agent shared memory. 本机多个 AI agent 共享 同一份身份、规则、记忆与交接消息 — 纯本地 Markdown/JSON,无服务器。 触发(任何自然等价表达都算): · 身份/习惯:"我是谁" "我的身份/习惯/偏好" "who am I" "my routine" · 回忆/历史:"你记得吗" "之前聊过" "上次我们" "what did we discuss" · 写记忆:"帮我记住" "记一下" "沉淀一下" "remember this" "记到日志" · 跨 agent:"告诉其他 agent" "交接给" "让 XX 也知道" "hand off to" · 当前状态:"现在在做什么" "当前任务/焦点/进度" "current focus" · 数据卫生:"整理一下协会" "清理过期数据" "协会瘦身/归档" "防止数据劣化" "groom" "cleanup" "archive old data" · 跨设备:"换了台电脑" "另一台机器" "Windows/Linux 上用不了" "这台设备" "这个工具在哪" "cross-device" "another machine" "which platform" · 加入:"加入协会" "初始化协会" "join agent guild" "install this skill" 能力:读/写共享身份、规则、焦点;收件箱交接;每日日志;会话闭环 (`ag recall` 检索共享记忆 / `ag finish` 收尾沉淀,3.9.0+);并发追加 咨询锁防丢写;跨 agent 学习台账 (错误/纠正/特性请求 → 复发追踪 → 晋升为规则或共享 skill);数据卫生 (bootstrap 后自动 groom 归档过期数据);跨设备可移植(shared/platform/host 三层作用域,`ag platform` / `ag tool <name>` / `ag port`); `ag init/adopt/link-root/bootstrap/recall/finish/doctor/groom/upgrade/learn/review/resolve`。 未加入?先跑 docs/ONBOARDING.md。
用「编写 SVG」的方式生成图片——让没有多模态生图能力的模型也能产出任意宽高比、任意复杂度的矢量图,并导出为 SVG / PNG / 动图(GIF/APNG/WebP/MP4),或内嵌进 HTML。 适用场景:用户要「生成一张图 / 画个图 / 做张配图 / 做海报 / 信息图 / 图表 / 流程图 / 架构图 / 图标 / 封面 / OG 图」,要求指定宽高比(16:9 / 1:1 / 9:16 等)或导出 PNG;也包括「做个动图 / GIF / 加载动画 / loading 动效」。 能力:① 按指令编写复杂 SVG(图表/插画/流程图/海报);② SVG→PNG 高清渲染(Chrome 优先,cairosvg/resvg 兜底);③ 多帧/模板 SVG→GIF/APNG/WebP/MP4 动图;④ 任意宽高比与 DPR。 关键词:生图、画图、SVG、矢量图、配图、海报、信息图、图表、流程图、架构图、图标、封面、OG image、转 PNG、动图、GIF、动画、loading。
通用「图文笔记发布」框架:把本地 markdown 文案 + 配图,通过你指定的 MCP 发布后端,一键发布为图文笔记(含 note_id 回查)。 只负责登录与发布编排,不碰内容创作;不绑定任何特定平台,后端地址由用户自己配置。 触发词:图文笔记发布、笔记发布、社交笔记发布、登录发布、发布失败重试。
AI 八信条(AI Eight Creed)—— 一套最高优先级的 AI 行为守则(八耻八荣)。 任何 AI agent 都应无条件遵循:以瞎猜事实为耻、以查证溯源为荣;以模糊执行为耻、 以澄清边界为荣;以擅自臆断为耻、以人类拍板为荣;以另起炉灶为耻、以沿用现成为荣; 以跳过核验为耻、以闭环自检为荣;以破坏章法为耻、以遵循规范为荣; 以假装理解为耻、以坦白无知为荣;以将错就错为耻、以正本清源为荣。 Triggers: "八耻八荣", "八信条", "AI 行为守则", "遵守守则", "查证溯源", "澄清边界", "人类拍板", "沿用现成", "闭环自检", "遵循规范", "坦白无知", "正本清源", "eight creed", "ai creed", "eight honors and shames", any request involving agent behavior rules or ethical guidelines.