private void mergeConversationMemory(IConversationMemory currentConversationMemory, ConversationMemorySnapshot callbackMemorySnapshot) { if (callbackMemorySnapshot != null && !callbackMemorySnapshot.getConversationSteps().isEmpty()) { var currentStep = currentConversationMemory.getCurrentStep(); var callbackConversationMemory = convertConversationMemorySnapshot(callbackMemorySnapshot); var currentCallbackStep = callbackConversationMemory.getCurrentStep(); Set<String> callbackKeys = currentCallbackStep.getAllKeys(); for (String callbackKey : callbackKeys) { currentStep.storeData(currentCallbackStep.getData(callbackKey)); } } }