A system comprising: a smartphone with a device memory, wherein instructions of a mobile application are stored in the device memory; a central server with server memory, wherein instructions of a server application are stored in the server memory; and a database storage system , wherein the instructions of the mobile application when executed cause the smartphone to (a) detect a user state of a patient who is currently undergoing a first step of a cognitive behavioral therapy (CBT), wherein the user state is based on the patient's behavior and physiological condition during the first step of the CBT as detected by sensors of the smartphone , (b) detect a situational state of the patient's surroundings while the patient is undergoing the first step of the CBT, wherein the situational state is detected by the sensors of the smartphone , (c) determine whether the patient has performed the first step in a manner that achieves progress in the CBT, and (d) output a user prompt based on the detected user state and the detected situational state during the first step, wherein the instructions of the server application when executed cause the central server to (e) generate the user prompt using machine learning based on past therapy steps by the patient and other users of the mobile application to have a content and character adapted to influence the patient to complete a next step of the CBT, and (f) configure the next step of the CBT based on the detected user state and the detected situational state during the first step, and wherein data regarding the past therapy steps by the patient and other users is stored in the database storage system . a smartphone with a device memory, wherein instructions of a mobile application are stored in the device memory; a central server with server memory, wherein instructions of a server application are stored in the server memory; and a database storage system , wherein the instructions of the mobile application when executed cause the smartphone to (a) detect a user state of a patient who is currently undergoing a first step of a cognitive behavioral therapy (CBT), wherein the user state is based on the patient's behavior and physiological condition during the first step of the CBT as detected by sensors of the smartphone , (b) detect a situational state of the patient's surroundings while the patient is undergoing the first step of the CBT, wherein the situational state is detected by the sensors of the smartphone , (c) determine whether the patient has performed the first step in a manner that achieves progress in the CBT, and (d) output a user prompt based on the detected user state and the detected situational state during the first step, wherein the instructions of the server application when executed cause the central server to (e) generate the user prompt using machine learning based on past therapy steps by the patient and other users of the mobile application to have a content and character adapted to influence the patient to complete a next step of the CBT, and (f) configure the next step of the CBT based on the detected user state and the detected situational state during the first step, and wherein data regarding the past therapy steps by the patient and other users is stored in the database storage system . <EOS>