Is the asynchronous summary_generator for the memory extraction add process automatically executed, or do I need to design the parameter interface myself?
🐛 Describe the bug
Is the asynchronous summary_generator for the memory extraction add process automatically executed, or do I need to design the parameter interface myself?
I checked the code for the memory extraction and add process in Memory.add().
It looks like summary generation is NOT automatically executed during the add step—there's no built-in summary generator invoked when you add new memories.
You have to manually create summaries or add code to trigger summary generation if you want those summaries included.
The infer parameter decides whether facts are extracted from messages using the LLM (infer=True) or raw messages are simply stored (infer=False), but this does NOT create a summary.
Can you confirm if manual summary generation is required, or if there's any recommended way to integrate a summary_generator into the current pipeline?
Hello, thank you for your reply. The addfunction for mem0 is located in Memory.add(). The specific version of mem0, which stores memories using the vector embedding approach, handles the memory addition process in Memory._add_to_vector_store(). Here, you can find the detailed memory addition workflow, which includes:
First, it checks the inferparameter (default is True) to determine whether to use the model for memory extraction. Then, it calls the LLM to extract new memories and retrieves highly similar memories from the existing knowledge base (the paper mentions the top 10, while the source code retrieves the top 5). The retrieved old memories (retrieved_old_memory) and the newly extracted facts (new_retrieved_facts) are then passed to the LLM to decide on subsequent add, delete, or modify operations.
This entire process is almost identical to the addsection of mem0 described in the paper. However, since my final reproduction results differ from those in the paper, I am trying to identify the parts of the code that do not align with the paper's description: Is the summary_generatorcomponent mentioned in the paper missing from the source code? Could retrieving only the top 5 memories in the source code be unreasonable?