Improving Electronic Health Records with NLP and LLM-RAG: A Scalable AI Method for Processing Medical Data
Published 2025-08-18
Keywords
- Large Language Model (LLM),
- Retrieval-Augmented Generation (RAG),
- EHR Processing,
- Vector Database (Qdrant) for Medical Data
How to Cite
Abstract
The rapid adoption of Artificial Intelligence (AI) has transformed Electronic Health Records (EHRs) for clinical decision-making, yet traditional systems suffer from poor contextual awareness, slow retrieval, and limited adaptability to real-time medical updates. To overcome these challenges, this study proposes an AI-powered healthcare assistant leveraging Retrieval-Augmented Generation (RAG) in Large Language Models (LLMs). Unlike existing chatbots that face issues with factual consistency, outdated data, and inefficient information retrieval, the proposed system integrates Groq LLaMA 3.1 (LLM), Qdrant (vector database), Hugging Face E5-large-v2 (embeddings), Tavily API (real-time search), and Supabase (authentication & storage) to provide a comprehensive solution. Through semantic search, AI-driven summarization, and dynamic access to reliable sources, the assistant significantly improves response accuracy, document search efficiency, and adaptability to evolving medical guidelines. Experimental results highlight enhanced decision support, automation, and patient care, underscoring the potential of AI-driven EHR systems to improve interactivity, intelligence, and accessibility in healthcare while enabling better real-time clinical outcomes.
References
- OpenAI. (2023, March 14). ChatGPT [Large language model]. https://chat.openai.com/chat
- Chase, H. (2022). LangChain. GitHub. https://github.com/langchain-ai/langchain
- Bang, Y., Cahyawijaya, S., Lee, N., Dai, W., Su, D., Wilie, B., Lovenia, H., Ji, Z., Yu, T., Chung, W., et al. (2023). A multitask, multilingual, multimodal evaluation of ChatGPT on reasoning, hallucination, and interactivity. arXiv Preprint, arXiv:2302.04023. https://doi.org/10.48550/arXiv.2302.04023
- Guo, C., Lu, Y., Dou, Y., & Wang, F. Y. (2023). Can ChatGPT boost artistic creation: The need of imaginative intelligence for parallel art. IEEE/CAA Journal of Automatica Sinica, 10(4), 835–838. https://doi.org/10.1109/JAS.2023.123456
- Ji, Z., Lee, N., Frieske, R., Yu, T., Su, D., Xu, Y., Ishii, E., Bang, Y. J., Madotto, A., & Fung, P. (2023). Survey of hallucination in natural language generation. ACM Computing Surveys, 55(12), 1–38. https://doi.org/10.1145/3571730
- He, H., Zhang, H., & Roth, D. (2022). Rethinking with retrieval: Faithful large language model inference. arXiv Preprint, arXiv:2301.00303. https://doi.org/10.48550/arXiv.2301.00303
- Shen, X., Chen, Z., Backes, M., & Zhang, Y. (2023). In ChatGPT we trust? Measuring and characterizing the reliability of ChatGPT. arXiv Preprint, arXiv:2304.08979. https://doi.org/10.48550/arXiv.2304.08979
- Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W., Kiela, D., et al. (2020). Retrieval-augmented generation for knowledge-intensive NLP tasks. Advances in Neural Information Processing Systems, 33, 9459–9474.
- Gao, Y., Xiong, Y., Gao, X., Jia, K., Pan, J., Bi, Y., Dai, Y., Sun, J., Wang, M., Wang, H., et al. (2023). Retrieval-augmented generation for large language models: A survey. arXiv Preprint, arXiv:2312.10997. https://doi.org/10.48550/arXiv.2312.10997
- Borgeaud, S., Mensch, A., Hoffmann, J., Cai, T., Rutherford, E., Millican, K., Van Den Driessche, G. B., Lespiau, J.-B., Damoc, B., Sifre, L., et al. (2022). Improving language models by retrieving from trillions of tokens. In Proceedings of the International Conference on Machine Learning (pp. 2206–2240). PMLR.
- Roberts, A., Raffel, C., & Shazeer, N. (2020). How much knowledge can you pack into the parameters of a language model? arXiv Preprint, arXiv:2002.08910. https://doi.org/10.48550/arXiv.2002.08910
- Elaraby, M., Lu, M., Dunn, J., Zhang, X., Wang, Y., & Liu, S. (2023). Halo: Estimation and reduction of hallucinations in open-source weak large language models. arXiv Preprint, arXiv:2308.11764. https://doi.org/10.48550/arXiv.2308.11764
- Stechly, K., Marquez, M., & Kambhampati, S. (2023). GPT-4 doesn’t know it’s wrong: An analysis of iterative prompting for reasoning problems. arXiv Preprint, arXiv:2310.12397. https://doi.org/10.48550/arXiv.2310.12397
- Huang, R., Li, M., Yang, D., Shi, J., Chang, X., Ye, Z., Wu, Y., Hong, Z., Huang, J., Watanabe, S., et al. (2024). AudioGPT: Understanding and generating speech, music, sound, and talking head. In Proceedings of the AAAI Conference on Artificial Intelligence (Vol. 38, pp. 23802–23804). AAAI Press.
- Izacard, G., Lewis, P., Lomeli, M., Hosseini, L., Petroni, F., Schick, T., Dwivedi-Yu, J., Joulin, A., Riedel, S., Grave, E., et al. (2023). ATLAS: Few-shot learning with retrieval augmented language models. Journal of Machine Learning Research, 24(259), 1–43.
- Guu, K., Lee, K., Tung, Z., Pasupat, P., & Chang, M. (2020). Retrieval augmented language model pre-training. In Proceedings of the International Conference on Machine Learning (pp. 3929–3938). PMLR.
- Fathima, A. S., Basha, S. M., Ahmed, S. T., Khan, S. B., Asiri, F., Basheer, S., & Shukla, M. (2025). Empowering consumer healthcare through sensor-rich devices using federated learning for secure resource recommendation. IEEE Transactions on Consumer Electronics.
- Ahmed, S. T., Fathima, A. S., Mathivanan, S. K., Jayagopal, P., Saif, A., Gupta, S. K., & Sinha, G. (2024). iLIAC: An approach of identifying dissimilar groups on unstructured numerical image dataset using improved agglomerative clustering technique. Multimedia Tools and Applications, 83(39), 86359-86381.
- Periasamy, K., Periasamy, S., Velayutham, S., Zhang, Z., Ahmed, S. T., & Jayapalan, A. (2022). A proactive model to predict osteoporosis: An artificial immune system approach. Expert Systems, 39(4), e12708.