36 DUNES
ServicesWorkBlogAboutClientsRequest a proposal
← All posts
BUILD LOG

Building MoodLens: a mood journal that reads between the lines

How I built an iPhone app that reads the emotion in what you write or say, keeps your data private, and costs almost nothing to run.

Most journaling apps ask you to rate your mood on a scale of one to five. I wanted one that could read the mood for you. You write a few honest lines, or say them out loud, and it tells you what it hears underneath. Over weeks, it shows you patterns you would never spot on your own.

That app is MoodLens. It's now in App Store review, and this is how I built it: what it does, how the AI works, and the privacy and cost decisions that shaped it.

What MoodLens does

The core loop takes about thirty seconds. Open the app, type how your day went, or switch to voice and talk for a few seconds. Tap Reveal My Mood, and you get a reading: the strongest emotion in the entry, plus the others underneath it.

Those readings add up. The home screen shows a Daily Reading that summarizes where you've been lately. It also surfaces patterns in your own history: maybe Mondays tend to run heavy, or a certain month is usually brighter. The app has a midnight-and-gold, tarot-inspired look, so it even tracks moon phases. It says plainly that there's no scientific link between the moon and mood, but it's a fun lens that fits the app's personality.

When several entries in a row lean heavy, MoodLens offers a gentle check-in instead of an alarm. It suggests a few things that might help, like a walk, a call to a friend, or a reset ritual. No streaks, no points, no guilt.

How it reads emotion

MoodLens uses two open-source machine-learning models, both running on my own server:

  • For writing: a language model trained on GoEmotions, a dataset of 58,000 Reddit comments hand-labeled with 27 emotions plus neutral. It picks up nuance that a simple positive-or-negative score misses: gratitude, nervousness, amusement, relief, remorse.
  • For voice: a speech model trained to recognize emotion in the sound of a voice, not the words. The app trims out silence, normalizes the volume, and reads the clip in short overlapping windows before averaging them into one reading.

One detail I love: the text model scores each emotion independently, so the scores don't have to add up to 100%. When I tested it on "Finished a book I loved. Sad it's over, but so glad I read it," it came back 60% sadness and 52% love at the same time. That's exactly what that feeling is.

The models aren't perfect. Short entries and mumbled audio can throw them off, and the app says so: it flags low-confidence voice readings and asks for a clearer clip. I'd rather be honest about the limits than oversell the magic.

Privacy wasn't a feature. It was the design.

A mood journal holds tender things. So the privacy rules came first, and the architecture followed:

  • No accounts. There's no sign-up, email, or name. Your history is tied to a random ID stored in your phone's secure keychain, and that ID is cryptographically signed, so no one can read someone else's entries by guessing IDs.
  • Voice clips are thrown away. Recordings are analyzed in memory and discarded. Only the emotion reading is saved.
  • No third-party AI. Your words go to my server and nowhere else. They aren't sent to a big AI company, and they aren't used to train anything.
  • Delete means delete. One tap removes every entry, from your phone and from the server, and resets your anonymous ID.
  • No ads, no analytics, no tracking.

There's a second kind of care, too. An app that notices when you're having a hard stretch has a responsibility to handle that well. MoodLens is clear that it's a reflection tool, not a medical device, and it never diagnoses anything. Wherever it mentions a heavy mood, it also shows a tap-to-call link to 988, the US Suicide & Crisis Lifeline. I rewrote early wording like "possible burnout cycle" into something gentler, because an app shouldn't sound like it's handing out diagnoses.

Running real AI for almost nothing

Running your own models sounds expensive. The two MoodLens models need about 3 GB of memory, and keeping a server like that on around the clock costs roughly $60 to $120 a month. For an app that doesn't have users yet, that's hard to justify.

So MoodLens runs on Google Cloud Run, set to scale to zero. When nobody is using it, no server is running and nothing is billed. When a request comes in, Cloud Run starts one up. At launch-level traffic, that should fit inside Cloud Run's free monthly allowance. The database is a free-tier Postgres on Neon.

The tradeoff is the cold start. Booting the server and loading both models takes about a minute, which is longer than an iPhone will wait for a response. I handled that in three layers:

  1. The models are built into the server image, and the server runs one practice reading before accepting traffic, so the first real request doesn't pay the loading cost.
  2. The app wakes the server the moment you open it. By the time you've written an entry, the server is usually ready. If it isn't, the app shows a "waking up" message and retries instead of failing.
  3. A scheduled ping every 10 minutes keeps a warm server around most of the time, and idle time isn't billed.

The result is real, self-hosted AI with a hosting bill that rounds to zero until people actually use it. When they do, it's one setting to keep a server always warm.

Why this matters beyond a journal

MoodLens is a personal app, but the pieces behind it are the same ones I use with businesses at 36 Dunes:

  • Reading emotion in text at scale. The model that reads a journal entry can just as easily read hundreds of customer reviews, survey answers, or support emails, and tell you what people feel, not just whether they gave you four stars.
  • Keeping sensitive data in-house. Open-source models on your own server mean customer data never goes to a third-party AI company.
  • Paying for AI only when you use it. Scale-to-zero hosting makes custom AI realistic for a small business, not just for companies with an engineering team.

If you're curious what that could look like for your business, I'd love to talk.

See it for yourself

MoodLens is coming soon to the iPhone App Store. You can try sample readings from the real model, and see the app, at moodlens.36dunes.com. The download button will switch on by itself the day it goes live.

START A PROJECT

Want AI that reads your customers' words without sending them elsewhere?

Tell us what you're working with. We'll tell you honestly whether there's a real signal in it worth building for.