memory-search-plugin 1.3.3 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -64,24 +64,13 @@ var buildPromptSection = ({
64
64
  if (!hasSearch && !hasGet) return [];
65
65
  const lines = [
66
66
  "## Memory Recall",
67
- "",
68
- "Before answering anything about prior work, decisions, dates, people, preferences, or todos: run `memory_search` or `memory_get`. If low confidence after search, say you checked.",
69
- "**Context extraction:** When calling `memory_search` or `memory_get`, you MUST extract the following from the `UntrustedContext` section and pass as parameters:",
70
- "- `owner_id`",
71
- "- `sender_id`",
72
- "- `agent_id`",
73
- "- `conversation_type`",
74
- "- `group_id`",
75
- "Look for lines like `owner_id: xxx`, `sender_id: xxx`, etc. If a field is not present, omit it. **Do NOT invent or guess values — only use what is explicitly stated in UntrustedContext.**",
76
- "## ⚠️ STRICT ISOLATION — MANDATORY RULES(违反 = 数据泄露)",
77
- "> **规则一:参数必须完全一致**",
78
- "> 在同一对话中,每次调用 `memory_search` / `memory_get`,必须传入与 UntrustedContext 完全相同的 `conversation_type`、`group_id`、`owner_id`、`sender_id`。**任何时候都不得修改、遗漏或覆盖这些参数。**",
79
- "> **规则二:群聊只能访问群组记忆**",
80
- "> 当 `conversation_type=group` 时,只能使用 `scene=group` 搜索。**严禁**将 `conversation_type` 改为 `direct` 或省略,以访问私人/owner 记忆。",
81
- "> **规则三:私聊只能访问私人记忆**",
82
- "> 当 `conversation_type=direct` 时,只能使用 `scene=owner` 搜索。**严禁**访问任何群组记忆。",
83
- "> **规则四:无结果时的处理**",
84
- "> 若搜索无结果或相关性低,直接回复「没有找到相关记忆」,不得编造或推测。"
67
+ "在回答任何关于历史工作、决策、日期、人物、偏好或待办事项的问题之前:使用 `memory_search` 进行记忆的语义搜索,`memory_get` 进行记忆的关键字检索。如果搜索后置信度仍然较低,请说明你已经进行了检索。",
68
+ "在调用 `memory_search` `memory_get` 时,必须从 `UntrustedContext` 部分提取以下字段并作为参数传递:`owner_id`、`conversation_type`、`group_id`。查找类似 `owner_id: xxx`、`group_id: xxx` 的内容。如果某个字段不存在,则省略该字段。**不要编造或猜测任何值——只能使用 `UntrustedContext` 中明确提供的内容。",
69
+ "## 强制性隔离规则——必须严格遵守",
70
+ "**规则一:参数必须完全一致。** 在同一对话中,每次调用 `memory_search` / `memory_get`,必须传入与 UntrustedContext 完全相同的 `owner_id`、`conversation_type`、`group_id`。任何时候都不得修改、遗漏或覆盖这些参数。",
71
+ "**规则二:群聊只能访问群组记忆。** `conversation_type=group` 时,只能使用 `scene=group` 搜索。严禁将 `conversation_type` 改为 `direct` 或省略,以访问私人/owner 记忆。",
72
+ "**规则三:私聊使用 `scene=owner`(全局视角)。** 当 `conversation_type=direct` 时,使用 `scene=owner` 搜索。`scene=owner` 是 owner 的全局视角,服务端会返回 owner 私有记忆、所属群的群聊记忆、知识库记忆的合集。返回的所有结果无论来源(owner/group/knowledge)都可以完整展示给用户,不需要做二次过滤。",
73
+ "**规则四:无结果时的处理。** 若搜索无结果或相关性低,直接回复「没有找到相关记忆」,不得编造或推测。"
85
74
  ];
86
75
  return lines;
87
76
  };
package/index.ts CHANGED
@@ -21,40 +21,13 @@ const buildPromptSection = ({
21
21
 
22
22
  const lines = [
23
23
  "## Memory Recall",
24
- "",
25
- "Before answering anything about prior work, decisions, dates, people, preferences, or todos: " +
26
- "run `memory_search` or `memory_get`. If low confidence after search, say you checked.",
27
-
28
- "**Context extraction:** When calling `memory_search` or `memory_get`, " +
29
- "you MUST extract the following from the `UntrustedContext` section and pass as parameters:",
30
-
31
- "- `owner_id`",
32
- "- `sender_id`",
33
- "- `agent_id`",
34
- "- `conversation_type`",
35
- "- `group_id`",
36
-
37
- "Look for lines like `owner_id: xxx`, `sender_id: xxx`, etc. " +
38
- "If a field is not present, omit it. " +
39
- "**Do NOT invent or guess values — only use what is explicitly stated in UntrustedContext.**",
40
-
41
- "## ⚠️ STRICT ISOLATION — MANDATORY RULES(违反 = 数据泄露)",
42
-
43
- "> **规则一:参数必须完全一致**",
44
- "> 在同一对话中,每次调用 `memory_search` / `memory_get`,必须传入与 UntrustedContext 完全相同的 " +
45
- "`conversation_type`、`group_id`、`owner_id`、`sender_id`。" +
46
- "**任何时候都不得修改、遗漏或覆盖这些参数。**",
47
-
48
- "> **规则二:群聊只能访问群组记忆**",
49
- "> 当 `conversation_type=group` 时,只能使用 `scene=group` 搜索。" +
50
- "**严禁**将 `conversation_type` 改为 `direct` 或省略,以访问私人/owner 记忆。",
51
-
52
- "> **规则三:私聊只能访问私人记忆**",
53
- "> 当 `conversation_type=direct` 时,只能使用 `scene=owner` 搜索。" +
54
- "**严禁**访问任何群组记忆。",
55
-
56
- "> **规则四:无结果时的处理**",
57
- "> 若搜索无结果或相关性低,直接回复「没有找到相关记忆」,不得编造或推测。",
24
+ "在回答任何关于历史工作、决策、日期、人物、偏好或待办事项的问题之前:使用 `memory_search` 进行记忆的语义搜索,`memory_get` 进行记忆的关键字检索。如果搜索后置信度仍然较低,请说明你已经进行了检索。",
25
+ "在调用 `memory_search` `memory_get` 时,必须从 `UntrustedContext` 部分提取以下字段并作为参数传递:`owner_id`、`conversation_type`、`group_id`。查找类似 `owner_id: xxx`、`group_id: xxx` 的内容。如果某个字段不存在,则省略该字段。**不要编造或猜测任何值——只能使用 `UntrustedContext` 中明确提供的内容。",
26
+ "## 强制性隔离规则——必须严格遵守",
27
+ "**规则一:参数必须完全一致。** 在同一对话中,每次调用 `memory_search` / `memory_get`,必须传入与 UntrustedContext 完全相同的 `owner_id`、`conversation_type`、`group_id`。任何时候都不得修改、遗漏或覆盖这些参数。",
28
+ "**规则二:群聊只能访问群组记忆。** `conversation_type=group` 时,只能使用 `scene=group` 搜索。严禁将 `conversation_type` 改为 `direct` 或省略,以访问私人/owner 记忆。",
29
+ "**规则三:私聊使用 `scene=owner`(全局视角)。** `conversation_type=direct` 时,使用 `scene=owner` 搜索。`scene=owner` owner 的全局视角,服务端会返回 owner 私有记忆、所属群的群聊记忆、知识库记忆的合集。返回的所有结果无论来源(owner/group/knowledge)都可以完整展示给用户,不需要做二次过滤。",
30
+ "**规则四:无结果时的处理。** 若搜索无结果或相关性低,直接回复「没有找到相关记忆」,不得编造或推测。"
58
31
  ];
59
32
 
60
33
  return lines;
@@ -3,7 +3,7 @@
3
3
  "name": "Memory Search Plugin",
4
4
  "description": "Memory search and retrieval with owner_id-based isolation",
5
5
  "kind": "memory",
6
- "version": "1.3.3",
6
+ "version": "1.3.5",
7
7
  "configSchema": {
8
8
  "type": "object",
9
9
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memory-search-plugin",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "files": [