Artificial Intelligence (AI) Integration for Healthcare With ChatGPT and WordPress

khalpey operate

First Glance


Khalpey AI Labs, based in Scottsdale AZ, is a group of physicians and scientists, led by Dr. Zain Khalpey, working together to conduct patient centered, AI-supported research. The team is looking to drive improvements in heart surgery, cancer screening, and pre- symptomatic COVID-19 detection by bringing artificial intelligence to patients.


The Khalpey AI team reached out to Sunrise Integration with their plan to development a real time AI-powered platform to help answer patients questions. The system would provide support to patients, clinicians and scientists.


The Sunrise Integration data and AI team was excited work on this project and came armed with lots of ideas to help the Khalpey AI platform get off the ground.

Bringing AI to Healthcare


Developing The Ultimate Physician Chatbot for Patients, Clinicians, and Scientists

The Challenge


The introduction of ChatGPT marked a groundbreaking moment in AI, opening up new possibilities for innovative applications like healthcare AI chatbots. This technology has empowered people to interact with AI in a natural, conversational way. Creating a healthcare AI chatbot involves navigating these complex landscapes of technical and healthcare-related challenges.


Using ChatGPT


The Khalpey team wanted to use ChatGPT to create the initial 1.0 version of the system. Our development team needed to leverage the capabilities of ChatGPT to tackle a range of issues. This was particularly challenging since symptoms and expressions can vary widely and we needed to ensure the AI  could deliver accurate and reliable medical advice. In order to accomplish this, we needed to take into the account the backend prompts to pre-train ChatGPT for the proper responses.


Designing AI Prompts


One big challenge in developing a healthcare AI chatbot using ChatGPT is training the system to provide accurate responses. This can be solved by the utilization of effective prompts. The Sunrise Integration team had to work with Khalpey to ensure that all questions were always contextualized with the correct prompts. The prompts used to train the chatbot needed to be carefully crafted to mimic the kind of questions and scenarios the match the required real-world healthcare settings. The better the prompt, the more effectively the chatbot can be trained. Since the Khalpey team is focused on heart surgery, the AI bot needed to be specific for patients seeking general information about surgery, including what to expect, how to prepare, and understanding risks and benefits. How could we keep the bot on-topic and not answering the wrong health question?


ChatGPT for Healthcare

The Solution


Getting a healthcare AI chatbot off the ground involves overcoming a blend of technical and accuracy challenges. For this initial version, the Khalpey team wanted to start with a basic chatbot to answer patient questions. Khalpey wanted a system entitled Kai to support the AI platform. Kai would be an online site with the integrated chatbot. Users can select their model and enter a heart-related question. The Sunrise Integration development team got to work creating the AI service.


AI integration for Healthcare


ChatGPT is The AI Solution


Being the most well known AI solution to date, Khalpey was excited for us to utilize it for this development. ChatGPT's sophisticated language processing capabilities made it a great choice for this project. From a development perspective, using the ChatGPT API for integration is straightforward, allowing for a more efficient development. This allowed us to save time and provide better value to the Khalpey team.


One great feature of ChatGPT is the customization of the model and prompts. This allowed us to fine-tune the Kai platform with specific prompts related to selected scenarios. This ensured that the Kai chatbot would provide relevant answers. The first step was to train the prompts to match the requirements.


Training ChatGPT Prompts


A prompt is essentially a set of instructions given to the ChatGPT model to elicit a specific type of response. The system starts the conversation with the prompts and then incorporates the user's question to craft a more specific and targetted question. The expectation is that the AI will continue the conversation and provide the answer based on the prompt. This was the concept we used to train the three required models.


The Khalpey AI platform wanted to service three different models including patients, clinician and scientists. This means each prompt needed customization based upon the desired model. The user first selects their model and then the associated prompt is synchronized with the ChatGPT AI


Training ChatGPT with custom models and prompts


Understanding the context of the selected model is essential because the system generates responses based on the input. Each model contained a specific the prompt that is tailored and relevant the model. The user's questions are combined with the prompt and sent to the API to obtain the response.


Using the ChatGPT API


We used the ChatGPT API to create a custom chatbot tailored for Khalpey's requirements. Using the custom prompts, we integrated the ChatGPT API into the Khalpey KAI platform. This API integration served as the backbone of the chatbot by sending the prompts to the latest ChatGPT model and receiving text responses generated by the AI.


We designed a data integration app-process where the server sends a request to the ChatGPT API and combines the conversation data. This API communication is made over HTTPS, ensuring data security, which is top of our minds for any healthcare application. Once we received the response, we performed additional post-processing including formatting the response to make it more user-friendly. We also filtered out any unnecessary or non-relevant information. We needed to ensure that the data matched the user's question and model.


ChatGPT API Integration for Custom ChatBots

The Outcome


The Khalpey AI tool was designed to assist patients and users for educational and informational purposes. This initial chatbot represents a significant advancement in AI technology. The idea was to create a highly efficient, accurate and empathetic AI chatbot capable of handling a wide range of inquiries.


A chatbot like Kai can provide immediate access to health guidance. This is particularly beneficial for individuals seeking quick, preliminary advice on health issues. It can quickly provide patients with peace of mind and accurate information. This can significantly reduce the workload on medical staff. It's a cost-effective solution that can potentially lower healthcare costs.


Looking to the Future of Healthcare AI


This project underscores AI's potential in tackling complex challenges and setting a precedent for future innovations. The Sunrise Integration team was proud to successfully deploy this system, in the hopes of improving healthcare.


We look forward to paving the way for AI to be leveraged in other areas of society, demonstrating its value as a tool for positive change. The Sunrise Integration team is working with Khalpey on developing the next version of Kai and making improvements to benefit users.