Back to AI Mochi

How AI Mochi is built

AI Mochi is a kawaii companion that lives on the iPhone, the Home Screen and the Apple Watch. It reacts to music, noise, weather, motion, battery and time of day, remembers your streaks, ages through life stages, and answers when you talk to it using Apple Intelligence.

Version
2.7
Requires iOS
iOS 17.0
Size
8.6 MB
Category
Entertainment
First released
2026

Architecture

A modular Swift 6 codebase: seven local Swift packages hold all logic and rendering, and thin app targets for iPhone, the widget extension and watchOS compose them. No third-party dependencies — Apple SDKs only.

  1. MochiCore

    Pure logic with no UI imports: state machine, AnimationScheduler and PersonalityEngine as actors, mood forecasting, life stages and an @Observable MochiEngine orchestrator.

  2. MochiRenderer

    Vector faces drawn with SwiftUI Canvas. Each companion has its own renderer behind a CompanionRendering protocol; expression mappers turn animation frames into animatable face parameters.

  3. MochiListen & MochiVoice

    Microphone feature extraction, Speech transcription, NaturalLanguage sentiment, Foundation Models replies gated by availability, and AVSpeechSynthesizer voices.

  4. MochiMotion & MochiAudio

    CoreMotion wrappers with pure-logic shake and tilt detectors, and a synthesised sound engine built on an oscillator bank rather than audio files.

  5. MochiStore

    StoreKit 2 catalogue, entitlement gatekeeper and a mock engine for previews and tests.

Stack

Languages

39,068lines of code · 256 source files
Swift 99.9%

Build

UI
SwiftUI-first (with UIKit interop)
Swift
5.9
Deployment target
iOS 17.0 · watchOS 10.6
Tests
838 test cases

Apple frameworks

Machine learning

FoundationModelsNaturalLanguageSpeech

Interface

SwiftUIUIKit

System integration

WidgetKitActivityKitAppIntentsUserNotificationsBackgroundTasksWatchConnectivity

State and concurrency

CombineObservation

Data

SwiftData

Media

AVFoundationAudioToolbox

Device and sensors

CoreLocationCoreMotion

Commerce

StoreKit

Graphics

CoreGraphics

Local Swift packages

MochiAudioMochiCoreMochiListenMochiMotionMochiRendererMochiStoreMochiVoice

Targets

App
Mochi
App
MochiWatch
App extension
MochiWidgetExtension
App
MochiDemo

Dependencies

No third-party dependencies — Apple SDKs only.

Patterns

Observation (@Observable)ObservableObject / Combine bindingsSwift Concurrency (async/await)Actors@MainActor isolationSwiftData modelsCoordinatorsNavigationStack#Preview macrosSwift TestingXCTestString CatalogsOn-device LLM (LanguageModelSession)Canvas / TimelineView renderingCodable modelsGCD

Capabilities

App GroupsWeatherKit

Tooling

Swift Package ManagerAI-assisted development (agent docs)

Stack detected automatically from the repository on 27 Oct 2026.

Engineering highlights

Hundreds of unit tests

Logic is isolated in packages behind protocols (mock motion, mock store, deterministic schedulers), which keeps the engine testable without a device.

Procedural animation and sound

Faces are vector and parametric, sounds are synthesised — the whole character ships with almost no bitmap or audio assets.

Community-compatible animation format

Animations are JSON assets compatible with open-source ESP32 maker projects, so packs can be imported with minimal conversion.

One codebase, three surfaces

The watchOS app reuses MochiCore and MochiRenderer and stays in sync through WatchConnectivity instead of running its own engine.

Get it on the App StoreBack to AI Mochi