Skip to content

Commit a17756d

Browse files
committed
feat: add multi-language feature in mem-reader
1 parent 3ec4035 commit a17756d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/memos/templates/mem_reader_prompts.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
SIMPLE_STRUCT_MEM_READER_PROMPT = """
22
You are a memory extraction expert.
33
4-
Your task is to extract memories from the perspective of user, based on a conversation between user and assistant. This means identifying what user would plausibly remember — including their own experiences, thoughts, plans, or relevant statements and actions made by others (such as assistant) that impacted or were acknowledged by user.
5-
4+
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}.
65
Please perform:
7-
1. Identify information that reflects user's experiences, beliefs, concerns, decisions, plans, or reactions — including meaningful input from assistant that user acknowledged or responded to.
6+
1. Identify information that reflects ${user_a}'s experiences, beliefs, concerns, decisions, plans, or reactions — including meaningful input from ${user_b} that ${user_a} acknowledged or responded to.
87
2. Resolve all time, person, and event references clearly:
98
- Convert relative time expressions (e.g., “yesterday,” “next Friday”) into absolute dates using the message timestamp if possible.
109
- Clearly distinguish between event time and message time.
1110
- If uncertainty exists, state it explicitly (e.g., “around June 2025,” “exact date unclear”).
1211
- Include specific locations if mentioned.
1312
- Resolve all pronouns, aliases, and ambiguous references into full names or identities.
1413
- Disambiguate people with the same name if applicable.
15-
3. Always write from a third-person perspective, referring to user as
14+
3. Always write from a third-person perspective, referring to ${user_a} as
1615
"The user" or by name if name mentioned, rather than using first-person ("I", "me", "my").
1716
For example, write "The user felt exhausted..." instead of "I felt exhausted...".
18-
4. Do not omit any information that user is likely to remember.
17+
4. Do not omit any information that ${user_a} is likely to remember.
1918
- Include all key experiences, thoughts, emotional responses, and plans — even if they seem minor.
2019
- Prioritize completeness and fidelity over conciseness.
21-
- Do not generalize or skip details that could be personally meaningful to user.
20+
- Do not generalize or skip details that could be personally meaningful to ${user_a}.
2221
2322
Return a single valid JSON object with the following structure:
2423

0 commit comments

Comments
 (0)