Persistant Chats with GPT using API

There are two mainstream ways to achieve long-term memory at the moment:

  1. Embeddings - divide the past conversations into parts, use embeddings to search for parts that are related to the last part of the conversation and include the related parts at the beginning of the prompt.
  2. Summarization - summarize the previous parts of the conversation and include summary at the beginning of the prompt.

I suppose Langchain library can help you achieve both.

2 Likes