Margin

A quiet companion for your thoughts · Built with Gemini · Local-first


The Problem

When someone writes "I'm a failure" in their journal, most apps just... save it. The thought sits there, permanent and heavy, reinforcing itself every time they read it back.

We wanted to build something different: a space where you can look at your thoughts, not from them.


What Margin Does

Margin is a journaling app that helps you notice when you're fusing with negative thoughts — and gently create distance from them. It's built on the concept of cognitive defusion: the ability to step back and see a thought as just a thought, not a fact.

Silent Detection

As you write, Margin quietly analyzes each sentence using Gemini. It distinguishes between everyday thoughts ("Remember to call Mom") and cognitive fusions ("I'm worthless"). No interruptions, no pop-ups — just a subtle highlight appears in the margin.

The Paper Ball

When you're ready, you can interact with a highlighted thought through a simple gesture: crumpling it into a paper ball. This isn't about deleting the thought — it's about changing your relationship with it. You drag, the paper crumples, and the original thought transforms into a reframed perspective:

"I'm a failure""I notice I'm having the thought that I'm a failure"

The paper ball then falls to the bottom of the screen, joining others — a growing collection of thoughts you've stepped back from.

Warmth, Not Advice

Powered by Gemini, Margin generates a single line of validation — not generic affirmations, but something that reflects what you actually wrote. The tone is inspired by Animal Crossing villagers: present, accepting, never preachy.

"Being criticized in front of everyone — that must have stung."


How We Built It

Stack: Next.js 14, Tailwind CSS, Gemini 3.0 Flash

Privacy: All journal entries stay in your browser (localStorage). Our API is stateless — we analyze and forget.

AI Architecture:

/api/detect  → Classifies sentences as fusion or not
/api/reframe → Generates defused perspective  
/api/comfort → Creates contextual validation

Key Design Decisions:

  • No streaks, no gamification, no confetti
  • Ambient intervention (highlights appear silently)
  • Physical metaphor (paper → crumple → ball → collection)

Challenges

Finding the Right Voice

Early versions sounded either too clinical or too fake-cheerful. We tuned prompts to find a voice that's warm but doesn't pretend to be human.

Validation Without Agreement

We wanted to acknowledge emotions without reinforcing distortions. The breakthrough: stop trying to "fix" thoughts, just see the situation behind them.

Making the Abstract Tangible

Cognitive defusion is powerful but invisible. The paper ball metaphor came from asking: what does it physically feel like to let go of a thought?


What We Learned

Psychological flexibility isn't about positive thinking. It's about holding thoughts lightly — seeing them as mental events rather than truths.

Small interactions matter. Dragging a slider, watching paper crumple, seeing a ball fall — these micro-moments create a felt sense of "letting go" that words alone can't achieve.


Margin — Leave Some Margin for Your Mind to Breathe.

Built With

Share this project:

Updates