Maintenance Notice

Due to necessary scheduled maintenance, the JMIR Publications website will be unavailable from Wednesday, July 01, 2020 at 8:00 PM to 10:00 PM EST. We apologize in advance for any inconvenience this may cause you.

Who will be affected?

Accepted for/Published in: JMIR Research Protocols

Date Submitted: Jul 1, 2025
Date Accepted: Jun 3, 2026

The final, peer-reviewed published version of this preprint can be found here:

A Conversational Agent for Providing Personalized Preexposure Prophylaxis (PrEP) Support: Protocol for Chatbot Implementation and Evaluation

Sayed F, Park A, Sullivan PS, Ge Y

A Conversational Agent for Providing Personalized Preexposure Prophylaxis (PrEP) Support: Protocol for Chatbot Implementation and Evaluation

JMIR Res Protoc 2026;15:e79966

DOI: 10.2196/79966

A conversational agent for providing personalized PrEP support: Protocol for chatbot implementation and evaluation

  • Fatima Sayed; 
  • Albert Park; 
  • Patrick Sean Sullivan; 
  • Yaorong Ge

ABSTRACT

Background:

Chatbots have the potential to reduce barriers to pre-exposure prophylaxis (PrEP), including lack of awareness, misconceptions, and stigma, by providing anonymous and continuous support. However, in the context of PrEP, chatbots are still nascent; they lack personalized informational expertise, peer experiential expertise, and human-like emotional support to promote PrEP uptake and retention. Tailoring information, providing relatable peer experiences, and offering effective emotional support are all crucial for increasing engagement, influencing health decisions, and fostering resilience and well-being.

Objective:

In this paper, we describe the iterative development of a Retrieval Augmented Generation (RAG) chatbot for providing personalized information, peer experiential expertise, and human-like emotional support to PrEP candidates.

Methods:

We employed an iterative design process consisting of two phases – prototype conceptualization and iterative chatbot development. In the conceptualization phase, we identified real-world PrEP needs and designed a functional dialog flow diagram for PrEP support. Chatbot development included developing 2 components – a query preprocessor and a RAG module. The preprocessor uses the Segment Any Text (SAT) tool for query segmentation and a Gemma 2 fine-tuned support classifier to identify informational, emotional, and contextual data from real-world queries. To implement the RAG module, we used information retrieval techniques, employing Sentence-BERT (SBERT) embeddings with cosine similarity for semantic similarity and performing topic matching to identify topically relevant documents based on query topic to support document retrieval. Extensive prompt engineering is used to guide the large language model (LLM), Gemini-2.0-Flash, in generating tailored responses. We conducted 10 rounds of internal evaluations to assess the chatbot responses based on 10 criteria: clarity, accuracy, actionability, relevancy, information detail, tailored information, comprehensiveness, language suitability, tone, and empathy. The iterative feedback was used to refine the LLM prompts to enhance the quality of chatbot responses.

Results:

We developed a RAG chatbot and iteratively refined it based on the internal evaluation feedback. Prompt engineering is essential in guiding the LLM to generate responses tailored to information, experiential, and emotional user needs. We found that prompt effectiveness varied with task complexity; this was likely due to LLM sensitivity to the structure of prompts and to linguistic variability. For tasks requiring diverse perspectives, fine-tuning LLMs on annotated datasets provided better results compared to few-shot prompting techniques. Prompt decomposition and segmenting prompt instructions helped improve comprehensiveness and relevancy for complex and long queries. For tasks with high decision variance, condensed prompts that summarize the main concept or idea were more effective in reducing ambiguity in LLM decisions compared to decomposed prompts.

Conclusions:

Our RAG chatbot leverages social media data to provide personalized information, peer experiences, and human-like emotional support; these elements are essential in effectively reducing PrEP misconceptions and promoting self-efficacy. Further analysis incorporating expert and user feedback will be conducted to help validate and improve the chatbot’s potential.


 Citation

Please cite as:

Sayed F, Park A, Sullivan PS, Ge Y

A Conversational Agent for Providing Personalized Preexposure Prophylaxis (PrEP) Support: Protocol for Chatbot Implementation and Evaluation

JMIR Res Protoc 2026;15:e79966

DOI: 10.2196/79966

Download PDF


Request queued. Please wait while the file is being generated. It may take some time.

© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.