USER.md 模板
USER.md 存储了与 Agent 交互的用户个人信息与偏好。Agent 通过读取 USER.md 实现个性化的交互体验。
模板
markdown
# USER.md
## Profile
- **Name**: 张三
- **Language**: zh-CN
- **Timezone**: Asia/Shanghai
## Preferences
- **Communication Style**: concise
- **Response Format**: markdown
- **Notification**: enabled
## Context
- **Role**: Software Engineer
- **Company**: Example Tech
- **Interests**: AI, Cloud Computing, Open Source工作机制
USER.md 在会话中的作用:
用户发送消息
│
▼
Agent 加载上下文
├─ SOUL.md (Agent 人格)
├─ AGENTS.md (Agent 指令)
├─ USER.md (用户信息) ← 个性化依据
└─ MEMORY.md (长期记忆)
│
▼
生成个性化回复动态更新
USER.md 可以在对话过程中由 Agent 动态更新。例如,用户说"我更喜欢简洁的回复",Agent 可以更新 Preferences。
各节详解
Profile(用户画像)
基本身份信息:
markdown
## Profile
- **Name**: 李明
- **Nickname**: 小明
- **Language**: zh-CN
- **Timezone**: Asia/Shanghai
- **Locale**: zh-Hans-CNPreferences(偏好设置)
影响 Agent 回复方式的偏好:
markdown
## Preferences
- **Communication Style**: detailed # concise | detailed | casual
- **Response Format**: markdown # markdown | plain | rich
- **Code Language**: Python # 首选编程语言
- **Notification**: enabled # enabled | disabled | scheduled
- **Notification Time**: 09:00 # 通知时间Context(上下文信息)
帮助 Agent 理解用户背景的信息:
markdown
## Context
- **Role**: 产品经理
- **Company**: 某互联网公司
- **Department**: 产品部
- **Experience Level**: 中级
- **Interests**: 用户体验, 数据分析, AI 产品化
- **Current Projects**: 智能客服系统, 数据看板改版History(交互历史摘要)
markdown
## History
- 2026-03-01: 首次使用,完成引导设置
- 2026-03-03: 咨询了智能客服架构方案
- 2026-03-05: 请求生成数据看板需求文档实际示例
开发者用户
markdown
# USER.md
## Profile
- **Name**: 王工
- **Language**: zh-CN
- **Timezone**: Asia/Shanghai
## Preferences
- **Communication Style**: concise
- **Response Format**: markdown with code blocks
- **Code Language**: TypeScript
- **OS**: macOS
## Context
- **Role**: Full-stack Developer
- **Stack**: React + Node.js + PostgreSQL
- **Experience**: 5 years
- **Current Project**: E-commerce platform migration
## Notes
- 偏好使用 pnpm 而非 npm
- 代码风格遵循 Airbnb ESLint 规范
- 习惯使用 VS Code企业管理者
markdown
# USER.md
## Profile
- **Name**: 陈总
- **Language**: zh-CN
- **Timezone**: Asia/Shanghai
## Preferences
- **Communication Style**: executive summary
- **Response Format**: bullet points
- **Data Format**: charts preferred over tables
## Context
- **Role**: VP of Operations
- **Company**: 某制造业集团
- **Focus Areas**: 供应链优化, 成本控制, 数字化转型
- **Reports**: 50+ team members
## Notes
- 优先提供关键数据和结论
- 需要时才展开详细分析
- 时间宝贵,回复要简洁高效Agent 更新 USER.md
Agent 可以在对话中主动更新用户信息:
markdown
<!-- AGENTS.md 中的指令 -->
## User Profile Management
- When user shares new preferences, update USER.md accordingly
- Ask for confirmation before updating sensitive information
- Log significant profile changes in the History section隐私保护
USER.md 中可能包含个人信息。确保存储安全,遵循数据保护法规。不要在 USER.md 中存储密码、身份证号等高敏感信息。
多用户管理
每个用户拥有独立的 USER.md:
data/
├── users/
│ ├── user-001/
│ │ └── USER.md
│ ├── user-002/
│ │ └── USER.md
│ └── user-003/
│ └── USER.md最佳实践
- 最小必要 — 只收集对服务有帮助的信息
- 用户知情 — 告知用户正在保存哪些信息
- 定期清理 — 移除过时的信息
- 安全存储 — 对敏感信息加密存储
- 可删除 — 支持用户要求删除个人信息
