Post

Medicompanion RAG Application: Transforming Healthcare Information Delivery

Open in Github Page

πŸ€–πŸ’Š 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
MediCompanion
β”œβ”€β”€ README.md               # Project documentation
β”œβ”€β”€ main.py                 # Main application entry point
β”œβ”€β”€ chat_model.py           # Core chat model implementation
β”œβ”€β”€ config.py               # Configuration settings
β”œβ”€β”€ document_loader.py      # Document loading and preprocessing
β”œβ”€β”€ rag-datasets/           # Folder for datasets
β”‚   β”œβ”€β”€ gym supplements     # Gym supplements documents
β”‚   └── health supplements  # Health supplements documents
β”œβ”€β”€ resources/              # Resources for output examples
β”œβ”€β”€ retriever.py            # Document retrieval functions
β”œβ”€β”€ text_splitter.py        # Splits text for efficient processing
└── vector_store.py         # Embeddings storage for quick retrieval

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:

  • Console Output: Records of real-time chat outputs, providing insights into user interactions.

🀝 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.


This post is licensed under CC BY 4.0 by the author.