Fix/new mem mistaken for current fixing #2875 (#2876)

This commit is contained in:
John Lockwood
2025-09-01 19:46:01 +05:30
committed by GitHub
parent 748620f29b
commit 97fd320bbf
2 changed files with 45 additions and 1 deletions
+13 -1
View File
@@ -293,14 +293,26 @@ def get_update_memory_messages(retrieved_old_memory_dict, response_content, cust
global DEFAULT_UPDATE_MEMORY_PROMPT
custom_update_memory_prompt = DEFAULT_UPDATE_MEMORY_PROMPT
return f"""{custom_update_memory_prompt}
if retrieved_old_memory_dict:
current_memory_part = f"""
Below is the current content of my memory which I have collected till now. You have to update it in the following format only:
```
{retrieved_old_memory_dict}
```
"""
else:
current_memory_part = """
Current memory is empty.
"""
return f"""{custom_update_memory_prompt}
{current_memory_part}
The new retrieved facts are mentioned in the triple backticks. You have to analyze the new retrieved facts and determine whether these facts should be added, updated, or deleted in the memory.
```