feat: getting just last messages #250 #251
-
I’m using the simplest code. I need to get the last X messages that were recorded and stored. But is there a function to do this? So far, I’ve only seen search, which obviously isn’t suitable, and also "get_all", but then I would have to manually sort everything by time, which isn’t practical if my history grows very large. KVCacheMemory also isn’t an optimal solution, since I would like to fetch this information from long-term memory — I just want to retrieve the last X messages from the conversation with the user. Is there currently anything available that allows me to do this? Please let me know, and thanks in advance. https://github.com/MemTensor/MemOS/blob/main/examples/mem_os/simple_memos.py |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thank you for your attention. |
Beta Was this translation helpful? Give feedback.
Thank you for your attention.
We haven't implemented persistent user conversation history storage yet, but this is already in our plans(maybe next version).
Currently, user conversation history is stored in chat_history_manager(mos.chat_history_manager), and the history will clear when the mos restart. If you want to retrieve it temporarily, you can directly call
mos.chat_history_manager[user_id]