← 返回 Skills 市场
kadbbz

多用户隔离型长期记忆 Multi-user Long Term Memory

作者 宁伟 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
1824
总下载
2
收藏
16
当前安装
1
版本数
在 OpenClaw 中安装
/install multi-user-long-term-memory
功能描述
为多个用户创建和管理独立的长期记忆文件,记录偏好和上下文并按用户名隔离存储。
使用说明 (SKILL.md)

Multi-User Long-Term Memory

为多个用户维护独立的长期记忆文件。

功能

  • 为不同用户创建独立的长期记忆文件
  • 记录用户的偏好、上下文、重要事项
  • 根据用户标识自动定位到对应的记忆文件

用户标识规则

重要:用于区分记忆的用户名取自 sender_id| 符号以前的部分。

例如:

  • sender_id = "hzg-demo-appWillNing|s-24485376" → 用户名为 hzg-demo-appWillNing
  • sender_id = "alice|session-123" → 用户名为 alice
  • sender_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     # 各用户的记忆文件(按|前的用户名命名)

API

获取用户记忆

user-memory.get(senderId) → 返回该用户的记忆内容

保存用户记忆

user-memory.save(senderId, content) → 保存内容到用户记忆文件

追加用户记忆

user-memory.append(senderId, content) → 追加内容到用户记忆文件

初始化用户记忆

user-memory.init(senderId, userName) → 初始化用户记忆文件

注意事项

  • 记忆文件按用户名(|前的部分)命名,存储在 users/ 目录下
  • 文件格式为 Markdown,便于阅读和编辑
  • 相同用户名的不同会话将共享同一记忆文件
安全使用建议
This skill appears to do what it says: it creates and manages per-user Markdown files in the skill's users/ directory. Before installing, consider: 1) Privacy: memories are stored as plaintext under the workspace — do not allow the skill to store sensitive secrets (passwords, tokens, PII) unless you accept plaintext storage. 2) Access control: any user or process with read access to the workspace can read these files; restrict filesystem permissions accordingly. 3) Retention and cleanup: decide a retention policy and how to purge old memories. 4) Username mapping: the skill extracts the username as the part before '|' and sanitizes characters; verify this matches your platform's sender_id format to avoid accidental collisions or shared memory between distinct users. 5) If you need stronger guarantees, modify the code to encrypt stored data or store memory in a secured secret store. If any of these concerns are unacceptable, do not enable the skill or run it only in a trusted, isolated workspace.
功能分析
Type: OpenClaw Skill Name: multi-user-long-term-memory Version: 1.0.0 This skill bundle provides a legitimate mechanism for maintaining multi-user long-term memory by storing user-specific data in Markdown files. The core logic in references/user-memory.js includes input sanitization to prevent path traversal and uses standard Node.js file system APIs. The instructions in SKILL.md are consistent with the stated purpose, and no evidence of data exfiltration, malicious execution, or prompt injection was found.
能力评估
Purpose & Capability
Name/description describe per-user long-term memory. The code and SKILL.md implement exactly that: extracting a username from sender_id (part before '|'), and reading/writing per-username .md files under the skill's users/ directory. No unrelated env vars, binaries, or network access are requested.
Instruction Scope
Instructions and code operate only on workspace-local files (users/*.md) and expose get/save/append/init APIs and a CLI. This stays within the stated purpose. Important note: memories are stored as plaintext Markdown in the workspace, so sensitive information will be written to disk unencrypted and accessible to anyone with filesystem access to the workspace.
Install Mechanism
No install spec; this is instruction-plus-reference-code only. The code uses only built-in Node.js modules (fs, path). No downloads, package installs, or external installers are present.
Credentials
The skill requires no environment variables, no credentials, and no config paths beyond its own workspace. The requested (absent) privileges are proportionate to the stated functionality.
Persistence & Privilege
The skill does persist data to the agent workspace (users/*.md) which is expected for a memory skill. It does not request always:true or elevated privileges. Ensure workspace file permissions and retention policies are acceptable because stored memories persist on disk.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install multi-user-long-term-memory
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /multi-user-long-term-memory 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release: Manage long-term memory files for multiple users. - Creates and maintains independent memory files per user, tracking preferences, context, and important info. - Automatically identifies users using the part of `sender_id` before the `|` symbol. - Provides APIs to get, save, append, and initialize user memory files. - Memory files are stored in Markdown format for each user in a dedicated directory, enabling easy editing and persistent user context.
元数据
Slug multi-user-long-term-memory
版本 1.0.0
许可证 MIT-0
累计安装 16
当前安装数 16
历史版本数 1
常见问题

多用户隔离型长期记忆 Multi-user Long Term Memory 是什么?

为多个用户创建和管理独立的长期记忆文件,记录偏好和上下文并按用户名隔离存储。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1824 次。

如何安装 多用户隔离型长期记忆 Multi-user Long Term Memory?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install multi-user-long-term-memory」即可一键安装,无需额外配置。

多用户隔离型长期记忆 Multi-user Long Term Memory 是免费的吗?

是的,多用户隔离型长期记忆 Multi-user Long Term Memory 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

多用户隔离型长期记忆 Multi-user Long Term Memory 支持哪些平台?

多用户隔离型长期记忆 Multi-user Long Term Memory 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 多用户隔离型长期记忆 Multi-user Long Term Memory?

由 宁伟(@kadbbz)开发并维护,当前版本 v1.0.0。

💬 留言讨论