惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
IT之家
IT之家
Last Week in AI
Last Week in AI
J
Java Code Geeks
L
LangChain Blog
Recent Announcements
Recent Announcements
Martin Fowler
Martin Fowler
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
博客园 - Franky
博客园 - 司徒正美
月光博客
月光博客
博客园 - 叶小钗
Vercel News
Vercel News
腾讯CDC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
B
Blog RSS Feed
人人都是产品经理
人人都是产品经理
H
Help Net Security
G
Google Developers Blog
D
DataBreaches.Net

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built a voice CBT diary with offline AI — here's how it...
Pavel Trubet · 2026-05-27 · via DEV Community

Pavel Trubetskov

Two years ago I was going through CBT therapy for anxiety and depression.
The homework — keeping a thought diary between sessions — never worked for me.
Typing during a panic attack is impossible. I'd end up filling it from memory
two hours before the session. CBT loses most of its effect that way.

Voice was the obvious fix. On-device AI was the missing piece.

What I built

Mentalium is a voice CBT diary with offline AI transcription. Press record,
speak the five steps of a CBT thought record — situation, automatic thought,
emotion, reaction, alternative thought — and the AI fills every field. No typing.
No cloud. Your voice never leaves the device.

The tech stack

Flutter + Dart for the UI and app logic. One codebase for iOS and Android,
which matters for a solo founder.

Whisper.cpp for transcription. The ggml-small-q5_1 model (~180 MB)
downloads once on first launch, then runs fully offline forever.

  • On iOS: compiled against Metal GPU via a Swift bridge. CoreML wasn't flexible enough for the quantized model weights I needed.
  • On Android: JNI bridge to the native C++ library. Getting this to compile cleanly for arm64-v8a and x86_64 took a while.

SQLite (via sqflite) for local storage. Every diary entry stays on-device —
no backend sync, no analytics on the content.

AES-256-GCM encryption applies only when the user emails an Excel report
to their therapist. That's the only outbound transmission.

The hard parts

Model size vs. accuracy tradeoff. The tiny Whisper model is fast but misses
nuance — important for transcribing emotional content accurately. The small-q5_1
quantized model hits the sweet spot: ~180 MB on disk, good accuracy across
all 7 supported languages, runs in real-time on a 2020 iPhone.

First launch UX. Downloading 180 MB on first open is a bad experience
if you don't set expectations. I added a progress bar with explicit copy:
"Downloading the AI model — this happens once, then it works offline forever."

Language detection. The app supports 7 languages. Whisper handles multilingual
transcription well, but I had to build language-specific keyword matching
for the cognitive distortion analysis (catastrophizing, mind-reading, etc.)
across EN/DE/FR/ES/IT/PT-BR/RU.

What I learned

Building for mental health adds constraints most apps don't have. Privacy
isn't a feature — it's the baseline. Users will not trust a voice diary
that uploads to a server, no matter how good the privacy policy is.
On-device AI removes that trust problem entirely.

The CBT methodology also drove some unusual UX decisions. The five-step
structure is fixed — you can't let users skip steps the way a generic journal would.
That rigidity is the point.

Where it is now

iOS is live on the App Store with a 7-day free trial.
Android is coming.

mentalium.me
App Store

Happy to answer questions about the Whisper.cpp integration,
the Flutter architecture, or the CBT-specific UX decisions.