How I Built a 100% On-Device AI Reflection Journal with Apple's Foundation Models Framework (Zero Cloud, Zero Accounts)

2026-11-29来源 dev.toEnglish

There is a fundamental privacy paradox in almost every AI journaling app on the App Store today:

They ask you to write down your most vulnerable thoughts—anxieties, relationship friction, career doubts, bad days—and then immediately POST that raw text to a cloud LLM endpoint, store it in a remote database tied to your email address, and charge $12/month forever to cover API tokens.

That felt completely backwards to me. Personal writing should stay personal.

So I built Refruna: AI Reflection (App Store)—a private, CBT-inspired reflection journal for iPhone and iPad where every single AI step runs 100% on-device using Apple's Foundation Models framework (iOS 26 / iPadOS 26).

Here are the architecture decisions that made a zero-cloud, zero-account, one-time-purchase AI app possible.

1. On-Device AI That Starts With Your Own Words (Not a Chatty Bot)

Instead of dropping users into an open-ended chatbot window—which often spirals into passive reassurance—Refruna guides you through a structured 5-step CBT-inspired thought record:

  1. Describe what happened in a few plain lines
  2. Separate the facts from your interpretation — on-device Apple Intelligence extracts the objective situation vs. the automatic thought, and you can edit anything that doesn't fit
  3. Name the feeling & rate intensity (1–10)
  4. Explore evidence & alternative perspectives — the on-device model generates concise, tailored CBT questions specifically grounded in what you wrote
  5. Draft a balanced thought & choose one small next step — and revisit later with a follow-up CBT exercise when real life moves on

Because inference runs locally via Apple's Foundation Models framework:

  • Zero cloud API latency or token bills → which is why Refruna can be a $6.99 one-time purchase instead of another monthly subscription.
  • Zero journal text ever leaves the iPhone or iPad.

2. Radical Privacy-by-Design Defaults

Privacy shouldn't be a toggle buried three settings screens deep. In Refruna:

  • No user account or login screen — open the app and start writing immediately.
  • Zero advertising, tracking, or analytics SDKs.
  • Local storage excluded from standard device backups (NSURLIsExcludedFromBackupKey), so private reflections aren't silently duplicated onto remote backup servers.
  • Graceful non-AI fallback — if Apple Intelligence isn't enabled on a device (or you simply prefer writing manually), every reflection step, follow-up exercise, and breathing session works seamlessly with built-in prompts.

3. Integrating a Quiet Reset Right Inside Writing

When a thought is looping hard, staring at a blank text box can feel overwhelming. Refruna includes a six-circle breathing exercise (1, 3, or 5 minutes with optional subtle iPhone haptics) that can stay running right alongside your writing, with compact controls whenever you need a pause.

Try the Free 100% Browser-Local CBT Worksheet (No Signup)

If you want to try the 5-step CBT reflection format and six-circle breathing rhythm right now in your browser (100% local JavaScript, zero network calls):

And if you're on iPhone or iPad and want on-device Apple Intelligence CBT guidance, searchable saved reflections, follow-up exercises, and haptic breathing in English, Spanish, or Brazilian Portuguese:

(Note: Refruna is designed for personal reflection and general wellbeing—not medical advice, diagnosis, psychotherapy, or emergency care.)

Are any other iOS devs here shipping production apps with Apple's Foundation Models framework yet? I'd love to hear how you're handling structured prompting and graceful fallbacks!

原文:https://www.a8q9.cn/en/article/how-i-built-a-100-on-device-ai-reflection-journal-with-apple-s-foundation-models-b80cf1.html

相关文章