Current large language model (LLM) based mental‑health chatbots often lack empathy, contextual awareness and safety safeguards, which can lead to ineffective or harmful interactions. This paper introduces a framework that first performs sentiment and depression analysis, applies a rule‑based filter to high‑risk inputs, and then constructs prompts dynamically from the emotional and risk signals. The resulting prompts guide the model to produce responses that are more context‑relevant, empathetic and risk‑aware.
Four model strategies were evaluated with two prompt‑engineered variants. Qualitative metrics such as empathy, helpfulness, clarity, relevance and safety were measured, together with toxicity scores from the Perspective API. Results show that the prompt‑engineering approaches outperform DSFT by 1.8% and RLAIF by 1.1%.
Review: The study demonstrates a practical way to enhance safety and human‑centeredness in LLM‑driven chatbots, offering valuable insights for future applications in sensitive domains.