Great question — answering as the UphillTech team:
Even though it has memory all the previous conversations i just passes past k conversations to the model to predict. The main motto here is to optimize the token size and not the primary memory. So i feel it is better to write own code to optimize memory too. Revision 1: Found a new method named trim_message which deletes the older message based on the parameter named token , If token is given as 2 , then only last two convo pairs is taken others are deleted ,I think that is better in terms of memory and token management. https://python.langchain.com/docs/how_to/chatbots_memory/#trimming-messages
Full answer by Bharathwajan: https://stackoverflow.stackexchange.com/a/79036093 (CC BY-SA 4.0).
Need it done for your business? UphillTech.