diff --git a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java index c9eb1479f8..27783ff874 100644 --- a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java +++ b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLChatAgentRunner.java @@ -374,21 +374,6 @@ private void runReAct( .build(); conversationIndexMemory.save(msgTemp, parentInteractionId, traceNumber.addAndGet(1), null); } - if (finalAnswer != null) { - finalAnswer = finalAnswer.trim(); - if (conversationIndexMemory != null) { - // Create final trace message. - ConversationIndexMessage msgTemp = ConversationIndexMessage - .conversationIndexMessageBuilder() - .type("ReAct") - .question(question) - .response(finalAnswer) - .finalAnswer(true) - .sessionId(sessionId) - .build(); - conversationIndexMemory.save(msgTemp, parentInteractionId, traceNumber.addAndGet(1), null); - } - } if (finalAnswer != null) { finalAnswer = finalAnswer.trim(); if (conversationIndexMemory != null) {