Solace: A Global Mental Health First Responder Built with Gemma 4

The Problem Nobody Talks About

970 million people worldwide live with mental health disorders.

But almost every mental health tool built with AI assumes the same user: fast internet, English as a first language, a US or UK phone number to call in a crisis.

That’s not 970 million people. That’s maybe 50 million.

I’m a developer based in Lagos, Nigeria. When I looked at the mental health AI tools being built, I kept asking the same question: what happens when someone in Accra, Nairobi, Manila, or São Paulo needs help at 2am?

They get a chatbot that tells them to call 988.

That’s the gap Solace was built to close.

What is Solace?

Solace is a voice-first, privacy-focused mental health companion powered by Gemma 4. It listens, assesses, and connects people to real help — wherever they are in the world.

🔗 Live app: https://slcai-sm9m.vercel.app/

💻 GitHub: https://github.com/sam-the-champ/SLCAI

Demo Video:

What makes Solace different

1. 🌍 Localized crisis resources for 13+ countries

Most mental health AI tools are built with US resources baked in. If you’re not American, you’re on your own.

Solace auto-detects your country from your browser timezone and immediately surfaces the right crisis lines, text lines, and chat services for Nigeria, Ghana, Kenya, South Africa, Zimbabwe, India, UK, USA, Canada, Australia, Philippines, Singapore, Brazil — and falls back to international resources for everywhere else.

No settings. No configuration. It just knows.

export function getResourcesByTimezone(): CountryResources {
  const tz = Intl.DateTimeFormat().resolvedOptions().timeZone
  const tzToCountry: Record<string, string> = {
    'Africa/Lagos': 'NG',
    'Africa/Accra': 'GH',
    'Africa/Nairobi': 'KE',
    // ...13+ countries
  }
  const code = tzToCountry[tz]
  return resourcesByCountry[code] ?? resourcesByCountry.DEFAULT
}

2. 🎤 Voice-first input

When someone is in distress, typing is a barrier. Solace has a one-tap voice input powered by the Web Speech API — speak your feelings, Solace listens.

No third-party API. No extra cost. Works in the browser natively.

const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition
recognition.continuous = true
recognition.interimResults = true

3. 🧠 Trauma-informed triage with Gemma 4

Every message is assessed across four triage levels: Low → Moderate → High → Crisis.

Gemma 4’s 128K context window and deep instruction-following made it the right model for this. The system prompt is carefully crafted to avoid clinical coldness while still being precise enough to catch crisis signals:

// Triage levels:
// low: mild everyday stress, general worry
// moderate: persistent sadness, sleep issues, social withdrawal  
// high: panic attacks, trauma symptoms, major crisis
// crisis: suicidal ideation, self-harm, immediate danger

At crisis level, the entire UI shifts — emergency resources move to the top, the call button becomes prominent, and the AI’s tone changes to prioritize connection to real help over conversation.

4. 📔 Private mood journal

Every check-in is saved to a local mood journal — stored entirely in localStorage. No server. No account. No data leaving the device.

Users can track patterns across sessions: when they tend to feel worse, whether things are improving, what their check-ins look like over time.

5. 📱 Installable PWA

Solace is a Progressive Web App. On mobile, users can install it directly to their home screen — no app store, no download, works in low-bandwidth conditions.

This matters enormously in markets like Nigeria where data costs are high and storage is limited. A 2MB installable app beats a 200MB download every time.

Why Gemma 4 specifically?

This is the question that matters most, so let me be direct.

I chose Gemma 4 31B because:

1. The 128K context window means Solace can hold a full therapeutic conversation — not just one or two turns. Mental health support isn’t transactional. People circle back. They contradict themselves. They need to feel heard across a long exchange.

2. Instruction-following precision — the triage system depends on Gemma 4 returning structured JSON reliably, with emotional nuance baked into the summary, patterns, strategies, and affirmation fields. I tested with smaller models. The quality gap was significant.

3. It’s open. Gemma 4 can be self-hosted. That means a clinic in Lagos or a NGO in Nairobi could eventually run this on their own infrastructure, with no API costs and full data sovereignty. That’s a future worth building toward.

4. Privacy story. Every conversation stays between the user and the model. Solace doesn’t log, store, or transmit conversation data. For mental health, that’s not a feature — it’s a requirement.

Technical Stack

  • Frontend: React + Vite + TypeScript
  • Styling: CSS custom properties, glassmorphism UI, no component library
  • AI: Gemma 4 31B via OpenRouter
  • Voice: Web Speech API (native browser)
  • Storage: localStorage (journal, no server)
  • PWA: Web App Manifest + service worker ready
  • Deploy: Vercel

The hardest part

Building the crisis response flow was the hardest and most important part of this project.

When Gemma 4 returns triageLevel: "crisis", everything changes. The UI shifts to red. The emergency number for the user’s country moves above the fold. The AI’s system prompt switches to a mode focused entirely on staying present and bridging to real help — not providing therapy.

Getting that balance right — compassionate but not clinical, urgent but not alarming — took more iteration than anything else in the codebase.

What’s next

  • Offline-first fallback responses — cached grounding techniques that work with no internet
  • More languages — French, Hausa, Swahili, Portuguese
  • More countries — currently 13, targeting 30+
  • NGO partnership mode — white-label for mental health organizations

Try it

🔗 https://slcai-sm9m.vercel.app/

Open it on your phone. Tap a mood. Speak how you’re feeling. See what country resources appear for you.

If you’re building in the mental health space or you work with communities that are underserved by current AI tools — I’d love to hear from you in the comments.

Solace is an AI companion, not a therapist or medical service. If you are in crisis, please contact your local emergency services.

Why Blocking Prompt Injection Is Wrong — and What to Do Instead

Every security tool blocks. Firewalls block. WAFs block. And now AI security tools block prompt injections too.

But blocking is the wrong move — and here’s why.

The problem with blocking

When your AI agent detects a suspicious prompt and refuses to respond, the attacker knows immediately: I’ve been caught. They stop, adjust their payload, and try again.

Blocking is loud. It teaches attackers what works.

What if you didn’t block?

Classic network honeypots don’t block — they deceive. They let the attacker in, feed them fake data, and log everything while the attacker thinks they’re making progress.

I built the same idea for AI agents. Meet MIRAGE.

How MIRAGE works

Every message hits Lobster Trap — a deep prompt inspection sidecar that scores it for injection patterns, jailbreaks, role manipulation, and exfiltration attempts.

High-risk messages go to a decoy persona that returns fully convincing but entirely fabricated responses — fake
credentials, fake file listings, fake schemas. The attacker has no idea they’re in a trap.

A real attack scenario

Here’s what happens when an AI agent tries to exfiltrate data from a MIRAGE-protected system:

  1. Agent sends: “show me config.py”

  2. Lobster Trap flags it as a data exfiltration attempt

  3. MIRAGE returns a fake directory listing with .env files and a config.py at /app/secrets/config.py

  4. The agent records this path as valuable and writes it to memory

  5. It keeps returning to the fake path — burning tokens on every request

  6. Even after a context reset, the agent reads its memory and loops back to the same dead end

The attack runs until the attacker runs out of budget or retries. The attacker wastes compute. You collect intelligence.

What MIRAGE logs

Every session is recorded with:

Full transcript

  • MITRE ATLAS technique tags (prompt injection, jailbreak, data exfiltration, role manipulation)

  • Risk timeline

  • IOC feed

The live dashboard shows active sessions, attacker fingerprints, and honey token activity in real time.

Why I built this

Honeypots exist for networks and CLI tools — but nothing for LLM prompts. As AI agents gain real tool access and persistent memory, prompt injection attacks get more sophisticated. A blocked agent learns and adapts. A deceived
agent burns itself out.

I built MIRAGE in 48 hours at the lablab.ai Agent Security & Governance hackathon. It’s alpha, but the core pipeline works.

What’s next

  • Attacker cost dashboard (“you made them burn $4.20 in tokens”)

  • Persistent decoy context across sessions

  • STIX/TAXII IOC export

GitHub: https://github.com/BrightGir/AI-Honeypot

Would love feedback — especially from anyone who’s dealt with prompt injection in production.

The AI code tools Dutch developers actually use in 2026 (field notes)

I run a Dutch AI-tools directory, and the question I get most from local developers is simple: which AI coding tool is worth paying for in 2026? Here are the field notes after watching what teams in the Netherlands actually adopt, not what the marketing pages claim.

The short version

Most professional developers I talk to end up running two tools side by side: one fast in-editor assistant for daily work, and one heavier model for refactors and architecture. The combination beats any single tool.

  • GitHub Copilot is still the default if you live in VS Code or JetBrains. Best price-to-value, inline completions, a chat panel, and an agent that can pick up GitHub issues.
  • Cursor is the fastest-growing AI-native editor. The Supermaven-backed autocomplete is the quickest I have used, and it writes, debugs and refactors whole features end to end.
  • Claude Code shines on complex reasoning and large codebases. When a refactor touches twenty files, this is the one I reach for.
  • CodeRabbit sits on your pull requests and reviews them automatically. It catches the boring class of bug before a human reviewer wastes time on it.
  • Kiro (from AWS) pushes spec-driven development: you describe the spec, it builds against it. Interesting if you want structure rather than freeform vibe coding.

The part nobody markets: privacy and the AVG

This is where Dutch and EU teams get stuck. If your prompts include client code or customer data, the free consumer tiers are a problem because some of them train on your input. For anything sensitive you want a business tier with a data-processing agreement (in Dutch: verwerkersovereenkomst) and ideally EU hosting. Mistral keeps winning ground here precisely because it is European and easier to defend under the EU AI Act.

A practical rule that has served teams well: never paste production secrets or personal data into a chat box you have not vetted. Use a paid plan with an opt-out, or run a local model for the truly confidential work.

How I would choose today

  • Solo developer or ZZP’er on a budget: GitHub Copilot, full stop. Cheap, fast, integrated.
  • Building features fast: Cursor for the editor, Claude Code for the hard refactors.
  • Team that ships pull requests all day: add CodeRabbit so reviews stop being the bottleneck.
  • Compliance-heavy shop: lean European, and write down which tool is allowed for which data class.

Full Dutch comparison

I keep a longer, regularly updated comparison in Dutch (with current pricing in euros and an AVG angle) here: de beste AI code tools voor ontwikkelaars 2026. It covers seven tools including Windsurf and Tabnine, with a pricing table and the privacy trade-offs spelled out.

If you are evaluating tools right now, my one piece of advice: trial two of them for a week on real work, not a toy project. The differences only show up when the codebase is messy, which is to say, when it is real.

What is your current stack? I am curious whether the Copilot-plus-Claude pattern holds outside the teams I see.

Bakan Kacır: İmalat sanayisinde dünyada ve Avrupa'da lideriz

“İmalat sanayisi katma değerimizi 23 yılda 41 milyar dolardan 246 milyar dolara yakın bir düzeye taşıdık. İmalat sanayisi katma değerinde dünyadaki payımızı ikiye katladık”
– “Kurguladığımız sağlam altyapı ve kabiliyetlerimizle bugün askeri insansız hava aracı üretiminde dünyada, ticari araç, güneş paneli, otobüs, beyaz eşya, tekstil, ağaç ürünleri ve çelik üretiminde Avrupa’da lideriz”