DEV Community

Cover image for HealthLingo | AI Agents Enabling Multilingual Doctor consultation via WhatsApp
Mohamed Ashiq Sultan
Mohamed Ashiq Sultan

Posted on

HealthLingo | AI Agents Enabling Multilingual Doctor consultation via WhatsApp

This is a submission for Twilio Challenge v24.06.12

What I Built

People can directly contact doctors from WhatsApp in their native language.
Based on patients query a suitable doctor from the list of doctor will be selected by AI.
The Doctor replies in English while the patient's will receive the reply in their preferred language.

Demo

Small gif showing translation

Video explanation of the project and the codebase

whatsapp sandbox link

Working of the App

The app consists of two layers

  1. Business layer
  2. AI layer

The business layer is responsible for handling the incoming msg and Database interactions while the AI layer consists of multiple small agents which interacts with Open AI API. I have used MongoDB as the database to store information like patient details, chat summary and doctor information.

explanation of code base

Twilio and AI

AI

  • Multiple Agents for handling specific tasks using OpenAI's GPT-4o model
  • Translate Agent
  • Chat Summary Agent
  • Two Agents for Details Collection
    • Basic Details Agent
    • Medical Details Agent

Twilio

  • Twilio Whatsapp service.
  • Initially the app was deployed as Twilio Functions but was as I added more conditions I was hitting timeouts sometimes. So yeah, I just deployed in AWS using docker. And yes only one Twilio service.

Additional Prize Categories

Impactful Innovators: People who are visiting a country for first time or immigrants who still find it difficult to express especially their medical condition in the foreign language can use this kind of app to communicate with doctors and express their symptoms and conditions.
Also the AI will pick the right doctor based on their condition.
The privacy of both doctor and patient is maintained as no phone numbers are shared.

The vision of such a app in real life would be

  • Social service mined Doctors signing up for such a service and give some details about their specialty
  • Patients who are looking for answers for some rare or specific condition could potentially find the right doctor and explain their problem in the language they are comfortable with

If you've made it this far, thanks for reading the post! Leaving a like would mean a lot, as it supports my work and encourages me to keep creating more content. Have a great day !

GitHub

GitHub logo ashiqsultan / twilio-whatsapp-ai-bot

A project developed for dev.to hackathon using Twilio whatsapp service using ChatGPT for AI services

Twilio Whatsapp Bot

This project is created as part of dev.to Twilio Challenge 2024. Link to Challenge Page

The project uses Twilio Whatsapp service along with OpenAI ChatGPT model for AI.

The concept of the app is to facilitate communication between patients and doctors.

Change log

Im need to change the code base from twilio functions to normal express server. This is due to the 10 sec runtime in twilio functions. There will be lot of file changes as the module imports are different for twilio reusable functions To refer the code you can checkout this commit: c0797c0




Top comments (4)

Collapse
 
ashiqsultan profile image
Mohamed Ashiq Sultan

I thank those who tried out the bot, I just remembered that the db would be holding the phone no and as someone who respects GDPR, I will make sure to delete the DB in a couple of days as to not persist any personal data.

Collapse
 
ashiqsultan profile image
Mohamed Ashiq Sultan

Like I promised the DB is deleted. Thank again for trying out the bot.

Collapse
 
rishabk7 profile image
Rishab Kumar

This is awesome, amazing build!

Collapse
 
ppyxmw profile image
Michael Worthington

@ashiqsultan if it possible to save this in google sheets instead of using MongoDB? is it possible to have a brainstorm chat with you?