memory-search-plugin 1.3.8 → 1.3.10
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 +7 -7
- package/index.ts +7 -7
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -58,7 +58,7 @@ var buildPromptSection = ({
|
|
|
58
58
|
if (!hasSearch && !hasGet) return [];
|
|
59
59
|
const lines = [
|
|
60
60
|
"在回答任何关于历史工作、决策、日期、人物、偏好或待办事项的问题之前:使用 `memory_search` 对记忆进行语义搜索,`memory_get` 对记忆进行关键字检索。如果搜索后置信度仍然较低,请说明你已经进行了检索。",
|
|
61
|
-
"调用 `memory_search` 或 `memory_get` 时,必须从 `UntrustedContext` 中原样提取 `owner_id`、`agent_id`、`group_id` 作为参数传递,不要编造、猜测、省略任何值,只使用 UntrustedContext 中实际存在的字段。"
|
|
61
|
+
"调用 `memory_search` 或 `memory_get` 时,必须从 `UntrustedContext` 中原样提取 `owner_id`、`agent_id`、`group_id` 作为参数传递,不要编造、猜测、省略任何值,只使用 UntrustedContext 中实际存在的字段。",
|
|
62
62
|
"如果 `UntrustedContext`中存在 `group_id` 字段,必须提取原 `group_id` 参数,禁止省略 `group_id` 字段 ;如果 `UntrustedContext` 中不存在 `group_id` 字段,则不传该参数。"
|
|
63
63
|
];
|
|
64
64
|
return lines;
|
|
@@ -106,11 +106,11 @@ var index_default = definePluginEntry({
|
|
|
106
106
|
},
|
|
107
107
|
maxResults: {
|
|
108
108
|
type: "number",
|
|
109
|
-
description: "Max results (default
|
|
109
|
+
description: "Max results (default 10)"
|
|
110
110
|
},
|
|
111
111
|
minScore: {
|
|
112
112
|
type: "number",
|
|
113
|
-
description: "Min similarity score 0-1 (default 0.
|
|
113
|
+
description: "Min similarity score 0-1 (default 0.5)"
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
required: ["query"]
|
|
@@ -137,8 +137,8 @@ var index_default = definePluginEntry({
|
|
|
137
137
|
query,
|
|
138
138
|
scene: identity.scene,
|
|
139
139
|
group_id: identity.group_id,
|
|
140
|
-
limit: params.maxResults ||
|
|
141
|
-
threshold: params.minScore || 0.
|
|
140
|
+
limit: params.maxResults || 10,
|
|
141
|
+
threshold: params.minScore || 0.5
|
|
142
142
|
});
|
|
143
143
|
const text = data.results.length === 0 ? "No relevant memories found." : data.results.map((r, i) => {
|
|
144
144
|
const tag = r.memory_type === "group" && r.group_id ? `group/${r.group_id}` : r.memory_type === "knowledge" && r.kb_id ? `knowledge/${r.kb_id}` : r.memory_type;
|
|
@@ -189,7 +189,7 @@ ${r.content}`;
|
|
|
189
189
|
},
|
|
190
190
|
limit: {
|
|
191
191
|
type: "number",
|
|
192
|
-
description: "Max messages to return (default
|
|
192
|
+
description: "Max messages to return (default 10)"
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
195
|
required: ["keyword"]
|
|
@@ -216,7 +216,7 @@ ${r.content}`;
|
|
|
216
216
|
keyword,
|
|
217
217
|
scene: identity.scene,
|
|
218
218
|
group_id: identity.group_id,
|
|
219
|
-
limit: params.limit ||
|
|
219
|
+
limit: params.limit || 10
|
|
220
220
|
});
|
|
221
221
|
if (data.messages.length === 0) {
|
|
222
222
|
return {
|
package/index.ts
CHANGED
|
@@ -21,7 +21,7 @@ const buildPromptSection = ({
|
|
|
21
21
|
|
|
22
22
|
const lines = [
|
|
23
23
|
"在回答任何关于历史工作、决策、日期、人物、偏好或待办事项的问题之前:使用 `memory_search` 对记忆进行语义搜索,`memory_get` 对记忆进行关键字检索。如果搜索后置信度仍然较低,请说明你已经进行了检索。",
|
|
24
|
-
"调用 `memory_search` 或 `memory_get` 时,必须从 `UntrustedContext` 中原样提取 `owner_id`、`agent_id`、`group_id` 作为参数传递,不要编造、猜测、省略任何值,只使用 UntrustedContext 中实际存在的字段。"
|
|
24
|
+
"调用 `memory_search` 或 `memory_get` 时,必须从 `UntrustedContext` 中原样提取 `owner_id`、`agent_id`、`group_id` 作为参数传递,不要编造、猜测、省略任何值,只使用 UntrustedContext 中实际存在的字段。",
|
|
25
25
|
"如果 `UntrustedContext`中存在 `group_id` 字段,必须提取原 `group_id` 参数,禁止省略 `group_id` 字段 ;如果 `UntrustedContext` 中不存在 `group_id` 字段,则不传该参数。"
|
|
26
26
|
];
|
|
27
27
|
|
|
@@ -82,11 +82,11 @@ export default definePluginEntry({
|
|
|
82
82
|
},
|
|
83
83
|
maxResults: {
|
|
84
84
|
type: "number" as const,
|
|
85
|
-
description: "Max results (default
|
|
85
|
+
description: "Max results (default 10)",
|
|
86
86
|
},
|
|
87
87
|
minScore: {
|
|
88
88
|
type: "number" as const,
|
|
89
|
-
description: "Min similarity score 0-1 (default 0.
|
|
89
|
+
description: "Min similarity score 0-1 (default 0.5)",
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
92
|
required: ["query"],
|
|
@@ -128,8 +128,8 @@ export default definePluginEntry({
|
|
|
128
128
|
query,
|
|
129
129
|
scene: identity.scene,
|
|
130
130
|
group_id: identity.group_id,
|
|
131
|
-
limit: params.maxResults ||
|
|
132
|
-
threshold: params.minScore || 0.
|
|
131
|
+
limit: params.maxResults || 10,
|
|
132
|
+
threshold: params.minScore || 0.5,
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
const text =
|
|
@@ -194,7 +194,7 @@ export default definePluginEntry({
|
|
|
194
194
|
},
|
|
195
195
|
limit: {
|
|
196
196
|
type: "number" as const,
|
|
197
|
-
description: "Max messages to return (default
|
|
197
|
+
description: "Max messages to return (default 10)",
|
|
198
198
|
},
|
|
199
199
|
},
|
|
200
200
|
required: ["keyword"],
|
|
@@ -235,7 +235,7 @@ export default definePluginEntry({
|
|
|
235
235
|
keyword,
|
|
236
236
|
scene: identity.scene,
|
|
237
237
|
group_id: identity.group_id,
|
|
238
|
-
limit: params.limit ||
|
|
238
|
+
limit: params.limit || 10,
|
|
239
239
|
});
|
|
240
240
|
|
|
241
241
|
if (data.messages.length === 0) {
|
package/openclaw.plugin.json
CHANGED