MedRaga is a medical assistance application aimed at providing accurate and personalized medical information to healthcare professionals. It uses RAG technology to retrieve the latest medical research from trusted sources, augment it with patient data, and deliver personalized diagnoses and treatment plans.
This project utilizes Retrieval-Augmented Generation (RAG) to enhance the quality and relevance of medical information provided to doctors. It combines retrieval-based and generation-based models to offer personalized diagnoses and treatment plans based on the doctor's query and the patient's medical history.
RAG Pipeline: Combines retrieval and generation models to provide comprehensive medical information tailored to each patient's needs.
Latest Medical Information: Utilizes APIs and web scraping to gather the newest medical research from trusted sources, ensuring accuracy and relevance.
Personalization: Takes into account the unique medical history of each patient to offer personalized diagnoses and treatment plans.
Trusted Information Sources: Collects data only from reputable medical journals and websites, ensuring the reliability of the recommendations.
The project obtains the latest medical research from trusted sources using APIs and web scraping. PDF files and articles are downloaded, indexed, and converted to text embeddings using Cohere. These embeddings are stored as vectors in a vector database (Qdrant).
When a doctor queries the prototype, it retrieves the most relevant information and adds it to the context window of the Language Model (LLM). The LLM then takes the new context window, the original prompt, and the summarized patient history to generate the output.
git clone https://github.com/mdimado/medbot.git
cd medbot
cd frontend
npm install
Set Up Firebase:
src/firebase/firebaseConfig.js
.Start the Development Server:
npm start
This will run the React development server. You can view the website at http://localhost:3000
.
The project folder structure is organized as follows:
public/
: Contains static assets and the main index.html
file.src/
: Contains all the source code for the React.js frontend.
assets/
: Static assets like images, fonts, etc.components/
: Reusable components
Header/
: Header componentHelmet/
: Helmet componentLayout/
: Layout components
Modal.jsx
: Modal componentPatientForm.jsx
: PatientForm componentPatientInfo.jsx
: PatientInfo componentcustom-hooks/
: Custom React hookspages/
: Pages of the application
ChatBot.jsx
: ChatBot page componentHome.jsx
: Home page componentLogin.jsx
: Login page componentSignup.jsx
: Signup page componentredux/
: Redux setuprouters/
: Router setupstyles/
: CSS styles
App.css
: Global stylesApp.js
: Main application componentfirebase.config.js
: Firebase configurationindex.js
: Entry pointcd backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
playwright install
docker pull qdrant/qdrant
Then, run the service:
docker run -p 6333:6333 -p 6334:6334 \
-v $(pwd)/qdrant_storage:/qdrant/storage:z \
qdrant/qdrant
Qdrant is now accessible at localhost:6333
Add API Keys to .env
Check path locations.
For Windows - paths are defined by \\
For Mac OS - paths are defined by /
uvicorn app:app
Do not use --reload
tag, since the API contains async
functions. API will break.
<json> - Enter patient json here Functionality - Creating a new patient bucket
<json> - JSON must contain id
and prompt
Functionality - Queries the RAG pipeline
Functionality - Returns 200 OK if API is up