Pharmabot is an advanced AI-driven pharmacy assistant designed to provide medical triage, drug recommendations, and safety evaluations. It leverages Natural Language Processing (NLP) and multiple medical databases to ensure accurate and safe guidance for users.
- Intelligent Triage: Analyzes user symptoms to determine the urgency of care.
- Personalized Recommendations: Suggests over-the-counter (OTC) medications based on user profiles and clinical data.
- Multi-Layered Safety: Validates recommendations against BNF, DrugBank, OpenFDA, and MHRA databases.
- Secure Authentication: Robust user management and profile security.
- Dynamic Frontend: Modern, responsive interface built with Next.js.
- Advanced Clinical Reasoning:
- Explainable Safety Trace: Auditable reasoning for all clinical decisions.
- Mathematical Confidence Scoring: Real-time certainty metrics for NLP extraction.
- Adaptive Follow-Up Engine: Prioritized questioning based on clinical risk (including eye red-flag and dizziness pathways).
- Symptom Timeline Tracking: Accurate persistence detection across sessions.
- Condition-Aware NSAID Safety: Dynamic safety messages when NSAIDs are hidden (e.g. asthma vs anticoagulants); diarrhoea/vomiting triggers kidney-risk exclusion and contextual advice.
- Python: 3.9 or higher
- Node.js: 18.x or higher
- NPM: 9.x or higher
- Navigate to the
backenddirectory:cd backend - Create and activate a virtual environment:
python -m venv .venv .venv\Scripts\activate # On Windows source .venv/bin/activate # On Unix/macOS
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables in a
.envfile (refer to.env.exampleif available). - Database: The repository does not include
.dbfiles. On first run the app will create the SQLite database and seed it (products and safety rules). To initialize the database without starting the server, from thebackenddirectory run:Or start the backend once—it runs the same create-if-not-exists and seeding on startup.python scripts/init_db.py
- Navigate to the
storefrontdirectory:cd storefront - Install dependencies:
npm install
You can run both the backend and frontend simultaneously from the root directory:
npm run devAlternatively, run them separately:
- Backend:
npm run backend - Frontend:
npm run frontend
The backend will be available at http://localhost:8000 and the frontend at http://localhost:3000.
- Project Report: Detailed technical overview and implementation details.
- Layered Architecture: Deep dive into the system's design patterns.
- Payments Guide: Information regarding payment integrations. (to test payement getaway card number "5555555555554444", "any 3 digit cvc", "any future date")