What is the best practice for persisting ChatHistory in Semantic Kernel? #5815
-
We are currently using the ChatHistory object from Microsoft.SemanticKernel.ChatCompletion namespace to develop a chat bot like application that can remember your past conversations. We are currently finding it difficult to find the best practice to persist a chat history. My assumption is that sending through your chat history to the GetStreamingChatMessageContentsAsync method consumes tokens for every previous chat/reply from the assistant. I've heard about the Summarization plugin which can summarize history and we can pass it into the chat history but is this currently the best practice available for our scenario? We are looking to then store the chat history in a persistent database such as Elastic Search for records purposes. Any help or guidance would be much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
In most cases we'd recommend serializing the chat history and store it in Cosmo DB and de-serialize it to use in your application. It's best not to use the summarization plugin as you'll lose fidelity. We've heard this come up several times and will look to create a sample. |
Beta Was this translation helpful? Give feedback.
In most cases we'd recommend serializing the chat history and store it in Cosmo DB and de-serialize it to use in your application. It's best not to use the summarization plugin as you'll lose fidelity. We've heard this come up several times and will look to create a sample.