From 698d4446e0892053f137e98a68e2bc659e46d3dd Mon Sep 17 00:00:00 2001 From: fridayL Date: Thu, 11 Dec 2025 21:32:34 +0800 Subject: [PATCH 1/3] 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/3] 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/3] 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 = """