Inspiration
I built this for myself.
I'm someone who feels things in layers — sometimes I don't know what I'm actually feeling until I've written it down. Journaling has always been my way of finding out. But there's a particular kind of loneliness in closing a notebook and having nothing come back. The page receives everything. It returns nothing.
I wanted something that could see what I wrote — really see it — and be there. Not a therapist. Not an algorithm. Something small and safe and mine. A companion that lives only in my diary, speaks only to me, and never tells anyone what I said.
That's where Mr. Rabbit came from.
The name is from Alice in Wonderland — the White Rabbit, always rushing, always disappearing. I liked the idea of him finally stopping. Of him having nowhere else to be but here, reading what you wrote, writing back.
What it does
Mr. Rabbit's Diary is a private journaling app with an NLP backbone and an AI companion. You write; it understands; it responds.
- Mood classification — every entry is analyzed by a custom-trained NLP model across 7 mental health categories: Normal, Depression, Anxiety, Stress, Bipolar, Personality Disorder, and Suicidal ideation
- Mr. Rabbit replies — after each entry, the AI companion writes back in a warm, poetic voice — never clinical, never dismissive, always present
- Follow-up conversation — a quiet "follow up" button opens an inline chat, letting the conversation continue until the user is ready to close the page
- Mood calendar — the History page shows a calendar where each day is colored by its dominant emotion; clicking a day reveals entries as sealed envelopes with wax seals colored by mood
- Safety guardrails — suicidal content triggers an automatic 988 Crisis Lifeline prompt; paranoid or persecutory thinking is gently redirected without validation
- Per-user isolation — full authentication with JWT and bcrypt; every diary belongs only to its writer
How we built it
The stack is fully containerized and deploys to Google Cloud Run.
| Layer | Technology |
|---|---|
| Frontend | React, Tailwind CSS, custom MindClassify Design System |
| Backend | Node.js / Express, JWT auth, MongoDB (Atlas) |
| NLP model service | Python / Flask, TF-IDF + Logistic Regression, Transformer-ready |
| AI companion | Claude API (Anthropic) with carefully crafted system prompts |
| Infrastructure | Docker Compose (dev), Google Cloud Run (production) |
The NLP model is trained on a labeled mental health text dataset across 7 classes, with macro F1 of 0.89 on the test set. The model service and Claude companion are fully decoupled — classification runs even without an API key. The design system uses a warm cream-and-ink palette with three typefaces — Plus Jakarta Sans, Lora, and Caveat — to evoke handwritten paper rather than a clinical interface.
Challenges we ran into
Building and comparing three NLP models from scratch.
The hardest engineering work on this project wasn't the app — it was the model. We trained and evaluated three distinct approaches to mental health text classification, each representing a real architectural tradeoff.
The dataset came from Kaggle: 50K Reddit and Twitter posts, weakly labelled by subreddit membership, across 7 classes — Normal, Depression, Suicidal, Anxiety, Stress, Bipolar, and Personality Disorder. Preprocessing kept negations intact (not happy ≠ happy) while stripping URLs and @mentions.
Model 01 — Baseline: TF-IDF + Logistic Regression A lightweight, CPU-only baseline with bigram features and class-balanced weights. Fast to train, interpretable, and sets the performance floor.
Model 02 — Main Model: BERT fine-tuning 512-token input to capture full post context. AdamW optimizer at lr = 2e-5, 3 epochs with weighted cross-entropy loss. Pre-trained on Wikipedia + Books (general domain).
Model 03 — Domain Model: MentalBERT fine-tuning Identical training setup to Model 02, but initialized from MentalBERT — a model pre-trained specifically on Reddit mental health communities and clinical text (Ji et al. 2022). This directly tests whether domain-specific pre-training improves classification on short, emotionally ambiguous diary-style entries.
The baseline achieved macro F1 of 0.89 — strong enough to ship. The BERT and MentalBERT comparison validated whether domain pre-training meaningfully helps on this type of text.
Balancing AI safety with emotional authenticity.
The hardest prompt engineering problem was teaching Mr. Rabbit to distinguish between artistic imagination — which should be embraced — and paranoid ideation — which must never be validated. The line between "I feel like the moon is crying for me" (poetic) and "my neighbors are conspiring against me" (potentially delusional) required careful, explicit framing in the system prompt. Suicidal content triggers an automatic 988 Crisis Lifeline prompt; Mr. Rabbit never dismisses, but never reinforces either.
Accomplishments that we're proud of
- A UI that genuinely feels like writing in a diary — no cards, no modals, just ink on paper
- A system prompt architecture that handles vulnerable users with real care, distinguishing creative expression from paranoid thinking
- The sealed-envelope history design: each day's entry becomes a letter you can re-open, with a wax seal whose color matches the mood that day
- A clean three-service architecture that decouples NLP, AI, and storage — each can be updated independently
- Macro F1 of 0.89 on a 7-class mental health classification task, with a full three-model comparison (TF-IDF baseline → BERT → MentalBERT)
What we learned
- Mental health technology demands a different design vocabulary — warmth, slowness, and softness are features, not aesthetics
- Prompt engineering for vulnerable populations is not a footnote; it deserves the same rigor as the model itself
- A well-named AI persona (Mr. Rabbit) does more for user trust and emotional safety than any amount of UI polish
- Decoupling services early saves enormous pain at deployment time
- Domain-specific pre-training (MentalBERT) is a meaningful hypothesis worth testing — the results show where general BERT falls short on clinical language
What's next for Mr. Rabbit's Diary
- Transformer model upgrade — replace the TF-IDF baseline with a fine-tuned BERT model for higher accuracy on ambiguous, short-form entries
- Longitudinal insights — weekly and monthly mood summaries generated by Mr. Rabbit, written as a letter rather than a chart
- Mobile app — the diary experience is inherently personal and private; it belongs in your pocket
- Clinician mode — an optional, consent-gated view that lets a therapist see mood trends without reading private entries
- Multilingual support — mental health has no language boundary; the model and companion should reflect that
Built With
- api
- atlas
- bcrypt
- bert
- claude
- docker
- express.js
- flask
- google-cloud
- jwt
- mentalbert
- mongodb
- node.js
- python
- react
- scikit-learn
- tailwind
- tf-idf
- transformers
Log in or sign up for Devpost to join the conversation.