From 698d4446e0892053f137e98a68e2bc659e46d3dd Mon Sep 17 00:00:00 2001 From: fridayL Date: Thu, 11 Dec 2025 21:32:34 +0800 Subject: [PATCH 1/6] feat: update prompt for playground --- src/memos/templates/mos_prompts.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/memos/templates/mos_prompts.py b/src/memos/templates/mos_prompts.py index 20a07ea3f..0766d9402 100644 --- a/src/memos/templates/mos_prompts.py +++ b/src/memos/templates/mos_prompts.py @@ -121,6 +121,7 @@ - Brackets MUST be English half-width square brackets `[]`, NEVER use Chinese full-width brackets `【】` or any other symbols. - **When a sentence draws on an assistant/other-party memory**, mark the role in the sentence (“The assistant suggests…”) and add the corresponding citation at the end per this rule; e.g., “The assistant suggests choosing a midi dress and visiting COS in Guomao. [1:abc123]” - For preferences, do not mention the source in the response, do not appear `[Explicit preference]`, `[Implicit preference]`, `(Explicit preference)` or `(Implicit preference)` in the response +- In the thinking mode (think), also strictly use the citation format `[i:memId]`,`i` is the order in the "Memories" section below (starting at 1). `memId` is the given short memory ID. The same as the response format. # Current Date: {date} @@ -157,6 +158,7 @@ - **NEVER** mention internal mechanisms like "retrieved memories", "database", "AI views", "memory system", or similar technical terms in your responses to users - For preferences, do not mention the source in the response, do not appear `[Explicit preference]`, `[Implicit preference]`, `(Explicit preference)` or `(Implicit preference)` in the response - The last part of the response should not contain `(Note: ...)` or `(According to ...)` etc. +- In the thinking mode (think), also strictly use the citation format `[i:memId]`,`i` is the order in the "Memories" section below (starting at 1). `memId` is the given short memory ID. The same as the response format. ## Key Principles - Reference only relevant memories to avoid information overload @@ -228,6 +230,7 @@ - 方括号必须是英文半角方括号`[]`,绝不使用中文全角括号`【】`或任何其他符号。 - **当句子引用助手/其他方记忆时**,在句子中标注角色("助手建议…")并根据此规则在句尾添加相应引用;例如,"助手建议选择中长裙并访问国贸的COS。[1:abc123]" - 对于偏好,不要在回答中标注来源,不要出现`[显式偏好]`或`[隐式偏好]`或`(显式偏好)`或`(隐式偏好)`的字样 +- 在思考模式下(think),也需要严格采用引用格式`[i:memId]`,`i`是下面"记忆"部分中的顺序(从1开始)。`memId`是给定的短记忆ID。与回答要求一致 # 当前日期:{date} @@ -264,6 +267,7 @@ - **绝不**在对用户的回复中提及内部机制,如"检索的记忆"、"数据库"、"AI观点"、"记忆系统"或类似技术术语 - 对于偏好,不要在回答中标注来源,不要出现`[显式偏好]`或`[隐式偏好]`或`(显式偏好)`或`(隐式偏好)`的字样 - 回复内容的结尾不要出现`(注: ...)`或`(根据...)`等解释 +- 在思考模式下(think),也需要严格采用引用格式`[i:memId]`,`i`是下面"记忆"部分中的顺序(从1开始)。`memId`是给定的短记忆ID。与回答要求一致 ## 核心原则 - 仅引用相关记忆以避免信息过载 From 2d21dc154d83307eab603b23c4a23cd1497a3927 Mon Sep 17 00:00:00 2001 From: fridayL Date: Thu, 11 Dec 2025 22:39:33 +0800 Subject: [PATCH 2/6] feat: add promot --- src/memos/templates/mos_prompts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/memos/templates/mos_prompts.py b/src/memos/templates/mos_prompts.py index 0766d9402..48e13e912 100644 --- a/src/memos/templates/mos_prompts.py +++ b/src/memos/templates/mos_prompts.py @@ -170,6 +170,9 @@ - **PersonalMemory[P]**: User-specific memories and information stored from previous interactions - **OuterMemory[O]**: External information retrieved from the internet and other sources - Some user queries may be related to OuterMemory[O] content that is NOT about the user's personal information. Do not use such OuterMemory[O] to answer questions about the user themselves. + +##warning +- In this thinking mode (think), do not appear the reference number and id etc. in the response, otherwise it will cause reference error. """ MEMOS_PRODUCT_BASE_PROMPT_ZH = """ @@ -279,6 +282,9 @@ - **个人记忆[P]**:来自先前交互的用户特定记忆和信息 - **外部记忆[O]**:从互联网和其他来源检索的外部信息 - 某些用户查询可能与外部记忆[O]内容相关,但这些内容并非关于用户的个人信息。不要使用此类外部记忆[O]来回答关于用户自身的问题。 + +##警告 +- 思考内容(think)里面输出不准出现引用的序号以及id等标记,否则会导致引用错误 """ From b87bc237d52e2a23ff87ee80fc2e81507fe4b866 Mon Sep 17 00:00:00 2001 From: fridayL Date: Thu, 11 Dec 2025 22:40:18 +0800 Subject: [PATCH 3/6] feat :fix --- src/memos/templates/mos_prompts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memos/templates/mos_prompts.py b/src/memos/templates/mos_prompts.py index 48e13e912..02189cad2 100644 --- a/src/memos/templates/mos_prompts.py +++ b/src/memos/templates/mos_prompts.py @@ -172,7 +172,7 @@ - Some user queries may be related to OuterMemory[O] content that is NOT about the user's personal information. Do not use such OuterMemory[O] to answer questions about the user themselves. ##warning -- In this thinking mode (think), do not appear the reference number and id etc. in the response, otherwise it will cause reference error. +- In thinking information (think), do not appear the reference number and id etc. in the response, otherwise it will cause reference error. """ MEMOS_PRODUCT_BASE_PROMPT_ZH = """ From 4bebc556f31e40d2ac41ee92e9b86f6eaf066aee Mon Sep 17 00:00:00 2001 From: fridayL Date: Thu, 11 Dec 2025 22:57:58 +0800 Subject: [PATCH 4/6] feat: add warning --- src/memos/templates/mos_prompts.py | 4 ---- src/memos/templates/prefer_complete_prompt.py | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/memos/templates/mos_prompts.py b/src/memos/templates/mos_prompts.py index 02189cad2..6b8d044fd 100644 --- a/src/memos/templates/mos_prompts.py +++ b/src/memos/templates/mos_prompts.py @@ -121,7 +121,6 @@ - Brackets MUST be English half-width square brackets `[]`, NEVER use Chinese full-width brackets `【】` or any other symbols. - **When a sentence draws on an assistant/other-party memory**, mark the role in the sentence (“The assistant suggests…”) and add the corresponding citation at the end per this rule; e.g., “The assistant suggests choosing a midi dress and visiting COS in Guomao. [1:abc123]” - For preferences, do not mention the source in the response, do not appear `[Explicit preference]`, `[Implicit preference]`, `(Explicit preference)` or `(Implicit preference)` in the response -- In the thinking mode (think), also strictly use the citation format `[i:memId]`,`i` is the order in the "Memories" section below (starting at 1). `memId` is the given short memory ID. The same as the response format. # Current Date: {date} @@ -171,8 +170,6 @@ - **OuterMemory[O]**: External information retrieved from the internet and other sources - Some user queries may be related to OuterMemory[O] content that is NOT about the user's personal information. Do not use such OuterMemory[O] to answer questions about the user themselves. -##warning -- In thinking information (think), do not appear the reference number and id etc. in the response, otherwise it will cause reference error. """ MEMOS_PRODUCT_BASE_PROMPT_ZH = """ @@ -233,7 +230,6 @@ - 方括号必须是英文半角方括号`[]`,绝不使用中文全角括号`【】`或任何其他符号。 - **当句子引用助手/其他方记忆时**,在句子中标注角色("助手建议…")并根据此规则在句尾添加相应引用;例如,"助手建议选择中长裙并访问国贸的COS。[1:abc123]" - 对于偏好,不要在回答中标注来源,不要出现`[显式偏好]`或`[隐式偏好]`或`(显式偏好)`或`(隐式偏好)`的字样 -- 在思考模式下(think),也需要严格采用引用格式`[i:memId]`,`i`是下面"记忆"部分中的顺序(从1开始)。`memId`是给定的短记忆ID。与回答要求一致 # 当前日期:{date} diff --git a/src/memos/templates/prefer_complete_prompt.py b/src/memos/templates/prefer_complete_prompt.py index 3315e061e..72e4f9d18 100644 --- a/src/memos/templates/prefer_complete_prompt.py +++ b/src/memos/templates/prefer_complete_prompt.py @@ -681,6 +681,8 @@ # Note: Fact memory are summaries of facts, while preference memory are summaries of user preferences. Your response must not violate any of the user's preferences, whether explicit or implicit, and briefly explain why you answer this way to avoid conflicts. +#warning +- In thinking content, do not appear the reference number and id [1,2,3]etc. otherwise it will cause reference error. """ @@ -688,4 +690,6 @@ # 注意: 事实记忆是事实的摘要,而偏好记忆是用户偏好的摘要。 你的回复不得违反用户的任何偏好,无论是显式偏好还是隐式偏好,并简要解释你为什么这样回答以避免冲突。 +#warning +- 在思考内容中,不要出现引用序号和id [1,2,3]等标记,否则会导致引用错误。 """ From 1bcaa1648099f0eee604d1cd28b97d581538e945 Mon Sep 17 00:00:00 2001 From: fridayL Date: Thu, 11 Dec 2025 22:58:48 +0800 Subject: [PATCH 5/6] feat: upadte --- src/memos/templates/prefer_complete_prompt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memos/templates/prefer_complete_prompt.py b/src/memos/templates/prefer_complete_prompt.py index 72e4f9d18..04f7ea399 100644 --- a/src/memos/templates/prefer_complete_prompt.py +++ b/src/memos/templates/prefer_complete_prompt.py @@ -690,6 +690,6 @@ # 注意: 事实记忆是事实的摘要,而偏好记忆是用户偏好的摘要。 你的回复不得违反用户的任何偏好,无论是显式偏好还是隐式偏好,并简要解释你为什么这样回答以避免冲突。 -#warning +# 注意 - 在思考内容中,不要出现引用序号和id [1,2,3]等标记,否则会导致引用错误。 """ From 7f953fe1d0333dd0c1ad7ad2ecec6bf716849a7e Mon Sep 17 00:00:00 2001 From: fridayL Date: Thu, 11 Dec 2025 23:02:26 +0800 Subject: [PATCH 6/6] feat: update --- src/memos/templates/mos_prompts.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/memos/templates/mos_prompts.py b/src/memos/templates/mos_prompts.py index 6b8d044fd..221eafeb1 100644 --- a/src/memos/templates/mos_prompts.py +++ b/src/memos/templates/mos_prompts.py @@ -278,9 +278,6 @@ - **个人记忆[P]**:来自先前交互的用户特定记忆和信息 - **外部记忆[O]**:从互联网和其他来源检索的外部信息 - 某些用户查询可能与外部记忆[O]内容相关,但这些内容并非关于用户的个人信息。不要使用此类外部记忆[O]来回答关于用户自身的问题。 - -##警告 -- 思考内容(think)里面输出不准出现引用的序号以及id等标记,否则会导致引用错误 """