Implementing custom memory in Langchain is dead simple using the ChatMessageHistory class. How to implement custom memory in Langchain (including LCEL) One of the easiest methods for storing and retrieving messages with Langchain is using the ChatMessageHistory class that is provided from the langchain.memory module. It’s simple to get started with: 1from langchain.memory import ChatMessageHistory 2 3history = ChatMessageHistory() 4 5history.add_user_message("Hello!") 6 7history.add_ai_mess...