## Inspiration

1 in 3 college students experience significant anxiety or depression, yet most never reach out to campus resources. At UMD, CAPS has limited availability and long wait times. We asked: what if students had a safe, always-available
first touchpoint that they could trust?

The key word is trust. Existing AI chatbots hallucinate hotline numbers, overstep clinical boundaries, and sometimes minimize feelings. We built TerpWell to solve this with a novel two-layer architecture: an empathetic companion
backed by a real-time AI governance auditor that catches every mistake before it reaches the student.

When the Anthropic x Maryland Hackathon presented Mental Health and AI Governance as two separate problem statements, we realized we could tackle both in one product.

## What it does

TerpWell is a mobile-first wellness companion built specifically for UMD students.

Empathetic Chat with streaming responses that sound human, not clinical. It knows UMD: Lake Artemesia for walks, Board & Brew for socializing, CAPS in Shoemaker for counseling.

AI Governance Layer silently audits every response against 7 checks before the student sees it. The governance score $G$ for each response is computed as:

$$G = \frac{1}{n}\sum_{i=1}^{n} c_i \times 100, \quad c_i \in {0, 1}$$

where $n = 7$ checks (crisis detection, no diagnosis, no prescribing, no minimizing, resource accuracy, no hallucination, empathetic tone) and $c_i = 1$ if check $i$ passes. Failed responses are automatically corrected before delivery.

Dual-Layer Crisis Detection using both regex pattern matching and Claude-powered semantic classification. The regex layer provides instant $O(n)$ keyword matching, while the AI layer catches indirect language like "I don't see the
point anymore" that keyword matching misses. The combined detection probability:

$$P(\text{detected}) = 1 - (1 - P_{\text{regex}})(1 - P_{\text{AI}})$$

ensures near-zero false negatives on crisis messages.

Mood Tracker with SQLite persistence and Plotly visualizations. We compute a rolling mood trend $T$ over a 7-day window:

$$T = \frac{\bar{M}{t-3:t} - \bar{M}{t-7:t-4}}{\sigma_M}$$

where $\bar{M}$ is the mean mood score and $\sigma_M$ is the standard deviation. $T > 0.5$ indicates improvement, $T < -0.5$ indicates decline. This trend is fed directly into Claude's system prompt so responses are contextually aware
of the student's trajectory.

Human Escalation Pathway that generates a structured handoff message for CAPS counselors, including conversation summary, mood trends, and identified concerns.

Session Export so students can download their conversation as markdown to share with a therapist.

## How we built it

### Architecture

Student Message
|
[Crisis Detection] --> regex + Claude classifier
|
[Companion AI] --> Empathetic streaming response
|
[Governance AI] --> 7-check JSON audit
|
Approved? --> Show with "Verified" badge
Failed? --> Auto-correct --> Show with "Reviewed" badge

The two-call architecture means each message requires two sequential Claude API calls. The total latency $L$ is:
[No Name] [+] 56,132 Top

Built With

Share this project:

Updates