Offline-first Android emergency response app.
AGENT.mdCLAUDE.mddocs/ARCHITECTURE.mdPLAN.md
If these documents conflict, preserve the implementation direction from docs/ARCHITECTURE.md.
- Core emergency flow must work fully on-device.
- Deterministic state logic decides the next action.
- AI is optional and must never be required for the demo path.
- Protocol text comes from structured local data.
Integrated runtime path:
- sponsor tooling: ZETIC Melange
- primary on-device LLM: Gemma4 E2B
By default the deterministic demo path remains active with AI_ENABLED=false.
To enable the real Melange-backed path, add these properties to your user Gradle properties file (~/.gradle/gradle.properties) or another injected Gradle property source:
MOASIS_AI_ENABLED=true
MOASIS_MELANGE_PERSONAL_KEY=your_personal_key
MOASIS_MELANGE_MODEL_NAME=your/model-name
MOASIS_MELANGE_MODEL_VERSION=1
MOASIS_MELANGE_MODEL_MODE=RUN_AUTOCurrent runtime notes:
- the app reads Melange credentials from Gradle properties and exposes them through
BuildConfig MOASIS_MELANGE_MODEL_VERSIONis optional; use-1or omit it to let Melange resolve the latest published versionMOASIS_MELANGE_MODEL_MODEsupportsRUN_AUTO,RUN_SPEED, andRUN_ACCURACY- the app is pinned to
com.zeticai.mlange:mlange:1.6.1 - the first Melange model initialization may download runtime/model artifacts, so
INTERNETpermission is included for the AI-enabled path - when AI is enabled, the app now checks and prepares the Melange model during startup and shows progress in the UI
- after the model is downloaded and initialized once, later launches should reuse the cached model artifacts
- the current Melange runtime resolved by Gradle requires
minSdk 31; this is stricter than the public setup page that still statesminSdk 24 - if Melange is not configured, the app falls back to deterministic guidance and keeps
AI_ENABLED=falsebehavior effectively disabled in the UI
Procurement and model note:
- confirm the exact Gemma4 E2B model identifier provisioned in the Melange dashboard for the demo device
- verify first-run download and warmup on the physical target device before the demo
- keep the app functional with
AI_ENABLED=falseas the rollback path until on-device inference is verified end to end
If you need Melange paths that depend on Google Play delivery, use Play internal testing instead of a locally installed debug APK.
- guide: docs/PLAY_INTERNAL_TESTING.md