In this article, you will understand how the transformation of the customer's message works using the conversation history. This is a tool developed to enhance the quality of the user's first interaction.
How Message Transformation Works
When the user's first message arrives, we consider the previous messages marked as history in the conversation. In the following example, the history consists of the following messages:
We take these messages, along with the user's most recent message, to make a modification to the question sent to Claudia. This allows us to alter the message used for session queries, making it more precise.
If we analyze the sessions used for the response generated in the previous example, we can see that the search term is different from the messages sent by the user:
The search term "how to access and take advantage of the tax slips mentioned in the notification" was generated by the conversation history query transformation process, ensuring a more accurate search. Without this functionality, the original search term would be simply "how can I do this?", which could lead to less precise answers.
Activating the Functionality
Currently, this functionality cannot be activated by the HUB. When necessary, please contact the Cloud team for manual activation.
Activation should be done as follows:
Within the project configuration, add the following JSON object at the root of the document:
{
"conversationHistoryQueryTransformationSettings": {
"enabled": true,
"prompt": "Analyze the messages from the user and the agent below: \n\n {CONVERSATION_HISTORY} \n\n Summarize the USER's question considering the messages sent by the AGENT as context. Respond only with the summarized question, nothing more.",
"_class": "com.cloudhumans.claudia.domain.entities.ConversationHistoryQueryTransformationSettings"
}
}
JSON Parameters:
-
enabled: Indicates that the feature is activated.
-
prompt: Instruction used to transform the user's message.
-
{CONVERSATION_HISTORY}: Placeholder replaced by the conversation history.
Example of Placeholder Replacement
In the previously mentioned example, the placeholder was replaced with the following history:
AGENT: Notification sent by Agilize: Hello, Rafael Viana! How are you? At the beginning of each month, we would like to remind you about the taxes to be paid. Here are the important information for this month: 🗓️ Release Dates: The slips will be available between the 1st and 15th of each month. 📍 Where to Access the Slips: You...
USER: I didn't know, how can I take advantage of this?
USER: How can I do this?
With this approach, the tool significantly improves the accuracy of the response, ensuring a more effective and relevant interaction for the user.