Abstract
Navigating electronic health records (EHRs) remains a time-consuming task for clinicians, especially in resource-constrained healthcare settings. This study aimed to assess whether a lightweight chatbot, built using LangChain and GPT-3.5, could reduce search time and improve retrieval accuracy for CSV-based pediatric EHRs in a district hospital. A prototype EHR system was developed using Flask and Angular and integrated with a LangChain CSV agent capable of generating Python code dynamically to query anonymized data. The dataset consisted of 1,200 pediatric encounters, each comprising 160 variables. Forty clinicians performed 240 standardized information-seeking tasks both with and without the chatbot. The hospital's legacy EHR system, which relied on basic keyword search, served as the baseline for comparison. Search time and retrieval accuracy-measured using precision and recall-were evaluated using two-tailed paired t-tests with a significance threshold of α = 0.05. The chatbot reduced the median search time from 64 s to 38 s, representing a 40.6% improvement (p < 0.001). It also increased F1 retrieval accuracy from 0.71 to 0.89, a 25.4% gain (p < 0.01). These results demonstrate that low-cost conversational AI can significantly accelerate and improve access to structured pediatric EHR data while maintaining data privacy by avoiding the exposure of raw patient records to external models.