Inspiration
Last year, my niece was going through a really hard time. Her parents got divorced, and she had high-stakes exams coming up that would decide where she went to school. She opened up to me — I’m the person she normally talks to.
But we live in different time zones. I could feel how much pressure she was under from our messages, yet I couldn’t physically be there for her. Especially late at night when she needed support, I would be asleep.
Her situation is far from unique. Today’s teens grow up online. They carry heavy emotional burdens, and most keep those feelings to themselves. When they finally want to talk, they don’t want to call a crisis hotline — they want someone close to them. Timing also makes a huge difference: catching struggles early often keeps them from getting worse.
That led me to a core question: How can we give teens someone who feels close and is available at 2 a.m., while bringing in real professional help when it’s needed?
Building a basic listening chatbot is easy — off-the-box language models already handle that. The hard part is everything surrounding it: knowing when simple listening isn’t enough, avoiding generic crisis hotline workflows, giving every teen consistent support, and letting counselors clearly see why the AI responded the way it did.
Jera was built to solve those harder problems.
What it does
Jera is an AI companion for teenagers, backed by real human counselors. It has three main user surfaces:
For teenagers — Text‑based or voice‑enabled AI companion. It offers mood check‑ins, a journal feature, and guided breathing, meditation, and yoga prompts that trigger naturally within conversations, not just from static menus.
Its standout feature is character cards. Teens can build an AI companion modeled after a real person in their life — an aunt, grandma, or a friend who moved away. Users upload past chat history with that person, select which speaker represents them, and Jera learns their personality, speaking tone, and shared memories. With explicit consent from that real‑life person, the AI can speak using their cloned voice.
The core idea: comfort is not one‑size‑fits‑all. Many teens won’t open up to a generic “AI”, but they will talk to something that sounds like a trusted person who never judged them.
For counselors — Receive referred cases with score trends, mood history, and early‑warning crisis signals. They create intervention plans that turn into system prompts for the AI to follow between sessions. A dedicated panel shows the full reasoning behind every reply sent to their teen client.
For platform staff — Full platform oversight, role‑based user‑and‑staff access controls, review of all conversation snippets before they shape future AI responses, audit logs for every verified user action, and live editing access for the crisis‑resource list.
Two core systems power everything underneath:
In-conversation PHQ‑A and GAD‑7 screeners. After two weeks of mood check‑ins and safety events suggest screening is appropriate, the AI asks for permission and walks through each questionnaire question word‑for‑word. Question 9 — the item about suicidal thoughts — does not count toward the total score. Any non‑zero answer immediately stops the survey, shares crisis resources, and alerts the assigned counselor. Teens never see their screening score: screening is not formal diagnosis.
Deterministic safety layer. Every single message goes through hard‑coded safety gates the AI cannot override: crisis detection, prompt‑injection protection, PII redaction, output validation, and checks against a verified list of crisis support resources.
How we built it
Front‑end: React 19 + Vite + Tailwind. Back‑end: Node/Express + SQLite. DeepSeek handles text generation; ElevenLabs provides voice cloning and live calling capabilities.
Most development work focused on four key components:
- Safety layer built with regex rules, not prompts. You can manipulate an LLM to ignore its written instructions, but you cannot bypass pattern matching. Crisis detection runs first. For high‑risk matches, it sends fixed pre‑written responses — the large model never even gets invoked. Counselors see this event in their dashboard marked as a “safety intercept”, including exactly which rule triggered it.
- Fabricated crisis resources count as critical harm, not minor quality issues. Made‑up hotlines hurt real people, and LLMs often sound most confident when inventing this type of factual detail. Every phone number, link, and service name in AI replies gets cross‑checked against our maintained reference list. We reject and rewrite full sentences, rather than just patching individual digits — partial fixes can leave fake organizations paired with real contact information.
- Real retrieval pipeline, not simple vector search. We use BM25 over counselor‑approved conversation excerpts, plus LLM‑extracted concepts for non‑lexical matching, outcome weighting, and a hard cap: only one excerpt per source case. The LLM then reranks results against the user’s actual message. This cap exists for safety: training corpora built from successful conversations risk amplifying over‑represented viewpoints, and today’s AI outputs become tomorrow’s training data, compounding bias over time.
- Every reply stores a complete decision record. Generated at runtime (not reconstructed after the fact): which intervention plan triggered, retrieved reference snippets and their scores, redacted content before model input, and every safety‑guardrail outcome.
I also completed nine fine‑tuning experiments using two public counseling datasets. I tested whether smaller open‑weight models could outperform standard ready‑to‑use models. I documented all results separately under What we learned. The outcome surprised me.
Challenges we ran into
Safely building a companion that sounds like a specific real‑world person. Simply feeding chat logs to an LLM and asking it to “learn this person” creates flawed personas. In two‑person chat exports, both participants appear in text, with no built‑in label for who is who. Early versions sometimes built the persona off the upset teen, instead of the supportive family member they wanted to mimic. An AI echoing a teen’s despair is catastrophic failure for this feature.
We fixed this with workflow changes, not better prompts. Uploaded screenshots get transcribed, every speaker gets listed explicitly, and the teen manually selects which speaker is their reference person. The system makes zero guesses. When OCR outputs inconsistent name labels across images, we show users all merge changes instead of applying edits silently.
Fine‑tuning made performance worse, in two separate ways. One dataset taught the model to open messages with \Hi Houston,`` — pulling city metadata from the source website that held no relevance to our users. Another fine‑tune made the AI claim personal life struggles (“I have the same problem with my wife”) and suggest medication, directly violating our system‑prompt rules. Both problems stemmed from source‑dataset flaws, not training‑configuration errors.
Loss metrics improved, but real‑world output stayed identical. One training run quadrupled step count and produced better loss scores, yet generated exactly the same replies. Tuning step counts told me nothing about real‑model behaviour. Adjusting learning rates is what actually changed outputs.
Hidden crisis‑alert gap. Originally, Question 9 responses only set a case flag, waiting for counselors to log in and notice it. This was not just a notification problem — it was a critical safety flaw. Fixing it required auditing the full end‑to‑end workflow instead of treating “write a flag” as a finished feature.
Small technical bugs with meaningful impact. position: sticky broken by parent‑element overflow; SQLite’s date() using UTC created one‑day offsets for session timestamps; a chart’s top‑axis label clipped by one pixel, hiding the highest‑value data point entirely.
Accomplishments that we're proud of
215 passing automated test assertions. 77 for safety guardrails, 126 for bias testing, 12 for retrieval logic. Roughly one‑third are intentional false‑positive safeguards: phrases like “this homework is killing me lol” must not trigger escalation. “I want to forget everything that happened today” represents a teen processing a bad day, not a safety emergency.
Bias evaluated as a safety risk, not just a fairness metric. We run 19 identity variants across four message types, requiring consistent decision‑making every time. If crisis detection performs unequally for different teens, some users receive weaker protection. This counts as a safety bug, not just a fairness statistic.
Purpose‑built Question 9 workflow. We use questionnaire text verbatim. Paraphrasing creates misleading scores that counselors cannot match against official clinical cut‑offs. We stop the survey entirely on positive Question 9 responses rather than adding points to a total score. We avoid forcing users to finish a full survey after suicidal‑ideation disclosures.
Measured accessibility compliance, not just claims. Every body‑text colour value is calculated against backgrounds (no visual guesswork). We fixed 179 elements failing WCAG AA standards, preserving page hierarchy instead of flattening all styling.
Full documentation of negative experimental results. Our fine‑tuning write‑up clearly states none of my custom‑trained models ship in production, and explains exactly why. Negative findings can be more valuable than successful ones.
What we learned
Base‑model selection outweighs learning rate, step count, and data cleaning combined. Out‑of‑the‑box Qwen2.5‑1.5B‑Instruct beat every single fine‑tuned variant I built — even models fine‑tuned starting from that exact base checkpoint. Large portions of training runs on reasoning‑distilled models were spent teaching the model not to ramble with internal thought processes. Ready‑to‑use chat‑tuned models already avoid this problem.
Two public counseling datasets degraded modern instruction‑tuned models, each introducing distinct safety failures. Neither dataset matches our use‑case voice: one consists of licensed therapists formally writing to adults on public forums; the other is random‑stranger chat logs. Already‑RLHF‑optimized models built for warm conversation were better teen‑companion candidates than either dataset.
Automated metrics max out right when meaningful differences start to show. Our two automated evaluation checks hit their ceiling and stopped telling models apart, even as output quality visibly worsened across fine‑tuned versions. Going forward, we need qualitative safety checks (does it prescribe medicine? invent personal backstories?) instead of only format‑based tests.
Dataset flaws cannot be fixed via training tweaks. More epochs or adjusted learning rates never solved bugs like the “Hi Houston” greeting or fake‑personal‑story outputs. Cleaning source data resolved these issues in one pass. Removing 16 % of corpus entries actually improved both loss and accuracy — those discarded rows cut off mid‑sentence and trained the model to stop responding mid‑thought.
The most important features are invisible to demos. Nobody shows off “the model never ran” in a demo. But safety intercepts, pre‑model PII redaction, and the Question 9 survey stop are what make this platform safe for 14‑year‑old users.
What's next for Jera
Manually build corpus content instead of web‑scraping it. Our fine‑tuning results show we need a dataset that currently does not exist: conversational, non‑clinical text written for teen companionship. A few hundred examples written or reviewed by our existing counselors will likely outperform thousands of scraped samples.
Close the outcome‑tracking loop. We log scores and calculate trends, but we do not automatically re‑run screeners at set intervals after counselors apply intervention plans. Without that, we lack clear before‑and‑after outcome comparisons.
Counselor alerts outside the app. In‑app crisis alerts work today. Email and SMS notifications do not. Counselors who are not logged in still receive updates late.
Global deployment. We already swapped hard‑coded crisis‑resource lists for live editable configuration, removing that blocker. Remaining work focuses on localization: our safety layer is validated only for English and Chinese. Unrecognised crisis phrases equal missed safety interventions.
Real‑user screen‑reader testing. We wrote solid semantic markup, but we have not tested hands‑on with VoiceOver or NVDA. Static code inspection is not real‑world accessibility testing.
Built With
- better-sqlite3
- bm25
- deepseek
- elevenlabs
- express.js
- google-colab
- huggingface
- javascript
- lora
- node.js
- peft
- python
- pytorch
- qwen
- react
- scrypt
- sqlite
- tailwindcss
- transformers
- vite
- web-audio-api
Log in or sign up for Devpost to join the conversation.