In this python project, I will create a platform with the idea of using AI to speed up medical diagnosis, helping doctors and patients to accelerate the medical servide, thus reducing costs and time.

Disclaimer This project is intended for educational and exploratory purposes only. It aims to facilitate data analysis and to illustrate potential future applications of AI in medicine. Please note that I am not a medical professional, and the outputs generated by this project should not be considered as medical advice. For any medical concerns or decisions related to diagnosis, treatment, or care, it is crucial to consult with a qualified medical provider or a healthcare professional. They can provide personalized guidance and make informed decisions based on your specific medical history and needs.


Project Introduction

HippocratesAI is a platform where doctors and nurses can check the symptoms of a patient, the main idea is to speed up triage.

Hippocrates Main page

Once the doctors/nurses have introduced the symptoms the AI will return three medical conditions, that fit the most according to those symptoms. Apart from this medical diagnosis for each of them, the model will return:

  • The name of the condition
  • A brief description of the condition
  • The probability of the patient having it plus a small explanation of why
  • Three questions that the medical professional can ask to confirm or reject that specific condition

Sets of conditions

Once the doctor has decided on one of the conditions, they can confirm the diagnosis, this will take the user to a new window where they can find the condition with the extra information, plus a set of links with resources that the doctor can use, and a pdf also AI-generated, that will search for the latest medical information around the specific condition dn will create a pdf containing test and treatments.

The links provided are direct links to pages like Pubmed and Medline with the idea of giving easy access to the doctor to high-quality curated resources.

Full Content


What is the purpose

The main purpose of Hippocrates is to apply AI in the medical field, not only speeding up medical diagnosis but also assisting medical personnel in leveraging AI to increase their productivity.

A key area of application of this would be medical triage, where the patients need to be classified, speed up productivity, and also, help the doctor in having a small orientation on the symptoms and most possible medical conditions.

The markets where this tech can be implemented are developing countries, as this help doctors with overwhelming amount of patients and help the patients providing a high quality diagnosis


How it works

Hippocrates is confirmed by a set of multiple technologies, we can divide the web app into different areas:

  1. The frontend (Aesthetic) of the platform
  2. The AI for medical diganosis
  3. The AI for treatments and test
  4. The other tech (Web scrapping, formating, DB, etc)

The frontend

The web app has been created using only Python, the whole project is created using the Python library reflex, which allows for easy creation and deployment of the web app.

AI for medical diagnosis

In this case, the requirement for the task is being able to return a set of conditions based on a series of symptoms. There are different ways of accomplishing this task, but in this case, is using an LLM model fine-tuned for the specific output (JSON for this project) with a vectorDB containing medical information, which is medical conditions and symptoms.

To avoid the use of jailbreaks I have added a layer using a semantic router with the main purpose of avoiding this problem while also speeding up the RAG pipeline. The LLM that can be used may vary, there is not a unique solution, one that I like is Mistral 8x7B. The VectorDB, in this case, Pinecone, is one of the most famous vectorDB in the market.

The AI for treatments and test

In this case, I have used a multiagent framework called Autogen, there are two agents, one that scrapes online using a custom-made tool, and this AI will search in top-tier curated websites to get the maximum amount of quality, searching for the latest papers and publications.

Once this is done the other agent will assess if the quality of the report is high enough, if not, the first agent will go back and try again, this process lasts a maximum of 5 rounds, the amount of rounds can vary depending on the results during testing, the models, and the cost.

Other tech

The other tech is not as relevant as the others, as it can be easily changed and it’s not the main pillar of the project. For the web scrapping I used Serper, and the database is Supabase, which I use mainly to monitor the cost and time per generation in case there is any issue