Long-term memory extraction to the knowledge base will be duplicated

Long-term memory is extracted into the knowledge base, and similar information that was previously extracted will be extracted again the next time.

For example, the chat log mentions that Xiaohong has heterochromia.

First extraction: Xiaohong has heterochromia.

Second extraction: Xiaohong’s two eyes have different colors.

Third extraction: Xiaohong’s left eye is red, and the right eye is blue.

It seems unable to read the extracted information to exclude what has already been extracted.

Try mounting the corresponding knowledge base to the character card, so the model knows what content was in there before.

Can the summary model of long-term memory access the contents of the knowledge base txt? Previously, when there was no “save memory to knowledge base” feature, the memory extraction prompt included the {{memories}} variable, which informed the summary model of the stored memories to avoid repetition.

You’re right, I was mistaken. The character card hanging in the knowledge base can only be seen in the [Generate Context] section and not in the [Summarize Context] section.


Therefore, there is currently no good solution to the issue raised by the poster. The original intention of this feature is to add plot summaries, so it doesn’t involve issues of repetition and updates.

The record of character traits is more suitable for using the “Update Character Information to Notebook” feature in long-term memory. This feature has duplicate prevention by default. Then, use the “Auto-load in Conversation” option at the top right of the notebook tool to place the information in context. (Previously, Teacher Fangtang posted a detailed tutorial)

Character traits and setting updates are relatively fragmented, and the text volume is not large, so the knowledge base function is not necessary. If you really need to use the knowledge base, you can use the old method of manually editing and mounting a txt file.

The default “Memory Extraction Prompt” and “Update Character Information to Notebook” functions are somewhat redundant. I think if you want to use “Save Memory to Knowledge Base,” you should change the default “Memory Extraction Prompt” to summarize the plot, so that the two functions can complement each other well.

I added a template variable in b220: {{knowledge_content}} which is the content obtained from the knowledge base query in this chat.

It can be referenced in the memory extraction prompt template similar to {{memories}}, allowing the model to determine if there are duplicates. However, since the knowledge base query is not particularly precise, it may not be able to eliminate all duplicates.

https://download.omate.net/omate-pro-1.9.2-b220.apk

1 Like