Context-aware chatbot for personal healthcare assistance using LLMs and LangChain
摘要
Chatbots have the potential to offer personalized responses and information to improve patients’ healthcare. However, contextual accuracy is critical because the lack of context awareness may endanger patients’ lives. This research addresses this issue by configuring the GPT-3.5-turbo language model, i.e. adjusting parameters, such as temperature and maximum token limit, and configuring with external knowledge bases using the retrieval-augmented-generation (RAG) approach, chain-of-thought (CoT) prompt engineering techniques using chains within the LangChain framework. We visualized and traced the results using the LangSmith platform, showing that all the chains and retrievers better understood the context. Our healthcare chatbot, intended for patients seeking personalized medical guidance before going to the doctor, was evaluated against ChatGPT using expert evaluation and meta-eval metrics. Evaluation results demonstrate that the proposed medical chatbot exhibits better contextual accuracy, conciseness, and coherence. Thus, this research highlights the potential of integrating the large language model techniques, with RAG, and prompt engineering, and also suggests the frameworks and evaluation methods for language model-based chatbots, to develop context-aware healthcare chatbots for personalized medical assistance.