2024–2025Graduate Research Assistant · UTSA Mobile Lab

QUITTXT — AI FOR SMOKING CESSATION

PythonFastAPIGemini APIRAGChromaDBStreamlitGCP
View live

The problem with health AI

Most cessation apps give you generic advice — "drink water when you have a craving" — pulled from guidelines any smoker has already heard. QuitTxt is built on an actual clinical corpus: peer-reviewed studies, intervention protocols, evidence-based behavioral strategies. The challenge was building an AI system that could answer questions using that evidence without making things up. In healthcare, a hallucinated answer isn't just embarrassing. Someone might act on it.

The system

RAG pipeline on top of Google's Gemini. FastAPI backend, Streamlit interface for the research team. User asks a question. System retrieves relevant passages from the clinical corpus. Passes them to the LLM as grounding context. Returns an answer with source references. If retrieval confidence falls below threshold, the system says "I don't have enough information" instead of guessing. That refusal behavior was the most important design decision in the entire project.

Why clinical RAG is different

Clinical documents are dense and structured. You can't chunk them the way you'd chunk a blog post — section breaks carry meaning, and sentence-level chunking destroys context. I tried three approaches before landing on paragraph-level chunks with section-header preservation and a sliding window overlap for continuity. The difference in retrieval quality was measurable, not marginal.

The 0.72 threshold

Every retrieved chunk gets a cosine similarity score against the query. Below 0.72, the system declines to answer. That number came from tuning on a held-out query set where I already knew the correct answers. The goal: find where retrieval quality drops enough that the LLM starts filling gaps with plausible-sounding nonsense. 0.72 was that point for this corpus. It sounds arbitrary. It isn't.

Where it is now

Running on GCP. Used by the research team at UTSA's Mobile Lab as part of ongoing clinical research into AI-assisted smoking cessation. Paper in progress targeting IEEE Access.