From Ephemeral to Persistence with LangChain: Building Long-Term Memory in Chatbots – Towards Data Science

8 min read

In a previous article I wrote about how I created a conversational chatbot with OpenAI. However, if you have used any of the chatbot interfaces like ChatGPT or Claude et al., you would notice that when a session is closed and reopened, the memory is retained, and you can continue the conversation from where you left off. That is exactly the experience I want to create in this article.

I will use LangChain as my foundation which provides amazing tools for managing conversation history, and is also great if you want to move to more complex applications by building chains.

Code for recreating everything in this article can be found at https://github.com/deepshamenghani/langchain_openai_persistence.

I will start by creating a loop for the user to input questions for the chatbot. I will assign this to the variable humaninput. For now, instead of an LLM output

Read more:

From Ephemeral to Persistence with LangChain: Building Long-Term Memory in Chatbots - Towards Data Science

Related Posts

Comments are closed.