Abstract
This article summarises a recently completed 2-year project titled “CDC-MEXICO cooperative agreement for ‘Surveillance, Epidemiology, and Laboratory Capacity/Antimicrobial Resistance’,” which aimed to develop an information system for the control of antimicrobial resistance (AMR) at the primary level of care in Mexico.
This collaborative initiative between the Mexican Ministry of Health, the U.S. Centers for Disease Control and Prevention (CDC), and Fundación México-Estados Unidos para la Ciencia (FUMEC) focused on delivering two primary outcomes: (1) a full-stack TypeScript Software-as-a-Service application (RAM App) for use by primary healthcare providers, and (2) a centralized laboratory for receiving, analysing, and recording AMR test results from patient samples.
The project successfully established both a digital platform and a laboratory infrastructure, enabling clinicians to receive standardized treatment recommendations, leverage laboratory-confirmed diagnoses, and access real-time surveillance data. These integrated tools directly address critical gaps in diagnostic support, stewardship education, and resistance tracking at the primary care level.
Additionally, this article includes a bibliometric analysis of nearly 3,400 research papers retrieved from the PubMed database using the query “antimicrobial resistance primary healthcare.” The analysis helps situate the RAM App initiative within the global research landscape and underscores the relevance of this work in supporting national and international AMR control efforts.
Introduction
Antimicrobial resistance (AMR) is considered a major threat to international public health. Both the World Health Organization (WHO) and the UN General Assembly consider AMR one of the greatest global public health threats of our time (10). AMR can lead to more severe infections, longer hospital stays, increased treatment costs, and a higher risk of death (1-5). Infections caused by resistant bacteria are more difficult, and sometimes impossible, to treat with currently available drugs (2, 4, 6).
The highest burden of disease often falls on low- and middle-income countries. They are often at higher risk for AMR due to factors such as poorly resourced health programs, difficulties in controlling antibiotic consumption, self-medication, poor sanitation, and hygiene (1, 9). The rise of AMR can render public health measures that rely on mass drug administration ineffective, wasting valuable resources (11).
Paradoxically, while overuse and misuse of antibiotics are drivers of AMR, inadequate access to effective antimicrobials also poses a significant challenge in low- and middle-income countries (3, 9, 13). Many individuals cannot afford the full course of treatment and may take incomplete doses, contributing to resistance (9). Conversely, the easy availability of antimicrobials over the counter without prescription and the practice of self-medication further exacerbate inappropriate use (1). Infectious diseases are already a major cause of death in these regions, with AMR further complicating this by threatening the effectiveness of programs designed to combat such diseases (1, 5, 9).
Primary healthcare plays a crucial role in antimicrobial resistance (AMR) containment but also presents distinct challenges that contribute to its spread. These challenges arise from sources including diagnostic uncertainty, patient expectations, prescribing variations, and structural limitations. Primary care doctors (General Practitioners or GPs) are the most frequent prescribers of antibiotics (3, 13), often issuing prescriptions for common self-limiting conditions such as sore throat, cough, and otitis media. As many of these conditions are viral, antibiotics provide no therapeutic benefit and are ineffective (6). Clinicians in primary care often face the challenge of differentiating between viral and bacterial infections (13). The concern that failing to treat a bacterial infection could lead to severe complications sometimes drives prescribers to err on the side of caution and prescribe antibiotics even when unnecessary (13). Additionally, due to limited access to rapid diagnostic tools, empirical prescribing based on symptoms rather than definitive diagnosis is common (3, 13).
Patients frequently expect or even ask for antibiotics, believing they will lead to faster recovery, even when they are not necessary (6). This pressure from patients can influence prescribers to issue prescriptions they might otherwise avoid (6). Studies have shown that patient knowledge of upper respiratory infections can impact antibiotic expectations and unnecessary utilisation (11).
There is considerable variation in antibiotic prescribing rates among different general practices that cannot be solely explained by differences in the epidemiology of infections, patient populations, or case mix (13). Despite national guidelines promoting rational antibiotic use, adherence remains inconsistent, with local prescriber behaviours, experiences, and attitudes influencing prescribing decisions (3).
Unlike hospital settings, where isolation measures are more feasible and can thus limit the spread of resistant pathogens, community-based transmission is harder to control (14). Poor sanitation and hygiene, particularly in resource-limited settings, facilitate the spread of resistant Enterobacteriaceae through common transmission routes such as the faecal-oral pathway (1).
Early detection of AMR is crucial for implementing public health interventions (14). However, unlike in hospital settings, where resistance monitoring is more structured, outpatient settings often lack systematic surveillance, making it difficult to track treatment effectiveness and emerging resistance patterns (14).
Addressing antimicrobial resistance in primary healthcare requires a multifaceted approach that integrates antimicrobial stewardship programs, improved diagnostics, public education, and adherence to prescribing guidelines. These strategies work collectively to ensure appropriate antibiotic use while minimizing resistance development.
Antimicrobial stewardship is defined as coordinated strategies and efforts to measure and optimise antibiotic use while both optimising the treatment of infections and reducing the adverse events associated with antibiotic use (6). Stewardship programs coordinate strategies to optimize antibiotic use by ensuring that the right drug is prescribed at the right dose and for the appropriate duration (6). These efforts aim to balance effective infection treatment with the minimization of resistance risks.
Adherence to prescribing guidelines plays a fundamental role within the context of antimicrobial stewardship in primary healthcare. Prescribing guidelines are crucial in defining what constitutes the ‘right’ antibiotic, dose, and duration for specific clinical scenarios. They provide evidence-based recommendations for the management of common infections. Adherence to these guidelines helps primary care prescribers select the most appropriate antibiotic based on the likely bacterial cause, local resistance patterns (where available), and patient factors (3, 6, 13). This ensures that patients receive the antibiotic most likely to be effective for their specific infection, avoiding the unnecessary use of broad-spectrum antibiotics which can contribute to resistance (1, 9).
Thus, only through the implementation of multifaceted stewardship initiatives, promoting diagnostic advancements, and fostering public awareness, primary healthcare systems can we significantly reduce inappropriate antibiotic use and curb the spread of antimicrobial resistance (13).
The Contribution of this Work
Addressing the growing challenge of antimicrobial resistance in primary healthcare requires innovative, evidence-based solutions that ensure standardized treatment recommendations, accurate diagnostics, educational tools, and real-time epidemiological insights. In response to these needs, we developed a nationwide digital platform: the ‘RAM App’.
This 2-year collaborative project, spearheaded by the Mexican Ministry of Health, the CDC, and FUMEC, introduced a web-based system designed to support primary healthcare providers by improving prescribing practices, diagnostics, AMR surveillance, and public health response. The RAM App integrates multiple critical functions to mitigate the inappropriate use of antibiotics and improve AMR management at the community level:
-
Standardized Treatment Recommendations:
The RAM App provides a unified framework for antimicrobial prescribing, addressing the issue of wide variations in prescribing practices and adherence to guidelines.
By incorporating clinical algorithms based on a national consensus for AMR guidelines, the system offers real-time decision support, reducing reliance on empirical prescribing and ensuring appropriate antibiotic selection.
-
Centralized Laboratory Diagnostics for AMR Surveillance:
Recognizing the diagnostic uncertainty that drives unnecessary antibiotic use, the project established a central laboratory to process patient samples from participating clinics.
This allows for standardized testing of all samples, ensuring that bacterial resistance patterns are identified accurately and consistently.
Linking laboratory results with the web-based application allows clinicians to make evidence-based prescribing decisions and facilitates early detection of resistant pathogens.
-
Promoting Antimicrobial Stewardship through Education and Prescription Guidelines:
The RAM App serves as an AMR education platform, reinforcing antimicrobial stewardship by providing up-to-date prescribing guidelines directly within the interface used by healthcare providers.
This ensures adherence to best practices in antibiotic use, reducing unnecessary prescriptions and patient-driven demands for antibiotics.
-
Epidemiological Surveillance and Geographic AMR Mapping:
A key feature of the RAM App is its built-in data analysis and reporting module, which tracks geographic and demographic trends in antimicrobial resistance.
This function enables public health authorities to rapidly detect outbreaks or regions with high resistance levels, allowing for targeted infection control measures before AMR becomes widespread.
By addressing these four pillars - standardized treatment, centralized diagnostics, stewardship education, and real-time epidemiological tracking - the RAM App directly tackles the primary healthcare challenges that contribute to AMR.
The application focuses on a set of five conditions most closely associated with antimicrobial resistance, and the mistreatment with antibiotics, in the primary healthcare setting.
-
Urinary Tract Infections (UTI’s).
While antibiotics are often necessary for UTIs, broad-spectrum antibiotics are sometimes used when narrow-spectrum options would be sufficient (3). Resistance to commonly used antibiotics like ciprofloxacin for uropathogens such as E. coli is increasing globally (1, 4, 14). The emergence of fluoroquinolone-resistant E. coli in the digestive tract can also contribute to resistant urinary infections (14).
-
Sexually Transmitted Infections (STI’s).
Resistance in Neisseria gonorrhoeae is a significant and documented problem, with resistance developing to one antibiotic after another, including penicillin, tetracycline, fluoroquinolones, and even current options like cephalosporins (1, 9, 14). This implies that past and potentially current treatment practices have contributed to this selection of resistance i.e. inappropriate prescriptions and the mistreatment with antibiotics. When antibiotics are available over-the-counter (1, 9) we often see self-medication and incomplete or inappropriate treatment of STIs, which in turn fosters resistance (1, 14, 21).
-
Upper and Lower respiratory tract infections.
These account for the majority of outpatient antimicrobial use (14). Many physicians prescribe antibiotics for common symptoms of cough, cold, and flu, despite their proven lack of efficacy against these viral illnesses (1, 2, 3). It is estimated that half of the 100 million annual prescriptions in the United States for respiratory infections may be unnecessary (14). Patients also frequently expect antibiotics for these conditions (3, 6).
-
Acute diarrheal diseases.
While some diarrheal illnesses are caused by bacteria and require antibiotic treatment, the majority are due to viruses or other non-bacterial causes (3). Empirically treating all cases of diarrhoea with antibiotics is inappropriate. This is particularly concerning for the spread of resistant Enterobacteriaceae through the faecal-oral route (1). Inappropriate antibiotic use can disrupt the normal gut microbiota, potentially allowing resistant pathogens like C. difficile to overgrow (14).
By integrating clinical decision support, laboratory diagnostics, and real-time AMR monitoring, the RAM App represents a scalable, evidence-based model for AMR control in primary healthcare.
Structure of this Report
This paper is structured to provide a comprehensive analysis of antimicrobial resistance (AMR) in the primary healthcare setting, combining global context, bibliometric research, and a detailed examination of our project implementation in Mexico.
We begin with the section “Bibliometric Analysis” - an assessment of the current landscape of AMR research in primary healthcare. Here we conduct a bibliometric analysis of the 3,405 research papers retrieved from PubMed using the query “antimicrobial resistance primary healthcare”. This section employs topic modelling techniques to identify major research themes, revealing key areas of focus within the literature. The findings are then contextualized within the broader discussion from the introduction given above, drawing connections between the themes that emerge from the research corpus and the real-world challenges faced in primary healthcare settings.
Next, we present the RAM App project, describing its development, implementation, and expected impact in Mexico. This includes an overview of the technological infrastructure, detailing how the web-based platform and centralized laboratory function as integrated solutions for AMR control. Additionally, this section explores the real-world application of the RAM App, focusing on healthcare provider adoption, patient outcomes, and early insights from AMR surveillance efforts. Finally, it discusses policy implications and future scalability, considering how similar systems could be expanded or adapted for broader national and international AMR mitigation efforts.
Bibliometric Analysis
To contextualize our work within the broader scientific landscape of antimicrobial resistance, specifically in the primary healthcare setting of our “CDC-MEXICO cooperative agreement for ‘Surveillance, Epidemiology, and Laboratory Capacity/Antimicrobial Resistance” project, we conducted a bibliometric analysis of relevant research literature. This analysis aimed to identify major research themes, gaps, and trends within the field, facilitating a better understanding of how our project aligns with and contributes to global efforts in AMR stewardship, surveillance and mitigation.
Data Collection and Preprocessing
We sourced our dataset from PubMed, the United States National Library of Medicine’s primary biomedical literature repository. Using the search query “antimicrobial resistance primary healthcare”, we retrieved an initial set of research papers. The query results were not restricted in any way, e.g. by publication date or language. To ensure the integrity of the dataset, we applied a rigorous cleaning process, which included multiple steps and rounds of replacing acronyms with their full text equivalents, removing punctuation characters, and unifying characters to ‘UTF-8’ format. Additionally, we removed specific types of results that we considered non-research based such as editorials and commentaries, resulting in a refined corpus of 3,405 research papers.
Topic Modelling Methodology
To uncover the thematic structure of this corpus, we leveraged BERTopic (17), an AI-driven topic modelling technique that clusters documents based on their semantic content. Our processing pipeline included:
-
Vector Embeddings Generation: We represented each research paper title as a high-dimensional vector using the SentenceTransformer library (22) with the all-mpnet-base-v2 model, which encodes textual information into a 768-dimensional space.
-
Dimensionality Reduction: To facilitate clustering and visualization, we employed UMAP (Uniform Manifold Approximation and Projection) (18), a non-linear technique that effectively reduces high-dimensional data to lower dimensionality (two-dimensions in our case) while preserving its underlying structure.
-
Clustering: We applied HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise) (19), a robust clustering algorithm that identifies distinct groups of research topics based on their proximity in the reduced vector space.
-
Keyword Extraction and Topic Labelling: Using TF-IDF (Term Frequency-Inverse Document Frequency) implemented with the ‘CountVectorizer’ class from the ‘sklearn’ library (23), we extracted representative keywords for each cluster. These were then processed through the Llama-2-13b-chat-hf large language model with a tailored prompt to generate meaningful topic labels.
The output of this process is a thematic clustering of antimicrobial resistance research in primary healthcare, visualized as a two-dimensional cluster plot (Figure 1). Each cluster represents a distinct research theme, with the number of research papers corresponding to the level of attention that theme has received in the literature.

Key Research Themes Identified
Our analysis revealed 20 dominant research topics, highlighting the diverse areas of interest in AMR within primary healthcare. The most prevalent topics and their corresponding publication counts are as follows:
- Antibiotic Prescribing in Primary Care (257 papers).
- Primary Care Management of Respiratory Tract Infections (256 papers).
- Antibiotic Stewardship Knowledge Gaps (218 papers).
- Carbapenem-Resistant Infections Treatment (194 papers).
- Antimicrobial Resistance Strategies (193 papers).
- MRSA Control and Prevalence (182 papers).
- Urinary Tract Infections (UTIs) in Women and Primary Care (176 papers).
- HIV Drug Resistance and Treatment Options (157 papers).
- Multidrug-resistant Bacteria Management in Intensive Care Units (153 papers).
- Antimicrobial Stewardship in Outpatient Settings (146 papers).
Other important themes include the impact of COVID-19 on antimicrobial stewardship, multidrug-resistant tuberculosis diagnosis, surgical site infection prevention, and nosocomial infection surveillance.
The themes uncovered in our bibliometric analysis provide critical insights into the research priorities within AMR and primary healthcare. Several topics, such as antibiotic stewardship in outpatient settings, urinary tract infection resistance, and community-acquired pneumonia treatment guidelines, are directly relevant to our project’s focus on primary care interventions.
Moreover, the prominence of antibiotic prescribing patterns, AMR surveillance strategies, and infection control measures underscores the need for integrated digital tools - like the system developed in our project - that support healthcare providers in making evidence-based prescribing decisions.
Linguistic Distribution of AMR Research
The linguistic diversity of the dataset is an important consideration, as it reflects both the accessibility of AMR research across different regions and the predominant scientific languages in this field.
Our analysis (Figure 2) indicates that the majority of the 3,405 papers were published in English (96%), but several other languages were represented, highlighting regional contributions:
- Spanish: 51 papers (1.5%).
- French: 13 papers (<1%).
- Norwegian, Japanese, German: 8 papers each (<1%).
- Portuguese: 6 papers (<1%).
- Danish, Swedish, Chinese: 4 papers each (<1%).
The dominance of English aligns with global trends in scientific publishing, where English serves as the lingua franca of medical research. However, the presence of Spanish, French, and other languages suggests significant contributions from non-English-speaking countries, which is particularly relevant for regional healthcare policies and local AMR mitigation strategies.

Temporal Evolution of AMR Research Output
To understand the growth of AMR research in primary healthcare, we analysed the number of papers published per year (Figure 3). The data shows a clear upward trend, reflecting the increasing importance of AMR in global health research.
Key observations include:
- Before 2010: AMR research in primary healthcare was relatively sparse, with fewer than 50 publications per year.
- 2010–2015: The field began gaining traction, with a gradual increase to over 150 publications annually.
- 2016–2020: A significant rise in research output, surpassing 200 publications per year by 2018.
- 2020–2023: A peak period, exceeding 300 publications annually, reflecting the intensified focus on AMR, possibly influenced by global health crises such as the COVID-19 pandemic.
- 2024–2025 (Partial Data): The first months of 2025 show 70 papers, indicating continued research activity.

Geographic Distribution of Research Output
A critical dimension of our bibliometric study was identifying the countries leading AMR research in primary healthcare. Figure 4 presents a country-wide breakdown based on the primary institution associated with each paper.
The top contributing countries were:
- United Kingdom (including Northern Ireland): 1,459 papers (43%).
- United States of America: 1,008 papers (29.6%).
- Switzerland: 250 papers (7.3%).
- Netherlands: 133 papers (3.9%).
- Germany: 87 papers (2.6%).
- Spain: 66 papers (2%).
- New Zealand and Canada: 38 papers each (1.1%).
- Rest of World (collectively): 326 papers (9.6%).
This distribution underscores the dominance of the UK and the USA in AMR research within primary healthcare, together accounting for nearly 72% of the total research output. Switzerland, the Netherlands, and Germany also demonstrate substantial engagement, likely due to their strong public health policies and well-established AMR surveillance programs.
Interestingly, while lower- and middle-income countries are disproportionately affected by AMR, their research output remains limited. This disparity suggests the need for increased international collaborations and capacity-building efforts in LMICs, particularly in Latin America, Africa, and parts of Asia, where AMR poses a growing but under-documented threat.
CDC-MEXICO cooperative agreement for ‘Surveillance, Epidemiology, and Laboratory Capacity/Antimicrobial Resistance
Full-stack Remix Application Overview
To ensure accessibility, sustainability, and security, the application was built as a full-stack TypeScript SaaS application based on the Remix and JavaScript/TypeScript framework, and React - both very popular frameworks within the web application community. The advantage of creating a website-based application was simply that it meant it would be available to all primary healthcare providers with no unduly restrictive requirements on their part; only a web browser would be necessary, but moreover the application could be deployed entirely offline within secure Mexican Ministry of Health IT infrastructure. In turn, this meant the technical architecture was designed to meet stringent requirements for data protection, real-time responsiveness, and maintainability by local engineering teams post-handover.
Software engineering industry standard design choices have been made to ensure a pleasant user experience. For example:
- Navigation bar that is permanently fixed at the top of the screen for ease of access and use.
- A login page requires an account email and password be provided.
- The sign-up page allows new users to register an account.
- “About Us” page details who the project team is and the project’s overarching goals.
- “Privacy Policy” page details the project’s privacy policy such as what kind of information we plan to collect and how it will be used.

Photos of members of the pilot team, from the three Mexican states involved in the pilot design phases are included to drive engagement. Additionally, the entire colour scheme of the application can be changed by the user, including themed colour palettes representing the individual Mexican states or healthcare institutions.
Capture of Basic Patient Details
We capture a basic set of details about the patient and their medical history. All data is held on a secure server within the Mexico Ministry of Health.
Required patient data
- Basic patient identification.
- Establish a basic medical history and associated risk factors:
- Does the patient have any existing medical conditions?
- Does the patient have any existing allergies?
- Has the patient been hospitalized at any time during the last 3 months?
- Does the patient live with any disabilities?
- Is the patient currently taking any medication?
- Identify external risk factors:
- Has the patient been outside the country in the last 3 months? If so, to which countries?

The information above is used then to help chose the correct treatment pathway
Primary condition
The primary health care provider then chooses from one of four primary conditions:
- Infections of the Urinary Tract.
- Sexually Transmitted Infections.
- Infections of the Upper Respiratory Apparatus.
- Acute Diarrhoea.

Associated Secondary Symptoms and Risk Factors
Next, the primary health care provider chooses which (if any) associated symptoms or risk factors are present. Available secondary symptoms vary depending on the choice of primary condition that was made. Certain secondary conditions require additional detail be provided. For example, selecting “Diarrhoea” reveals an additional input where the count of evacuations over the last 24 hours can be recorded.

Summary of patient condition and treatment recommendations
Following the recording of the patient’s basic data and risk factors, alongside capturing the primary condition and associated secondary symptoms, the application will then apply an appropriate medical algorithm to determine the most likely disease or condition and the most appropriate recommended treatment. These conclusions as well as a summary of the patient details are then presented to the health care provider.

Design of Medical Algorithms
We worked closely with doctors, nurses, and medical experts to design the medical algorithms that would be used by the application to determine the most likely disease, and the recommended treatment options.
By the time the user (primary healthcare provider) reaches this page in the app they will have already collected sufficient data about the patient (through the app) that the software/computer code can then follow simple, logic-based questions, and proceed through the algorithm to return the recommended treatment (if any).
Thus, we begin at the top of the algorithm and work our way downwards towards a final conclusion. Each branch is determined by a single, simple, unambiguous question that determines the next step to take. The design of the algorithm therefore decomposes the process of diagnosis into a series of questions that can be followed unambiguously.
Project management was especially important given that the software engineers were not medical professionals. Therefore, it was important they were not required to make any assumptions or interpretations as to the intent of a particular branch in the algorithm. The algorithm design needed to be sufficiently decomposed such that the only thing required from the software engineer was to implement the design in computer code.
The algorithms support antimicrobial stewardship by guiding clinicians toward evidence-based prescribing practices while reducing unnecessary antibiotic use. By structuring medical decision-making in an algorithmic format, this approach ensures that clinicians follow clear, logical steps in assessing and treating the different conditions. The algorithms enforce adherence to best practices, minimizes unwarranted variability in prescribing, and reduces empirical overuse of antibiotics.
Data Analysis Section - Geospatial Insights for AMR Surveillance


Harnessing Location Data for AMR Monitoring
A key strength of the RAM App is its integration of geographic and demographic data into AMR surveillance. By recording locations of primary healthcare settings, alongside patient treatment locations and sample collection points, the system enables a spatially aware approach to antimicrobial resistance tracking.
This geospatial component allows healthcare providers and policymakers to:
- Identify geographic hotspots of antimicrobial resistance.
- Correlate resistance patterns with population movements and demographics.
- Understand cross-border transmission risks, particularly for migrant populations.
- Improve resource allocation for laboratory testing and AMR intervention strategies.
Mapping AMR Prevalence and Patient Movements
The application collects and maps patient journeys, including:
- Where patients seek treatment, offering insight into healthcare accessibility and AMR burden per region.
- Origin points of patient samples, ensuring real-time tracking of antimicrobial resistance emergence.
- Cross-border migration data, capturing routes taken by migrant populations and potential exposure to resistant pathogens across different health systems.
Visualizing AMR Data with Interactive Mapping Tools
To maximize the usability of geographic data, the RAM App includes interactive maps and data dashboards. These tools provide:
- State and regional-level AMR prevalence visualizations based on sample analyses.
- Comparisons of AMR trends over time, allowing for early outbreak detection.
- Heatmaps of high-resistance areas, guiding public health responses.
By layering AMR data with demographic and cartographic insights, this approach enables targeted, data-driven interventions, strengthening Mexico’s national antimicrobial stewardship strategy.
Full-Stack Technical Detail
As mentioned earlier, the application was built using the Remix full-stack framework and React. It was written entirely in TypeScript. The frontend facilitates user interaction with structured workflows for patient data entry, condition assessment, and visual analytics. On the backend, Prisma ORM ensures type-safe, schema-driven data operations, while MongoDB Atlas (used during development) supports document storage, vector search, and data access via Prisma.
In production, the entire application stack was deployed on Ubuntu 22.04 servers inside the Mexican Ministry of Health’s secure IT infrastructure, with Docker used to containerize the application and Kubernetes for orchestration. The system is served using Nginx, which acts both as a web server and as a reverse proxy for large language model (LLM) inference, served via Ollama.
This design enabled the system to run in a fully air-gapped environment - running entirely on Ministry-controlled servers. Access to the app is only possible via devices on the Ministry’s internal network (e.g., clinics connected via VPN or intranet) ensuring compliance with Mexico’s national data protection regulations while maintaining sub-second response times in clinics with inconsistent connectivity.
Retrieval-Augmented Generation (RAG) Pipeline
A novel feature of the RAM App is its integration of a Retrieval-Augmented Generation (RAG) pipeline that allows clinicians and Ministry officials to interact with structured AMR surveillance data using natural language queries. This interface is particularly helpful for non-technical users who may lack familiarity with databases or traditional business intelligence tools.

The pipeline allows users to ask questions such as “How many cases of STI were recorded in Chiapas last quarter?” or “Show me a bar chart of resistant UTI cases by age group”. The system then returns a text summary, count data, or auto-generated charts using internal surveillance data.
RAG Pipeline Flow
Intent Parsing
The user’s input is first evaluated by a lightweight LLM (Mistral-7B) to determine whether the question is valid, safe, and within supported query domains (e.g. chart generation or descriptive statistics).
Validation Layer
A secondary LLM validates the structure and safety of the parsed intent. Unsupported requests - such as clinical advice or patient-specific inferences - are rejected with clear messaging, preserving user trust and preventing misuse.
Semantic Retrieval
Valid queries are converted into vector embeddings using the all-MiniLM-L6-v2 model. These embeddings are matched against a MongoDB Atlas Vector Store, which indexes internal surveillance documents and metadata.
Contextual Prompt Assembly
The retrieved documents are formatted into a templated prompt using LangChain, ensuring that the final LLM generation is grounded in high-relevance, contextual evidence.
LLM Generation and Output Rendering
A final call to Mistral-7B produces either:
- A descriptive response (“There were 54 confirmed cases of ciprofloxacin-resistant UTIs in Q1”), or
- A chart specification (in Chart.js format), rendered on the frontend.
The entire pipeline is modular and auditable, allowing Ministry engineers to inspect, extend, or retrain components independently.
Grounding, Explainability, and Guardrails
Given the clinical context, it was essential to ensure the system did not hallucinate or provide speculative outputs. To address this, several layers of explainability and safety constraints were built into the pipeline.
All LLM outputs are grounded exclusively in retrieved documents via the vector search layer. If no suitable documents are found, the system returns a fallback message: “No relevant data found.”
A strict system prompt prevents generation beyond provided context, and explicitly prohibits advice, diagnosis, or unsupported summarization.
An intent classifier precedes all LLM calls to ensure that only chartable, data-based queries are processed.
On the frontend, users can view the source metadata behind each response, including the document, clinic, or dataset used to generate the result.
An embedded “Why am I seeing this?” panel provides transparency into the query interpretation, retrieval logic, and visualization output.
This layered approach ensured compliance with ethical AI principles and established the RAM App as a trustworthy assistant, not a black-box decision-maker.
Deployment Model and Handover Strategy
The RAM App was designed not just for immediate deployment, but also for long-term sustainability and local ownership by the Ministry of Health. All components, frontend, backend, database, LLM server, were packaged into Docker containers and orchestrated using Kubernetes, ensuring reproducibility, scaling, and secure internal communication.
The system is fully operable within an air-gapped server environment, with no dependency on external APIs or cloud services. This made it suitable for clinics with limited internet connectivity, and compliant with the Federal Law on the Protection of Personal Data Held by Private Parties (LFPDPPP).
To support post-handover success:
- All RAG pipeline components were documented with inline comments, deployment instructions, and walkthrough guides.
- The LangChain orchestration was kept modular and interpretable, using well-supported abstractions to aid maintainability.
- The Ministry’s in-house engineers were trained on how to update the database schema, adapt prompt templates, and retrain vector embeddings if new clinical content is added.
In this way, the system was not only designed for clinical impact but also for technical resilience and Ministry-level autonomy, supporting future adaptation and scale-up without reliance on external vendors.
Training Section - Ensuring proper sample collection and handling
A fundamental aspect of effective antimicrobial resistance surveillance is ensuring accurate and high-quality diagnostics. As we previously discussed, both education and improved diagnostics play a pivotal role within antimicrobial stewardship programmes toward curbing the inappropriate use of antibiotics.
The CDC-MEXICO cooperative agreement not only introduced a centralized laboratory infrastructure for AMR surveillance but also incorporated a robust training program to ensure that primary healthcare providers properly collected and handled biological samples. This was necessary to guarantee that accurate laboratory measurements of AMR could be made, thereby supporting evidence-based prescribing decisions.
Without proper sample collection and handling, diagnostic tests may yield false negatives or contaminated results, leading to misdiagnosis and unnecessary antibiotic prescriptions - precisely the kind of scenario that antimicrobial stewardship programs seek to prevent.

To ensure standardization and accessibility, the project developed a dedicated training section within the web-based RAM App. This section contained step-by-step instructional videos guiding healthcare providers on how to:
- Correctly collect patient samples (e.g., urine, blood, stool, throat swabs).
- Ensure sterility and avoid sample contamination.
- Safely package and transport samples to the central laboratory in compliance with biosafety regulations.
- Accurately document patient details and associated clinical information within the RAM App to link lab results with patient records.
These training modules were made available on-demand, ensuring that all participating healthcare professionals - regardless of location or time constraints - could receive standardized training.
Discussion
The thematic insights uncovered through our bibliometric analysis reinforce and expand upon the central concerns highlighted in the introduction of this paper. The prevalence of topics such as antibiotic prescribing patterns, respiratory tract infections, urinary tract infections, and antimicrobial stewardship knowledge gaps directly mirrors the syndromes and challenges identified as core drivers of resistance in the primary healthcare setting - particularly in low- and middle-income countries like Mexico.
These themes highlight the clinical uncertainty and lack of diagnostics in frontline care, which frequently result in empirical prescribing practices and unnecessary antibiotic use. In parallel, our bibliometric findings confirm that respiratory infections and urinary tract infections - conditions often self-limiting or of viral origin - remain focal points of research and concern due to their outsized role in driving inappropriate antibiotic use.
Moreover, the bibliometric emphasis on outpatient stewardship and centralized infection control strategies strongly aligns with the WHO’s call to strengthen AMR surveillance systems, laboratory capacity, and healthcare provider education. This bibliometric study not only reinforces the significance of our work but also positions it within a well-established scientific framework, demonstrating its alignment with contemporary global efforts in antimicrobial resistance monitoring and intervention at the primary care level.
The sustained growth highlights the escalating urgency of AMR as a public health challenge and the increased research efforts devoted to antibiotic stewardship, prescribing behaviours, and resistance patterns in primary care settings.
The geographic disparity might hint at the well-known ‘North-South divide’ in scientific research, where wealthier nations in the Northern Hemisphere often have more resources to conduct and publish research than those in the Southern Hemisphere.
As we move forward with our analysis, it is important to keep this potential bias in mind. Could it be that key research from certain regions is underrepresented in global databases like PubMed? Or, more critically, are there advancements in AMR stewardship and mitigation practices occurring in these underrepresented areas that are not being captured? Or perhaps these Southern hemisphere regions missing out on using the latest AMR stewardship best practices in their communities? Surely this underscores the importance of continued global collaboration and standardising of the global community’s efforts to tackle AMR?
The relative scarcity of research output from low- and middle-income countries revealed in the geographic analysis further validates the urgent need for regionally adapted solutions like our RAM App initiative. Our project’s objective - to deliver a digital platform that enables standardized treatment, centralized laboratory diagnostics, and real-time epidemiological tracking - responds directly to the gaps in surveillance, diagnostic infrastructure, and prescriber support that dominate both the literature and WHO’s recommendations.
- Thematic alignment: The most prevalent research topics (antibiotic prescribing, stewardship, infection control) mirror the core objectives of our CDC-MEXICO cooperative agreement.
- Growing global focus: The increasing publication volume, especially post-2015, underscores the timeliness of our initiative in developing an AMR information system.
- Regional research gaps: The underrepresentation of low- and middle-income countries in the dataset highlights the importance of localized AMR data collection and decision-support tools, as exactly displayed by our project.
In this way, the bibliometric data not only situates our project within a well-defined research landscape but also emphasizes its relevance, timeliness, and alignment with global priorities. By addressing the very issues most frequently examined in AMR research - and most acutely felt in underrepresented healthcare systems - our work contributes substantively to the effort to curb antimicrobial resistance at the point of care.
Conclusions
The CDC-MEXICO cooperative agreement for ‘Surveillance, Epidemiology, and Laboratory Capacity/Antimicrobial Resistance’ represents a significant step forward in strengthening AMR surveillance and control at the primary healthcare level in Mexico.
This two-year project successfully achieved its objectives:
- The development of a full-stack web-based platform (RAM App) that integrates clinical decision support, standardized treatment recommendations, and real-time AMR surveillance.
- The establishment of a centralized laboratory infrastructure to receive, process, and analyse patient samples, ensuring accurate identification of resistant bacterial strains.
By achieving these goals, the project lays the groundwork for a more structured, data-driven approach to antimicrobial resistance management in primary care settings -an area historically underrepresented in AMR control strategies.
The RAM App and laboratory setup do not merely represent technological achievements; they address key systemic gaps in antimicrobial stewardship that were highlighted throughout this paper. As discussed, primary care physicians are among the most frequent prescribers of antibiotics, often in the absence of diagnostic support or standardized guidelines. This project directly responds to these challenges by:
- Providing clinicians with evidence-based treatment recommendations.
- Enabling laboratory-confirmed diagnoses of antimicrobial resistance.
- Creating a data pipeline to inform public health policy.
While quantifiable impact metrics on prescribing behaviours and AMR prevalence are beyond the scope of this work, future research will be needed to assess long-term adoption and real-world outcomes of the system.
Implications for Future AMR Control Efforts
This initiative demonstrates that scalable, technology-driven solutions can be implemented in low- and middle-income countries (LMICs) to strengthen AMR surveillance without requiring extensive financial or infrastructural overhauls. Moving forward, several directions remain open for continued development:
- Integration with existing electronic health records (EHRs) to ensure seamless adoption by primary care providers.
- Expansion to additional infectious diseases beyond the initial four conditions covered in the RAM App.
- Ongoing training and capacity-building efforts to support long-term system sustainability.
- Data-driven policymaking, using aggregated resistance patterns to inform national and regional antibiotic prescribing guidelines.
In conclusion, this project provides a blueprint for integrating technology, laboratory diagnostics, and antimicrobial stewardship in primary healthcare. The successful development and deployment of both the RAM App and centralized laboratory infrastructure affirm that digital and laboratory-based interventions can play a vital role in mitigating antimicrobial resistance at the community level.
As implementation progresses and real-world data becomes available, future studies will be needed to measure impact, optimize workflows, and refine treatment recommendations. However, this project has already taken a critical step forward - establishing the foundation for a more systematic, data-driven approach to AMR control in primary healthcare settings.
Bibliography
- Antimicrobial Resistance - Collaborative Measures of Control, Sunil D. Saroj, CRC Press, 2023, DOI: 10.1201/9781003313175.
- Antimicrobial Resistance Underlying Mechanisms and Therapeutic Approaches, Kumar, Shriram, Paul, and Thakur (editors), Springer, 2022, DOI: 10.1007/978-981-16-3120-7.
- Challenges to Tackling Antimicrobial Resistance Economic and Policy Responses, Anderson, Cecchini, and Mossialos, Cambridge University Press, 2019, DOI: 10.1017/9781108864121.
- Emerging Modalities in Mitigation of Antimicrobial Resistance, Akhtar, Siddharth Singh, Prerna, Springer, 2022, DOI: 10.1007/978-3-030-84126-3.
- Multidrug Resistance an Emerging Crisis, Tanwar, et al., Interdisciplinary Perspectives on Infectious Diseases, 2014, DOI: 10.1155/2014/541340
- A Closer Look at Antibiotic Resistance, Tsunoda, Nova Science Publishing, 2021,
- Combating Antimicrobial Resistance - A One Health Approach to a Global Threat, Proceedings of a Workshop, Mundaca-Shah, Ayano Ogawa, and Nicholson, The National Academies Press, 2017, DOI: 10.17226/24914.
- Antibiotic Resistant Bacteria: A Challenge to Modern Medicine, Sagar, Kaistha, Jyoti Das, and Kumar, Springer, 2019, DOI: 10.1007/978-981-13-9879-7.
- Antimicrobial Resistance in Developing Countries, Sosa, Byarugaba, Amábile-Cuevas, Hsueh, Kariuki, and Okeke (editors), Springer, 2010, DOI: 10.1007/978-0-387-89370-9.
- Political Declaration of the High-level Meeting on Antimicrobial Resistance, https://www.un.org/pga/wp-content/uploads/sites/108/2024/09/FINAL-Text-AMR-to-PGA.pdf.
- Antimicrobial Resistance - Beyond the Breakpoint, Issues in Infectious Diseases, Vol. 6, Weber, Karger, 2010.
- Antimicrobial Resistance: Tackling a crisis for the health and wealth of nations, Jim O’Neill (chair), HM Government, Wellcome Trust, 2014.
- Antimicrobial Stewardship, Laundy, Gilchrist, and Whitney, Oxford University Press, 2016.
- Antibiotic Resistance - Understanding and Responding to an Emerging Crisis, Drlica and Perlin, Pearson Education, 2011.
- Political Declaration of the High-level Meeting on Antimicrobial Resistance.
- The WHO AWaRe (Access, Watch, Reserve) antibiotic book - Web Annex. Infographics (World Health Organization).
- BERTopic: Neural topic modeling with a class-based TF-IDF procedure, Grootendorst, arXiv:2203.05794, 2022.
- McInnes, L, Healy, J, UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction, ArXiv e-prints 1802.03426, 2018.
- McInnes, L., Healy, J., & Astels, S. (2017). hdbscan: Hierarchical Density Based Clustering. Journal of Open Source Software, 2(11), 205. DOI: 10.21105/joss.00205.
- Antibiotics and Antibiotic Resistance, Sköld, Wiley, 2011, ISBN: 978-1-118-07558-6.
- One Health and the politics of antimicrobial resistance (Laura H Kahn).
- Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks, Reimers, Nils and Gurevych, Iryna, Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing, 11/2019, Association for Computational Linguistics, https://arxiv.org/abs/1908.10084.
- Scikit-learn: Machine Learning in Python, Journal of Machine Learning Research, vol. 12, 2011.
Appendix
Urinary Tract Infections (UTI’s)

Decision Flow Summary (UTI)
- The algorithm begins by assessing risk factors for antimicrobial resistance, such as recent antibiotic use, hospitalization, or recurrent infections.
- If risk factors are present, urine culture testing is recommended before initiating empirical treatment.
- The clinician identifies key urinary symptoms (dysuria, frequency, urgency, suprapubic pain).
- If symptoms suggest acute cystitis, empirical antibiotic treatment is suggested based on local resistance patterns.
- If there are systemic symptoms (fever, flank pain), the algorithm suggests pyelonephritis evaluation and may recommend additional diagnostic tests (e.g., ultrasound).
- If the patient is male, has known urological abnormalities, or has symptoms for over three months, the algorithm considers the possibility of prostatitis, adjusting treatment duration and antibiotic selection accordingly.
- For asymptomatic bacteriuria, no treatment is recommended unless the patient is pregnant or undergoing urological procedures.
Key Risk Factors Influencing Decision-Making (UTI)
- Recent antibiotic use (last 3 months).
- Hospitalization in the last 3 months.
- Recurrent UTIs.
- Diabetes or immunosuppression.
- Presence of an indwelling catheter
Treatment Recommendations (UTI)
- Acute uncomplicated cystitis: Nitrofurantoin or Fosfomycin as first-line treatment.
- Complicated UTIs/Pyelonephritis: Fluoroquinolones or cephalosporins, depending on severity.
- Prostatitis: Prolonged fluoroquinolone or trimethoprim-sulfamethoxazole course.
- Asymptomatic bacteriuria: No treatment unless in special cases.
Sexually Transmitted Infections (STI’s)

Decision Flow Summary (STI)
- The algorithm begins with identifying STI risk factors (multiple partners, prior STI history, unprotected intercourse).
- Symptoms such as urethral or vaginal discharge, genital ulcers, and dysuria guide clinicians toward differential diagnoses.
- Testing is recommended where available (NAAT for chlamydia/gonorrhoea, serology for syphilis).
- If testing is not immediately available, the algorithm provides empirical treatment recommendations based on the most probable pathogen.
- The importance of partner treatment and notification is emphasized.
- High-risk cases (e.g., persistent symptoms, recurrent infections) are flagged for specialist referral or additional diagnostics.
Key Risk Factors Influencing Decision-Making (STI)
- Multiple sexual partners.
- Unprotected sexual activity.
- Previous STI history.
- Presence of genital ulcers, discharge, or dysuria.
Treatment Recommendations (STI)
- Gonorrhoea: Ceftriaxone 500mg IM + Azithromycin 1g PO (dual therapy reduces resistance risk).
- Chlamydia: Doxycycline 100mg PO BID for 7 days (preferred over azithromycin for resistance concerns).
- Syphilis: Benzathine Penicillin G IM (dose dependent on disease stage).
Upper and Lower Respiratory Tract Infections

Decision Flow Summary (Respiratory)
- Symptoms such as fever, cough, sore throat, and sinus pain are assessed.
- The Centor criteria are used to determine whether bacterial pharyngitis is likely.
- Sinusitis is categorized as viral or bacterial based on symptom duration and severity.
- For bronchitis, the algorithm emphasizes that antibiotics are generally unnecessary unless pneumonia is suspected.
Key Risk Factors Influencing Decision-Making (Respiratory)
- Severe, persistent symptoms (>10 days).
- High fever (>39°C) with purulent discharge.
- Immunosuppression or underlying lung disease.
Treatment Recommendations (Respiratory)
- Pharyngitis: Penicillin or amoxicillin for confirmed bacterial cases (based on Centor score).
- Sinusitis: Antibiotics only for prolonged or severe cases.
- Acute bronchitis: No antibiotics recommended unless pneumonia is suspected.
Acute Diarrheal Diseases

The diarrhoea algorithm helps differentiate between viral, bacterial, and parasitic causes of diarrhoea, ensuring antibiotics are only used when necessary.
Decision Flow Summary (Diarrhoea)
- Assessment begins by identifying red flags (bloody stool, high fever, severe dehydration).
- If the case is mild and self-limiting, supportive care (hydration) is recommended.
- If bacterial dysentery is suspected (e.g., Shigella, Salmonella), targeted antibiotic therapy is initiated.
- High-risk patients (elderly, immunocompromised) may require stool culture testing before treatment.
Key Risk Factors Influencing Decision-Making (Diarrhoea)
- Bloody diarrhoea, high fever (>38.5°C).
- Recent antibiotic use (risk for C. difficile).
- Traveller’s diarrhoea history.
Treatment Recommendations (Diarrhoea)
- Supportive care for viral cases (oral rehydration therapy).
- Ciprofloxacin/Azithromycin for suspected bacterial infections (depending on resistance patterns).