AI answer engine for doctors and patients

AI answer engine for doctors and patients

Itransition implemented a PoC of a web application that interacts with the Davinci AI model to answer visitor questions. We also created a product development plan and an MVP quote that helped raise 70% of the needed development funds.

Context

The customer is an educational medical resource on surgery and perioperative care. The resource provides surgery consulting services and a directory of surgeons, training opportunities, and surgery instrument suppliers and manufacturers, connecting doctors, nurses, technicians, and patients.

The consultancy business attracts up to 5,000 unique visitors monthly who ask many questions about various surgery topics. The customer wanted to try using AI to streamline answering user questions and wanted to train the neural network themselves without hiring an internal tech team. They wanted to have an AI model with a constant retraining mechanism be taught from a knowledge base the customer had created.

Automatic answering of routine visitor questions during peak times would save the customer time on communications and make finding answers for medical professionals and patients easier. The customer also needed an MVP quote to demonstrate to investors and raise funds for full-scale development.

The customer chose Itransition based on our discovery package with transparent PoC costs and goals. They also took into account our portfolio, AI consulting experience, and healthcare expertise, including a PoC with a medical records recognition feature we delivered that 30+ new healthcare institutions ended up using.

Solution

Itransition implemented a PoC of a web application that interacts with the Davinci AI model to give answers to visitors’ questions.

Itransition’s team began by testing the feasibility of the AI answer engine idea by looking for an AI model that:

  • efficiently processes language queries (requests for medical definitions, abbreviation explanations, descriptions, advantages and disadvantages of procedures, etc.)
  • is accurate enough to be used in the surgery niche of the healthcare sector

We suggested OpenAI since, in addition to its automation and time-saving features, it is efficient and secure and could be trained by the customer. Instead of AI models, we considered integrating Azure services into the solution’s architecture since Azure offers native integrations between OpenAI and Cognitive Search, provides indexing and querying capabilities for data, and has great AI model deployment possibilities. We also tried to uncover and address all possible AI implementation challenges to implement the best-fitting solution.

OpenAI also offers a fine-tuning service which was a relevant capability for the customer. That is why we tested the four models with fine-tuning capabilities (Davinci, Curie, Baddage, and Ada) available at the time of the PoC creation. In the end, we chose Davinci for its size, high accuracy, capability to perform complex language tasks, and ability to be trained on larger, diverse datasets.

The web app serves as an admin space for the developed AI answer engine and offers the following capabilities:

  • Add, edit, and create question-answer lists
  • Train the AI model
  • Track incorrect answer history
  • View question time stamps, questions, answers, and model versions
  • Monitor the status of question-answer pairs (applied, registered, in progress, etc.)

The AI model is fine-tuned using the knowledge base built by the customer that includes more than 100 question-answer pairs. To ensure the model gives accurate answers to very different user questions, we paraphrased the most frequent questions and fed them to the AI model. The PoC showed that certain answers were on par with the required quality level and others were not. The answer-question pairs were improved by the customer to contain only proven information and produce well-grounded answers.

AI answer engine

The AI answer engine was developed by Itransition to continuously expand the knowledge base with the help of fine-tuning happening overnight and overseen by the customer. The Davinci model uses the previous model as the foundation for the next one during the fine-tuning process. On top of that, the PoC developed by Itransition’s team ensures easy scalability of the future solution, meaning that admins can extend it with as many question-answer pairs as needed and increase the number of useful features.

Based on our experience in other healthcare industry projects where we handled legal, ethical, and regulatory requirements, Itransition recommended adding a disclaimer feature to the solution. The disclaimer precedes all answers, warning users about the limitations of AI and highlighting the importance of qualified professional advice for accurate medical guidance. Itransition also implemented a method of garnering answers from scientific literature quotations while observing the author’s copyright.

Having completed the PoC, Itransition suggested creating a product development plan that included the cost and labor estimates for winning future investment opportunities. Additionally, we delivered estimates for further development enumerated below:

MVP quote. Itransition put together an MVP documentation package with details about team composition, characterizing project roles for software and QA engineers, a project manager and business analyst, and a UX/UI designer. The MVP quote describes a browser-friendly responsive web app and includes monetization options like monthly subscriptions, pay-per-question, pay-per-bundle of questions, etc. We also suggested adding the ability to embed the AI answer engine as a chat widget to the admin panel, as well as hosting the solution in the cloud environment.

Integration estimates. Itransition’s team calculated estimates for developing the solution further and integrating it with third-party apps. For instance, we estimated the integration of ChatPDF AI with the developed AI answer engine. Azure OpenAI Service and Azure Cognitive Search were utilized for embedding vectors as a numerical representation of data that captures semantic relationships and similitudes. Text data from PDFs was vectorized by finding text extracts that fit semantically to produce an answer. Additionally, Itransition generated an estimate and quote for integrating the AI answer engine into the customer’s website using various approaches.

Technologies

Itransition’s team used OpenAI production best practices and success cases when developing the question-answer AI solution. The AI models are hosted on OpenAI servers. The backend, written in Java, is a proxy to interact with OpenAI used for training models, forming data sets, and performing inferences for the model. The solution’s front-end is an Angular-based app.

The solution’s architecture

Itransition’s team selected AWS because of our extensive expertise and many successful projects that we used it for. The database is hosted on Amazon RDS using PostgreSQL to ensure great resource scalability in the future.

The backend is hosted using Amazon EC2 to ensure security and scalability. We deployed the solution’s front-end to Amazon S3 cloud object storage to be hosted as a static website and delivered via Amazon CloudFront.

Itransition used a library recommended by OpenAI, openai-java by Theo Kanning, to integrate the model with OpenAI API because of such features as supporting new speech API, easy fine-tuning tests, and adding file status fields.

Itransition used AWS best practices to secure questions and answers history and sensitive visitor data. The questions are sent to the OpenAI model, part of the OpenAI security program that adheres to industry practices and is compliant with the platform’s security policies.

Results

Itransition has proven the idea's feasibility and developed a roadmap for future testing and product development of the AI answer engine. Thanks to the PoC delivered by Itransition, the customer has already raised 70% of the necessary funds for full-scale production. It is projected that the fully-developed solution will result in:

  • 45% time saved on answering visitor questions
  • 90% automated interactions with medical professionals