Medicompanion RAG Application: Transforming Healthcare Information Delivery
π€π Medicompanion RAG Application: Transforming Healthcare Information Delivery
In todayβs healthcare landscape, accurate information is paramount. Medicompanion is a cutting-edge Retrieval-Augmented Generation (RAG) application designed to deliver reliable health and fitness supplement information. This blog details the project setup, architecture, and the seamless user experience Medicompanion offers through advanced conversational AI built with LangChain and the LLaMA 3.2 model.
π― Project Overview
Medicompanion utilizes RAG and LLaMA 3.2 to answer health-related questions by retrieving relevant documents and generating conversational responses, ensuring clarity and relevance. With the focus on gym and health supplements, itβs an ideal tool for those looking to make informed decisions regarding their wellness routines.
π Directory Structure
A well-organized directory structure is key to managing the project efficiently. Below is the breakdown of Medicompanionβs directory:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.
βββ README.md # Documentation for the project
βββ chat_model.py # Implementation of the chat model
βββ config.py # Configuration settings for the application
βββ document_loader.py # Functions to load documents from the dataset
βββ logger_config.py # Logger configurations for the application
βββ main.py # Entry point for the application
βββ tasks.py # all the logic for different tasks
βββ rag-datasets # Directory containing the datasets
β βββ gym supplements # Documents related to gym supplements
β β βββ 1. Analysis of Actual Fitness Supplement.pdf
β β βββ 2. High Prevalence of Supplement Intake.pdf
β βββ health supplements # Documents related to health supplements
β βββ 1. dietary supplements - for whom.pdf
β βββ 2. Nutraceuticals research.pdf
β βββ 3.health_supplements_side_effects.pdf
βββ resources # Additional resources (e.g., images, outputs)
β βββ console_output.png # Example output screenshot
βββ logs # Directory to store logs
β βββ application.log # log file
βββ retriever.py # Functions to retrieve relevant documents
βββ text_splitter.py # Functions to split text for processing
βββ vector_store.py # Vector store implementation for embeddings
Key Files
- main.py: Launches the Medicompanion chatbot application.
- chat_model.py: Implements the LLaMA model, enabling natural, responsive interactions.
- document_loader.py: Loads and processes health-related documents.
- resources/: Contains example outputs and images for easy reference.
π§ Getting Started
To set up the Medicompanion application, clone the repository and install the necessary dependencies.
1
2
3
git clone https://github.com/AbhijitMore/MediCompanion.git
cd MediCompanion
pip install -U langchain-community faiss-cpu langchain-huggingface pymupdf langchain-ollama python-dotenv
After installing dependencies, start the chatbot application by running:
1
python main.py
This will initialize the Medicompanion chatbot, allowing users to ask questions related to health supplements and receive informative responses.
π Datasets
Medicompanion leverages categorized documents located in rag-datasets/
. These datasets, covering gym and health supplements, help the chatbot provide reliable, accurate responses by storing embeddings that facilitate quick retrieval during conversations.
π Application Performance & Features
Interactive Responses
Once started, the Medicompanion application provides real-time responses based on user queries, drawing from its database of health and supplement documents. Responses can include side effects, benefits, and usage guidelines for various supplements.
π Results & Performance
Throughout its operation, Medicompanion outputs relevant response:
π€ Contributions
Contributions are warmly welcomed! Whether youβre interested in enhancing features, refining responses, or adding new datasets, all efforts are appreciated. Fork the repository and submit a pull request to join in on advancing healthcare AI applications with Medicompanion.