- π½οΈ Demo Videos
- Overview
- π Features
- π Architecture
- π§ Tech Stack
- π Future Enhancements
- Prerequisites
- π§ Setting Up the Project
- Project Demo β Overview of the project in action.
- OCR Testing Video β Demonstration of Gemini OCR extracting text from handwritten prescriptions.
- OCR - Previous approach using Ollama β Comparison of previous OCR approach with Ollama.
PharmAssistAI is an AI-powered assistant designed to automate pharmacy operations, making them faster, more efficient, and error-free.
- Prescription processing via advanced OCR and LLMs
- AI-powered medicine alternatives using vector search
- Automated invoice generation & management
- Quick stock alerts based on sales.
- Agentic AI for intelligent SQL query execution
- Home remedies chatbot for customer engagement
- Interactive dashboard with inventory insights
- Prescription Processing β Extracts text from handwritten prescriptions using Gemini-2.0-Flash-Exp OCR.
- Alternative Medicine Suggestions β Uses ChromaDB for vector-based search to suggest similar medicines.
- Home Remedies Recommendations β Uses LLM (Gemini-2.0-Flash) AI-powered chatbot provides natural remedy suggestions from trusted sources like WHO, NIH, and Mayo Clinic.
- Inventory Management β Track medicine stock levels, visualize data, and get real-time stock alerts via dashboard.
- Agentic AI for SQL β Enables natural language interaction with the database, eliminating manual SQL queries.
- Invoice Management β Automatically generates, stores, and prints invoices, with options to delete outdated records.
- Alert System β Allows you to set custom stock thresholds and provides low-stock alerts based on medicine available quantity.
- Data Insights & Visualization β Real-time analytics on sales and stock trends.
- FastAPI β Backend server for prescription processing and API management.
- OpenCV β Image enhancement for better OCR accuracy.
- Ollama β Llama 3.2-Vision:11B for OCR (previous approach).
- ChromaDB β Vector search for alternative medicine recommendations.
- SQLite3 β Lightweight SQL database for pharmacy inventory.
- SQLAlchemy β ORM for efficient database interactions.
- Pydantic β Schema validation for data consistency.
- Streamlit β Rapid prototyping and interactive UI.
- Plotly β Data visualization for inventory trends.
- Pandas β Structuring and processing data in the frontend.
- Groq [Mixtral-8x7b-32768] β AI model for intelligent SQL query execution.
- LangChain & LangGraph β Frameworks for AI-driven automation.
- ChromaDB β Vector database for retrieving semantically similar medicines.
- Sentence-Transformers β Converts medicine data into embeddings for better search.
- Gemini-2.0-Flash-Experimental β OCR model for text extraction from prescriptions.
- Gemini-2.0-Flash β AI model for herbal remedy suggestions.
- OAuth Authentication β Secure user access and database modifications.
- Scalability β Migrate from SQLite3 to PostgreSQL for handling large datasets.
- Enhanced UI/UX β Migrate frontend from Streamlit to React for better control and usability.
- Python 3.9+
Below are two ways to set up the project β using Docker Compose (recommended) or manual setup.
Seamlessly run the entire application stack (FastAPI + Streamlit) in isolated containers with a single command.
- Docker: Install Docker
- Docker Compose: Install Docker Compose
git clone https://github.com/ritu456286/PharmAssistAI.git
cd PharmAssistAI- Create a
.envfile inside/backendand add:
GEMINI_API_KEY= <your_gemini_api_key>
GROQ_API_KEY= <your_groq_api_key>- Create a
.envfile inside/frontendand add:
BASE_URL=http://backend:8000/docker-compose up --build
- Frontend (Streamlit UI): http://localhost:8501
- Backend (FastAPI docs): http://localhost:8000/docs
git clone https://github.com/ritu456286/PharmAssistAI.git
cd PharmAssistAINOTE : Add the resources folder in the project, with medicines_ds.csv file, for mock medicines data.
Navigate to the backend folder:
cd backend- Create a Python virtual environment
python -m venv venv-
Activate the virtual environment
- Windows:
venv\Scripts\activate - Mac/Linux:
source venv/bin/activate
- Windows:
-
Install dependencies
pip install -r requirements.txt- Create a
.envfile inside/backendand add:
GEMINI_API_KEY= <your_gemini_api_key>
GROQ_API_KEY= <your_groq_api_key>-
Create an empty
/src/dbfolder where SQLite and ChromaDB will be stored. -
Start the FastAPI server
sh run.shNavigate to the frontend folder:
cd frontend- Create a Python virtual environment
python -m venv venv-
Activate the virtual environment
- Windows:
venv\Scripts\activate - Mac/Linux:
source venv/bin/activate
- Windows:
-
Install dependencies
pip install -r requirements.txt- Create a
.envfile inside/frontendand add:
BASE_URL=<url_where_your_backend_server_is_running>- Start the Streamlit app
streamlit run main.py- Ensure both backend and frontend servers are running.
- Update the inventory with your pharmacy database.
- Explore real-time stock tracking, automated billing, AI recommendations, and more!
