Install
openclaw skills install multi-user-long-term-memory为多个用户创建和管理独立的长期记忆文件,记录偏好和上下文并按用户名隔离存储。
openclaw skills install multi-user-long-term-memory为多个用户维护独立的长期记忆文件。
重要:用于区分记忆的用户名取自 sender_id 中 | 符号以前的部分。
例如:
sender_id = "hzg-demo-appWillNing|s-24485376" → 用户名为 hzg-demo-appWillNingsender_id = "alice|session-123" → 用户名为 alicesender_id = "bob_channel|xyz" → 用户名为 bob_channel当需要:
~/.openclaw/workspace/skills/multi-user-long-term-memory/
├── SKILL.md
├── README.md
├── references/
│ └── user-memory.js # 记忆管理逻辑
└── users/
└── {username}.md # 各用户的记忆文件(按|前的用户名命名)
user-memory.get(senderId) → 返回该用户的记忆内容
user-memory.save(senderId, content) → 保存内容到用户记忆文件
user-memory.append(senderId, content) → 追加内容到用户记忆文件
user-memory.init(senderId, userName) → 初始化用户记忆文件