LLM-Powered Prescription Cart Intelligence: A Hybrid System for Real-Time Drug Interaction Detection in E-Commerce
Deepanjan Mukherjee , Independent Researcher, USAAbstract
The present online pharmacy market lacks real-time drug-drug interaction detection during the shopping experience. This paper presents a unique system to detect interactions directly in e-commerce pharmacy shopping carts, reducing the risk of adverse drug reactions that could lead to potential hospitalizations. The hybrid system combines the current rule-based checking using commercial databases (DrugBank, First DataBank) with Large Language Models (LLMs) to improve contextual analysis through Retrieval-Augmented Generation (RAG). A three-layer design comprising of interaction detection, LLM enhancement, and user experience layers is proposed, to achieve under 500ms response times through microservices architecture and multi-tier caching, while generating user-friendly natural language explanations. A confidence scoring mechanism flags uncertain outputs for further pharmacy review and intervention to ensure user safety. The system also addresses critical limitations of current similar tools requiring use of separate interaction checkers by providing seamless cart-level integration. The proposed evaluation methodology targets >90% sensitivity for major interactions and >80% specificity to minimize pharmacist fatigue due to false positives.
Keywords
LLM, Artificial Intelligence, Drug-drug interactions, E-commerce, Clinical decision support, Patient safety, Online pharmacy, Polypharmacy
References
Sharath Kommu, C. Carter, and P. Whitfield, “Adverse Drug Reactions,” Nih.gov, Jan. 10, 2024. http://ncbi.nlm.nih.gov/books/NBK599521/.
Research and Markets, “Online Pharmacy Market Report 2024, with Forecasts to 2030, Featuring Profiles of CVS Health, The Kroger Co., Walmart, Cigna Healthcare, DocMorris, UnitedHealth, Giant Eagle and Apollo Pharmacy,” GlobeNewswire News Room, Nov. 12, 2024. https://www.globenewswire.com/news-release/2024/11/12/2979234/28124/en/Online-Pharmacy-Market-Report-2024.
K. J. Quinn and N. H. Shah, “A dataset quantifying polypharmacy in the United States,” Scientific Data, vol. 4, Oct. 2017, doi: https://doi.org/10.1038/sdata.2017.167.
J. Sultana, P. Cutroneo, and G. Trifirò, “Clinical and economic burden of adverse drug reactions,” Journal of Pharmacology and Pharmacotherapeutics, vol. 4, no. 5, p. 73, 2013, doi: https://doi.org/10.4103/0976-500x.120957.
R. Rodríguez-Monguió, M. J. Otero, and J. Rovira, “Assessing the Economic Impact of Adverse Drug Effects,” PharmacoEconomics, vol. 21, no. 9, pp. 623–650, Jun. 2003, doi: https://doi.org/10.2165/00019053-200321090-00002.
R. Aparasu, R. Baer, and A. Aparasu, “Clinically important potential drug-drug interactions in outpatient settings,” Research in Social and Administrative Pharmacy, vol. 3, no. 4, pp. 426–437, Dec. 2007, doi: https://doi.org/10.1016/j.sapharm.2006.12.002.
K. R. Saverno et al., “Ability of pharmacy clinical decision-support software to alert users about clinically important drug—drug interactions,” Journal of the American Medical Informatics Association, vol. 18, no. 1, pp. 32–37, Jan. 2011, doi: https://doi.org/10.1136/jamia.2010.007609.
D. Vito, F. Ferrucci, and A. Angelakis, “LLMs for Drug-Drug Interaction Prediction: A Comprehensive Comparison,” arXiv.org, 2025. https://arxiv.org/abs/2502.06890.
K. M. Giacomini, R. M. Krauss, D. M. Roden, M. Eichelbaum, M. R. Hayden, and Y. Nakamura, “When good drugs go bad,” Nature, vol. 446, no. 7139, pp. 975–977, Apr. 2007, doi: https://doi.org/10.1038/446975a.
I. Cascorbi, “Drug Interactions,” Deutsches Aerzteblatt Online, vol. 109, no. 33–34, Aug. 2012, doi: https://doi.org/10.3238/arztebl.2012.0546.
M. Rowland, “INTRODUCING PHARMACOKINETIC AND PHARMACODYNAMIC CONCEPTS*,” Journal of Liposome Research, vol. 11, no. 4, pp. 395–422, Jan. 2001, doi: https://doi.org/10.1081/lpr-100108614.
J. Niu, R. M. Straubinger, and D. E. Mager, “Pharmacodynamic Drug–Drug Interactions,” Clinical Pharmacology & Therapeutics, vol. 105, no. 6, pp. 1395–1406, Apr. 2019, doi: https://doi.org/10.1002/cpt.1434.
A. Alanazi, W. Alalawi, B. Aldosari, A. Alanazi, W. Alalawi, and B. Aldosari, “An Evaluation of Drug-Drug Interaction Alerts Produced by Clinical Decision Support Systems in a Tertiary Hospital,” Cureus, vol. 15, no. 8, Aug. 2023, doi: https://doi.org/10.7759/cureus.43141.
Z. Fang, X. Zhang, A. Zhao, X. Li, H. Chen, and J. Li, “Recent Developments in GNNs for Drug Discovery,” arXiv.org, 2025. https://arxiv.org/abs/2506.01302.
K. Abbas, C. Hao, X. Yong, M. K. Hasan, S. Islam, and A. Hadi, “Graph neural network-based drug-drug interaction prediction,” Scientific Reports, vol. 15, no. 1, pp. 30340–30340, Aug. 2025, doi: https://doi.org/10.1038/s41598-025-12936-1.
Y. Chen et al., “DrugDAGT: a dual-attention graph transformer with contrastive learning improves drug-drug interaction prediction,” BMC Biology, vol. 22, no. 1, Oct. 2024, doi: https://doi.org/10.1186/s12915-024-02030-9.
H. Qi, X. Li, C. Zhang, and T. Zhao, “Improving drug-drug interaction prediction via in-context learning and judging with large language models,” Frontiers in Pharmacology, vol. 16, Jun. 2025, doi: https://doi.org/10.3389/fphar.2025.1589788.
“DrugBank Online,” Drugbank.com, 2025. https://go.drugbank.com/clinical/drug_drug_interaction_checker.
L. A. Marcath, J. Xi, E. K. Hoylman, K. M. Kidwell, S. L. Kraft, and D. L. Hertz, “Comparison of Nine Tools for Screening Drug-Drug Interactions of Oral Oncolytics,” Journal of Oncology Practice, vol. 14, no. 6, pp. e368–e374, Jun. 2018, doi: https://doi.org/10.1200/JOP.18.00086.
Download and View Statistics
Copyright License

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors retain the copyright of their manuscripts, and all Open Access articles are disseminated under the terms of the Creative Commons Attribution License 4.0 (CC-BY), which licenses unrestricted use, distribution, and reproduction in any medium, provided that the original work is appropriately cited. The use of general descriptive names, trade names, trademarks, and so forth in this publication, even if not specifically identified, does not imply that these names are not protected by the relevant laws and regulations.


Engineering and Technology
| Open Access |
DOI: