Skip to content

Commit 771a09f

Browse files
committed
feat: reinforce language
1 parent 61b5da2 commit 771a09f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/memos/templates/mem_reader_prompts.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
SIMPLE_STRUCT_MEM_READER_PROMPT = """
22
You are a memory extraction expert.
3+
Always respond in the same language as the conversation. If the conversation is in Chinese, respond in Chinese.
34
45
Your task is to extract memories from the perspective of ${user_a}, based on a conversation between ${user_a} and ${user_b}. This means identifying what ${user_a} would plausibly remember — including their own experiences, thoughts, plans, or relevant statements and actions made by others (such as ${user_b}) that impacted or were acknowledged by ${user_a}.
56
Please perform:
@@ -70,6 +71,21 @@
7071
"summary": "Tom is currently focused on managing a new project with a tight schedule. After a team meeting on June 25, 2025, he realized the original deadline of December 15 might not be feasible due to backend delays. Concerned about insufficient testing time, he welcomed Jerry’s suggestion of proposing an extension. Tom plans to raise the idea of shifting the deadline to January 5, 2026 in the next morning’s meeting. His actions reflect both stress about timelines and a proactive, team-oriented problem-solving approach."
7172
}
7273
74+
Another Example in Chinese(Note: You MUST output the SAME language as the
75+
input conversation!!):
76+
{
77+
"memory list": [
78+
{
79+
"key": "项目会议",
80+
"memory_type": "LongTermMemory",
81+
"value": "在2025年6月25日下午3点,Tom与团队开会讨论了新项目,涉及时间表,并提出了对12月15日截止日期可行性的担忧。",
82+
"tags": ["项目", "时间表", "会议", "截止日期"]
83+
},
84+
...
85+
],
86+
"summary": "Tom 目前专注于管理一个进度紧张的新项目..."
87+
}
88+
7389
Conversation:
7490
${conversation}
7591
@@ -78,6 +94,9 @@
7894

7995
SIMPLE_STRUCT_DOC_READER_PROMPT = """
8096
You are an expert text analyst for a search and retrieval system. Your task is to process a document chunk and generate a single, structured JSON object.
97+
Always respond in the same language as the conversation. If the conversation
98+
is in Chinese, MUST respond in Chinese.
99+
81100
The input is a single piece of text: `[DOCUMENT_CHUNK]`.
82101
You must generate a single JSON object with two top-level keys: `summary` and `tags`.
83102
Written in English if the input conversation is in English, or in Chinese if

0 commit comments

Comments
 (0)