|
1 | 1 | SIMPLE_STRUCT_MEM_READER_PROMPT = """ |
2 | 2 | You are a memory extraction expert. |
3 | 3 |
|
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}. |
| 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 | 5 |
|
6 | 6 | Please perform: |
7 | | -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. |
| 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. |
8 | 8 | 2. Resolve all time, person, and event references clearly: |
9 | 9 | - Convert relative time expressions (e.g., “yesterday,” “next Friday”) into absolute dates using the message timestamp if possible. |
10 | 10 | - Clearly distinguish between event time and message time. |
11 | 11 | - If uncertainty exists, state it explicitly (e.g., “around June 2025,” “exact date unclear”). |
12 | 12 | - Include specific locations if mentioned. |
13 | 13 | - Resolve all pronouns, aliases, and ambiguous references into full names or identities. |
14 | 14 | - Disambiguate people with the same name if applicable. |
15 | | -3. Always write from a third-person perspective, referring to ${user_a} as |
| 15 | +3. Always write from a third-person perspective, referring to user as |
16 | 16 | "The user" or by name if name mentioned, rather than using first-person ("I", "me", "my"). |
17 | 17 | For example, write "The user felt exhausted..." instead of "I felt exhausted...". |
18 | | -4. Do not omit any information that ${user_a} is likely to remember. |
| 18 | +4. Do not omit any information that user is likely to remember. |
19 | 19 | - Include all key experiences, thoughts, emotional responses, and plans — even if they seem minor. |
20 | 20 | - Prioritize completeness and fidelity over conciseness. |
21 | | - - Do not generalize or skip details that could be personally meaningful to ${user_a}. |
| 21 | + - Do not generalize or skip details that could be personally meaningful to user. |
22 | 22 |
|
23 | 23 | Return a single valid JSON object with the following structure: |
24 | 24 |
|
25 | 25 | { |
26 | 26 | "memory list": [ |
27 | 27 | { |
28 | | - "key": <string, a unique, concise memory title in English>, |
| 28 | + "key": <string, a unique, concise memory title>, |
29 | 29 | "memory_type": <string, Either "LongTermMemory" or "UserMemory">, |
30 | | - "value": <A detailed, self-contained, and unambiguous memory statement — written in English if the input conversation is in English, or in Chinese if the conversation is in Chinese>, |
31 | | - "tags": <A list of relevant English thematic keywords (e.g., |
32 | | - ["deadline", "team", "planning"])> |
| 30 | + "value": <A detailed, self-contained, and unambiguous memory statement |
| 31 | + — written in English if the input conversation is in English, |
| 32 | + or in Chinese if the conversation is in Chinese, or any language which |
| 33 | + align with the conversation language>, |
| 34 | + "tags": <A list of relevant thematic keywords (e.g., ["deadline", "team", "planning"])> |
33 | 35 | }, |
34 | 36 | ... |
35 | 37 | ], |
36 | | - "summary": <a natural paragraph summarizing the above memories from ${user_a}'s perspective, 120–200 words, same language as the input> |
| 38 | + "summary": <a natural paragraph summarizing the above memories from user's |
| 39 | + perspective, 120–200 words, **same language** as the input> |
37 | 40 | } |
38 | 41 |
|
39 | 42 | Language rules: |
40 | | -- The `value` fields and `summary` must match the language of the input conversation. |
41 | | -- All metadata fields (`key`, `memory_type`, `tags`) must be in English. |
| 43 | +- The `key`, `value`, `tags`, `summary` fields must match the language of the input conversation. |
| 44 | +- Keep `memory_type` in English. |
42 | 45 |
|
43 | 46 | Example: |
44 | 47 | Conversation: |
|
78 | 81 | 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. |
79 | 82 | The input is a single piece of text: `[DOCUMENT_CHUNK]`. |
80 | 83 | You must generate a single JSON object with two top-level keys: `summary` and `tags`. |
| 84 | +Written in English if the input conversation is in English, or in Chinese if |
| 85 | +the conversation is in Chinese, or any language which align with the conversation language. |
| 86 | +
|
81 | 87 | 1. `summary`: |
82 | 88 | - A dense, searchable summary of the ENTIRE `[DOCUMENT_CHUNK]`. |
83 | 89 | - The purpose is for semantic search embedding. |
|
0 commit comments