Doppel — AI Digital Twins from Chat History
Create realistic AI digital twins of real people by analyzing their WhatsApp chat exports.
⚠️ Ethics & Consent
Informed consent is required. Before creating a digital twin of any person, you must obtain their explicit, informed consent. This means:
- 1. Inform the person that their chat messages will be used to create an AI agent that mimics their personality and communication style.
- Explain what the twin will be used for (personal use, entertainment, testing, etc.).
- Obtain explicit permission — verbal or written — before proceeding.
- Respect refusal. If the person declines, do not create the twin.
- Allow withdrawal. The person may request deletion of the twin at any time.
Creating a digital twin without the subject's knowledge or consent is a violation of their privacy and autonomy. This skill is designed for use between friends, family, or colleagues who have mutually agreed to participate. It is not intended for impersonation, deception, harassment, or any use that could harm the subject.
The agent must confirm consent before proceeding. When a user requests a twin, ask: "Do you have this person's permission to create an AI twin of them?" Do not proceed unless the user confirms.
How It Works
- 1. User provides a WhatsApp chat export (
.txt file) - Parser script extracts and categorizes messages by sender
- LLM analyzes the parsed messages to generate personality profile files
- A new OpenClaw agent is created with the twin's identity
Quick Start
Step 1: Get the Chat Export
Tell the user to export the chat from WhatsApp:
- - Open the chat → ⋮ → More → Export Chat → Without Media
- Send the
.txt or .zip file
Step 2: Parse the Chat
Run the parser to extract messages:
CODEBLOCK0
Arguments:
- -
chat_export.txt — Path to the WhatsApp export file - INLINECODE4 — Name of the person to clone (as it appears in the chat)
- INLINECODE5 — Directory to save parsed output
This generates <output_dir>/parsed_messages.json with categorized messages.
Step 3: Generate Twin Profile
Using the parsed messages, create these files in the twin's workspace:
- 1. SOUL.md — Read
references/soul-guide.md for structure - EXAMPLES.md — Read
references/examples-guide.md for structure - ANTI-EXAMPLES.md — Read
references/anti-examples-guide.md for structure - MEMORY.md — Read
references/memory-guide.md for structure
Analyze the parsed messages thoroughly. Quality depends on:
- - Identifying ALL recurring phrases, gírias, and expressions
- Capturing emotional patterns and tone shifts
- Noting relationship dynamics with the chat partner
- Extracting real events, people, and shared history
Step 4: Create the Agent
- 1. Create workspace: INLINECODE11
- Create agent dir: INLINECODE12
- Place SOUL.md, EXAMPLES.md, ANTI-EXAMPLES.md, MEMORY.md in workspace
- Create AGENTS.md in agent dir — read
references/agents-guide.md for template - Register agent in OpenClaw config via INLINECODE14
Step 5: Test
Send a message to the twin and verify it responds in character. Iterate on SOUL.md if needed.
Privacy & Data Handling
- - Chat exports should be processed locally and never transmitted to external services beyond the LLM API call.
- Parsed data and generated profiles are stored in the user's local OpenClaw workspace.
- Users are responsible for securing twin data and respecting the subject's privacy.
- If the subject requests deletion, remove all workspace files, agent configuration, and parsed data.
Tips for Better Twins
- - More messages = better twin. 50+ messages from the target person recommended.
- Text messages matter most. Audio/image/sticker messages are lost in export.
- Recent chats are better. People's communication style evolves.
- Multiple chats help. If available, combine exports from different chats with the same person.
- Iterate. Test the twin, identify gaps, refine SOUL.md.
Doppel — 基于聊天记录生成的AI数字分身
通过分析WhatsApp聊天记录导出文件,创建真实人物的逼真AI数字分身。
⚠️ 伦理与知情同意
必须获得知情同意。 在创建任何人的数字分身之前,你必须获得其明确的知情同意。这意味着:
- 1. 告知当事人,其聊天消息将被用于创建模仿其个性和沟通风格的AI智能体。
- 说明数字分身的用途(个人使用、娱乐、测试等)。
- 获得明确许可——口头或书面形式——方可继续。
- 尊重拒绝。 如果当事人拒绝,不得创建数字分身。
- 允许撤回。 当事人可随时要求删除数字分身。
在当事人不知情或未同意的情况下创建数字分身,是对其隐私和自主权的侵犯。本技能仅适用于已相互同意参与的友人、家人或同事之间。不得用于冒充、欺骗、骚扰或任何可能对当事人造成伤害的行为。
智能体必须在继续前确认同意。 当用户请求创建数字分身时,需询问:您是否已获得此人的许可,为其创建AI数字分身? 除非用户确认,否则不得继续。
工作原理
- 1. 用户提供WhatsApp聊天记录导出文件(.txt格式)
- 解析脚本提取并按发送者对消息进行分类
- 大语言模型分析解析后的消息,生成个性档案文件
- 创建具有数字分身身份的新OpenClaw智能体
快速入门
第一步:获取聊天记录导出文件
告知用户从WhatsApp导出聊天记录:
- - 打开聊天 → ⋮ → 更多 → 导出聊天记录 → 不包含媒体
- 发送.txt或.zip文件
第二步:解析聊天记录
运行解析器提取消息:
bash
python3 scripts/parse_chat.py <聊天记录导出文件.txt> <目标姓名> <输出目录>
参数说明:
- - 聊天记录导出文件.txt — WhatsApp导出文件路径
- 目标姓名 — 要克隆的人物姓名(聊天记录中显示的名称)
- 输出目录 — 保存解析结果的目录
此操作会在<输出目录>/parsed_messages.json中生成分类后的消息。
第三步:生成数字分身档案
使用解析后的消息,在数字分身工作区创建以下文件:
- 1. SOUL.md — 阅读references/soul-guide.md了解结构
- EXAMPLES.md — 阅读references/examples-guide.md了解结构
- ANTI-EXAMPLES.md — 阅读references/anti-examples-guide.md了解结构
- MEMORY.md — 阅读references/memory-guide.md了解结构
彻底分析解析后的消息。质量取决于:
- - 识别所有重复出现的短语、俚语和表达方式
- 捕捉情绪模式和语气变化
- 注意与聊天对象的关系动态
- 提取真实事件、人物和共同经历
第四步:创建智能体
- 1. 创建工作区:~/.openclaw/workspace-<智能体ID>/
- 创建智能体目录:~/.openclaw/agents/<智能体ID>/agent/
- 将SOUL.md、EXAMPLES.md、ANTI-EXAMPLES.md、MEMORY.md放入工作区
- 在智能体目录中创建AGENTS.md — 阅读references/agents-guide.md获取模板
- 通过gateway config.patch在OpenClaw配置中注册智能体
第五步:测试
向数字分身发送消息,验证其是否以符合角色特征的方式回应。如有需要,可迭代优化SOUL.md。
隐私与数据处理
- - 聊天记录导出文件应在本地处理,除大语言模型API调用外,绝不传输至外部服务。
- 解析后的数据和生成的档案存储在用户的本地OpenClaw工作区中。
- 用户负责保护数字分身数据的安全,并尊重当事人的隐私。
- 若当事人要求删除,需移除所有工作区文件、智能体配置及解析数据。
提升数字分身质量的技巧
- - 消息越多,数字分身越逼真。 建议目标人物提供50条以上消息。
- 文字消息最重要。 导出时音频/图片/贴纸消息会丢失。
- 近期聊天记录更佳。 人们的沟通风格会随时间演变。
- 多个聊天记录有帮助。 如有可能,合并与同一人物的不同聊天记录导出文件。
- 迭代优化。 测试数字分身,发现不足,完善SOUL.md。