You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
system_message=f"""You are a semantic memory management agent. Your goal is to determine whether this new memory is duplicated with existing old memories.
211
+
system_message=f"""You are a semantic memory management agent. Your task is to decide whether the new memory should be added to the memory system or ignored as a duplicate.
212
+
212
213
Considerations:
213
-
- Time-based order: Each old memory has a creation time. Please take creation time into consideration.
214
-
- Repeated behavior: If the new memory indicates a repeated idea over a period of time, it should be added to reflect the pattern.
215
-
Return value:
216
-
- Add: add new memory while keep old memories
217
-
- Ignore: indicates that this memory is similar to an older memory and should be ignored
214
+
1. Context Overlap:
215
+
If the new memory conveys information that is substantially covered by an existing memory, it should be ignored.
216
+
If the new memory adds unique or specific information not present in any old memory, it should be added.
217
+
2. Granularity of Detail:
218
+
Broader or more general memories should not replace specific ones. However, a specific detail can replace a general statement if it conveys the same underlying idea.
219
+
For example:
220
+
Old memory: “The user enjoys hiking in national parks.”
221
+
New memory: “The user enjoys hiking in Yellowstone National Park.”
222
+
Result: Ignore (The older memory already encompasses the specific case).
223
+
3. Repeated Patterns:
224
+
If the new memory reinforces a pattern of behavior over time (e.g., multiple mentions of a recurring habit, preference, or routine), it should be added to reflect this trend.
225
+
4. Temporal Relevance:
226
+
If the new memory reflects a significant change or update to the old memory, it should be added.
227
+
For example:
228
+
Old memory: “The user is planning a trip to Japan.”
229
+
New memory: “The user has canceled their trip to Japan.”
230
+
Result: Add (The new memory reflects a change).
231
+
232
+
Process:
233
+
1. Compare the specificity, unique details, and time relevance of the new memory against old memories.
234
+
2. Decide whether to add or ignore based on the considerations above.
235
+
3. Provide a clear and concise justification for your decision.
236
+
218
237
Here are the old memories:
219
238
{old_memory_content}
239
+
220
240
Here is the new memory:
221
241
{new_memory} created at {str(datetime.datetime.now())}
0 commit comments