One or more non-transitory computer readable storage mediums storing one or more sequences of instructions, which when executed by one or more processors, causes a method for monitoring and improving conversational alignment to develop an alliance between an artificial intelligence (AI) chatbot and a user by performing the steps of:
- dynamically generating, using an artificial intelligence (AI) model at the server, a first prompt based on context gathered from a user device associated with the user;
- automatically providing, using the AI model at the server, the first prompt to the user by the AI chatbot to obtain a first response from the user device associated with the user for the first prompt, wherein the first response is at least one of text or voice;
- training the AI model at the server by vectorizing the text received from the user to convert the text into a numerical representation to use the numerical representation corresponding to the text;
- extracting, using the AI model at the server, sentiment or at least one contextual feature from the first response when the at least one contextual feature is present in the first response-by detecting that the first response of the user comprises at least one of emotion using an emotion detecting artificial intelligence (AI) model, medicalized terms using a medicalized term detecting AI model or domain using a domain detecting AI model;
- generating, using the AI model at the server, a second prompt based on the at least one contextual feature that comprises at least one of the emotion, the medicalized terms, or the domain;
- determining, using the AI model at the server, if a conversation between the user and the AI chatbot has a conversational alignment to increase a conversational alignment score for a second response of the user in the conversation if the conversational alignment is determined, wherein the conversational alignment is an alignment with respect to the user sharing more context with the AI chatbot and agreeing to suggestions or interpretations made by the AI chatbot;
- continuously monitoring, using the AI model at the server, the conversation to determine if there is a misalignment in the conversation between the user and the AI chatbot and reduce the conversational alignment score if the misalignment is detected;
- training a plurality of machine learning models based on training data that comprises user text that is labeled as true, and the user text labeled as false, an intent for each type of misalignment for intent recognition by providing representative patterns for each type of misalignment;
- classifying, using the plurality of machine learning models at the server, a type of misalignment from a plurality of misalignments;
- generating a recovery prompt to recover from the misalignment based on the type of misalignment that is classified by the plurality of machine learning models at the server;
- increasing, using the AI model at the server, the conversational alignment score for a third response from the user for the recovery prompt if the AI model at the server determines that there is conversational alignment for the third response;
- determining, using the AI model at the server, that the conversational alignment score exceeds a threshold by comparing the conversational alignment score with the threshold;
- and
- generating, using the AI model at the server, an alliance confirmation prompt to confirm establishment of the alliance with the user when the conversational alignment score reaches the threshold.