Skip to content

DTGApp/Axiom-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Axiom โ€” On-Device AI Assistant for Android

ChatGPT knows everything about the world but nothing about you. Axiom knows everything about your world.

Axiom is a privacy-first Android AI assistant that runs entirely on-device โ€” no internet, no account, no cloud. It learns your phone usage habits through on-device machine learning and gets smarter the longer you own the device.

0 bytes sent. 0 servers crossed. This is shown to the user โ€” with actual milliseconds โ€” after their very first inference.


Table of Contents

  1. What Makes It Different
  2. Feature Overview
  3. Architecture
  4. The Dream Cycle
  5. The Dreaming Animation
  6. All On-Device Files
  7. All SharedPreferences Keys
  8. Permissions
  9. System Health Check
  10. MIUI / Xiaomi Notes
  11. Known Limitations
  12. Project Structure
  13. Build Notes
  14. Privacy

What Makes It Different

Every AI assistant on the market sends your queries to a remote server. Axiom physically cannot โ€” there is no INTERNET permission in the manifest. The OS will block any network call, even accidental ones.

The model weight (~900 MB, Qwen2.5-1.5B Q4) lives on your device. The personal adapter that makes Axiom fast and personal (~50 KB) trains entirely from your own feedback. Nothing is ever uploaded. There is no backend to breach, no account to compromise, no privacy policy that changes.

The core differentiator is the world model: Axiom learns your habits and builds a private model of your world โ€” your apps, your patterns, your rhythm. No other assistant on Android does this without a server.


Feature Overview

Home Screen

Ask Axiom โ€” Voice or typed natural language. Three processing modes shown in real-time:

  • ๐Ÿ”‘ Keyword โ€” instant regex match, no model needed
  • ๐Ÿง  Neural โ€” Qwen2.5-1.5B Q4 classified this (Vulkan GPU, ~200ms)
  • โšก Instant โ€” personal MLP adapter handled this (activates at 5+ interactions)

Confidence shown as percentage. Low-confidence results ask for confirmation before executing. Voice output via Android's built-in TTS.

Context Card โ€” Live, personal insight at the top of the screen. Changes throughout the day as patterns are detected:

  • "You open Spotify every Tuesday evening โ€” 6 of the last 7 weeks."
  • "Battery at 18%. You typically charge around 9 PM โ€” that's 2 hours away."
  • "You've picked up your phone 47 times today, 31 opened Instagram." Every number is real, pulled from actual on-device usage data.

Try Saying โ€” Rotating example card showing 3 contextual prompts (primary + 2 secondary). Changes every time the app opens. Tapping any example pre-fills the input. 10 rotating sets covering: app launching, navigation, media, calls, alarms, file search, social, and more.

Learning Bar โ€” Persistent indicator of learning phase: Warming up โ†’ Early learning (< 5) โ†’ Improving (5โ€“19) โ†’ Pattern forming (20โ€“49) โ†’ Deeply trained (50+).

My World Model โ€” Collapsible card showing what Axiom has learned. Expanded view shows a monospace habit breakdown: app name, hour, learned frequency. System apps filtered. Footer: "All patterns learned on-device ยท 0 bytes sent anywhere."

On-Device Moment โ€” Shown once after the first successful inference. Displays actual inference milliseconds with "0 bytes sent ยท 0 servers crossed." Designed to be the screenshot moment.

Dream Card โ€” Shows the dreaming animation during active learning cycles and a stats summary (interactions / trained / logs cleaned) after completion.


Axiom Intelligence Screen

Accessed via ๐Ÿ”ฌ Intel pill or three-dots menu.

Battery Doctor โ€” On-device AI diagnosis of battery health and background drain. Identifies the top drain app, estimates savings, shows screen-on time and pickup count. Falls back to template diagnosis if LLM is busy.

Axiom Noticed โ€” Weekly pattern insight generated by InsightEngine. Plain English summary with supporting data points. System apps filtered. Minimum 6 days between new insights โ€” can be forced via "Analyse Now."

Auto Mode โ€” Current active profile (Sleep / Commute / Work / Focus / Gaming / Normal), recent switch log, and volume preference controls. Mode switches are always notifications with confirm/skip โ€” never silently applied.


Three-Dots Menu (โ‹ฎ)

Option Opens
๐Ÿง  What Axiom Knows AxiomProfileActivity โ€” stats, interaction count, install age
๐Ÿ“Š Analyse Usage Triggers manual usage scan
๐ŸŒ™ Dream Summary Shows last dream cycle results
๐Ÿ”ฌ Axiom Intelligence InsightActivity โ€” Battery, Insight, Mode
โš• System Health HealthCheckActivity โ€” full module diagnostic

Architecture

Intelligence Stack

Tier 0   โ€” Direct app launch / fallback          <1ms
Tier 0.3 โ€” Contact + app action detection        <5ms    "call mom on WhatsApp"
Tier 0.5 โ€” File search routing                   <5ms
Tier 0.6 โ€” AI detector routing                   <5ms
Tier 0.7 โ€” Smart actions                         <5ms    alarms, reminders, maps
Tier 1   โ€” Keyword + adapter pipeline            <10ms
Tier 2   โ€” LLM classification (ambiguous)        ~200ms  Qwen2.5-1.5B Q4, Vulkan
Tier 2.5 โ€” Identity/creator questions            <1ms    hardcoded
Tier 3   โ€” LLM conversational reply              ~200ms

Personal MLP Adapter โ€” 12โ†’64โ†’101 MLP, SGD LR=0.01. Activates at 5+ interactions. Fully bypasses the LLM at 50+ interactions. Trains only from real accept/reject feedback โ€” no synthetic data.

Temporal Prediction Table โ€” axiom_preds.csv records intent ร— hour-of-day frequency. Updated daily by the usage scan. Enables time-aware predictions without any LLM.

Always-On Service

AxiomService runs as a foreground service:

  • START_STICKY โ€” restarts if killed
  • BOOT_COMPLETED โ€” starts after reboot
  • stopWithTask=false โ€” survives task swipe on MIUI
  • Background loops: sensor collection (5 min), proactive check (15 min), usage scan (daily)

LLM Configuration

Setting Value
Model Qwen2.5-1.5B Q4
File axiom_seed_q4.gguf (~900 MB)
GPU layers All (Vulkan)
n_ctx classify 150 tokens
n_ctx conversational 512 tokens
Inference time ~200ms Snapdragon mid-range

The Dream Cycle

Runs automatically when the phone is plugged in with โ‰ฅ50% battery. No time restriction.

Trigger Chain

POWER_CONNECTED broadcast
    โ””โ”€โ”€ ChargingReceiver.onReceive()
        โ””โ”€โ”€ startDreamIfEligible()  [battery โ‰ฅ 50%, 6h gap check]
            โ””โ”€โ”€ Intent(ACTION_START_DREAM) โ†’ AxiomService
                โ””โ”€โ”€ onStartCommand โ†’ maybeTriggerDream()
                    โ””โ”€โ”€ startDreamCycle()  [engineReady check]

If the engine isn't loaded yet, startDreamCycle schedules a 90-second retry. The 6-hour deduplication timestamp is written only after all guards pass โ€” a failed attempt never blocks the next one.

What Happens During a Dream

  1. SharedPrefs dream_state = "dreaming" written
  2. ACTION_DREAM_STARTED broadcast โ†’ animation starts on home screen
  3. Ongoing notification: "Axiom is dreaming..."
  4. AxiomEngine.runDreamLearning() runs on background thread
  5. axiom_events.jsonl compacted: keeps last 48h + all surprisal events, capped at 500 lines
  6. dream_summary.json written: events_before, events_after, removed, surprisal_events, adapter stats
  7. SharedPrefs dream_state = "complete", result stored
  8. ACTION_DREAM_COMPLETE broadcast โ†’ home screen shows summary stats
  9. Notification updated

The Dreaming Animation

DreamingAnimationView โ€” custom Canvas View, no OpenGL, no third-party library.

Visual: 14 cyan nodes (#00E5FF) drifting on a dark background (#080B14). Nearby nodes (within 220px) draw glowing edges that fade with distance. Each node pulses independently โ€” brightness and radius oscillate on a sine wave at its own phase. Outer glow rendered as a semi-transparent larger circle behind each node.

Performance: 25fps (FRAME_MS = 40L). Automatically pauses when view is detached from window. Battery-friendly.

When it shows:

  • Home screen โ†’ Dream Card becomes visible โ†’ animation starts
  • Triggered live by ACTION_DREAM_STARTED broadcast if app is open
  • Triggered by onResume โ†’ updateDreamCard() if app was closed during dreaming (reads SharedPrefs state)
  • Stops on ACTION_DREAM_COMPLETE, card switches to stats view

All On-Device Files

All stored in context.filesDir โ€” inaccessible to other apps without root.

File Written by Updated Purpose
axiom_seed_q4.gguf First-launch copy Once Base LLM weights (~900 MB)
axiom_adapter.bin AxiomEngine JNI Each dream cycle Personal MLP adapter (~50 KB)
axiom_events.jsonl NotifTapReceiver Every interaction Accept/reject feedback log
axiom_preds.csv UsageAnalyser Daily Intent ร— hour-of-day frequency
axiom_usage.json ChargingReceiver Daily Raw usage scan output
dream_summary.json AxiomService Each dream Results + adapter stats
dream_data.json AxiomService Each dream Surprisal events fed to learning
pending_feedback.json NotifTapReceiver When engine offline Feedback queue, replayed at boot

All SharedPreferences Keys

Prefs file Key Written by Purpose
axiom_prefs last_dream_ts AxiomService.startDreamCycle Last dream (epoch sec)
axiom_prefs last_usage_ts ChargingReceiver Last usage scan (epoch sec)
axiom_dream_ui dream_state AxiomService idle / dreaming / complete / missed
axiom_dream_ui dream_ts AxiomService Dream start timestamp (ms)
axiom_dream_ui dream_result_json AxiomService Full dream summary JSON
axiom_dream last_dream_summary AxiomService Summary for Event Viewer
axiom_insights last_insight_ts InsightEngine Last insight timestamp (ms)
axiom_insights last_insight_text InsightEngine Last insight text
axiom_mode current_mode PhoneModeManager Active mode string
axiom_mode last_switch_ts PhoneModeManager Last mode switch timestamp
axiom_mode mode_log PhoneModeManager Recent switch log
axiom_mode cancel_until_ts ModeCancelReceiver Suppress auto-mode until (epoch sec)
axiom_life_context notified_events LifeContextAssistant Notified calendar event IDs (JSON array)
axiom_profile install_ts AxiomProfileActivity First-launch timestamp (ms)
axiom_onboarding onboarding_done OnboardingActivity Boolean
axiom_milestones milestone_5/20/50/100 ContextCardEngine Interaction milestone reached (Boolean)
axiom_main on_device_moment_shown MainActivity One-time card shown (Boolean)

Permissions

Permission Reason Grant method
PACKAGE_USAGE_STATS Usage learning, Battery Doctor, Insight Engine, World Model Manual: Settings โ†’ Special App Access โ†’ Usage Access
READ_CALENDAR Calendar-aware proactive suggestions Runtime dialog
READ_CONTACTS Contact name resolution ("call Mom on WhatsApp") Runtime dialog
RECORD_AUDIO Voice input (mic button) Runtime dialog
RECEIVE_BOOT_COMPLETED Start service after reboot Granted at install
FOREGROUND_SERVICE + FOREGROUND_SERVICE_DATA_SYNC Keep service alive Granted at install
POST_NOTIFICATIONS Mode suggestions, dream results, insights Runtime (Android 13+)
REQUEST_IGNORE_BATTERY_OPTIMIZATIONS Doze whitelist deep-link (MIUI required) System settings intent
READ_MEDIA_IMAGES/VIDEO/AUDIO File search Runtime dialog
BLUETOOTH_CONNECT Bluetooth sensor input (API 31+) Runtime dialog

No INTERNET permission. Enforced at the manifest level โ€” the OS blocks all network calls.


System Health Check

Open via three-dots menu โ†’ โš• System Health. Tap Refresh to re-run all checks.

Reads on-device files and SharedPreferences directly โ€” no service binding required.

18 checks across 5 sections:

Section Checks
Core Engine LLM model file ยท AxiomEngine JNI ยท Native library
Learning Pipeline Events log ยท MLP Adapter ยท Predictions table ยท Usage scan
Dream Cycle Dream state ยท Last dream ran ยท Dream summary ยท Dream data file
Intelligence Weekly insight ยท Auto Mode ยท Life Context
App State Onboarding ยท Milestones ยท Install age ยท Free storage

Dot colours: ๐ŸŸข Green = healthy ยท ๐ŸŸก Amber = stale / not yet initialised ยท ๐Ÿ”ด Red = missing or broken ยท โšซ Grey = not applicable yet

Staleness thresholds: Events 3d ยท Adapter 7d ยท Usage scan 2d ยท Dream 3d ยท Insight 14d ยท Storage amber <500 MB, red <200 MB


MIUI / Xiaomi Notes

App launching: MIUI limits getLaunchIntentForPackage to ~18 apps. Axiom uses explicit ComponentName intents from the launcher cache, with package-only fallback.

SpeechRecognizer double-fire: MIUI fires onResults twice per utterance. Debounced on time (5 seconds) rather than text content.

Battery optimisation: Users must manually add Axiom to the battery exemption list: Settings โ†’ Battery โ†’ App Battery Saver โ†’ Axiom โ†’ No restrictions

stopWithTask=false: Declared in manifest for AxiomService. Required to survive task swipe on MIUI.


Known Limitations

PACKAGE_USAGE_STATS onboarding โ€” Biggest new-user friction point. Cannot be granted via runtime dialog. Needs a deep-link to the exact Axiom entry in Usage Access settings with a visual walkthrough. Without this, many users will never have the learning pipeline active.

Model download UX โ€” No resume on failure, no download ETA. Fix: byte-range resume + MB/s display.

LLM concurrency โ€” Three code paths (AxiomService.infer, BatteryDoctor, InsightEngine) each have independent llmBusy flags. Simultaneous calls cause a native crash. Fix: single mutex in AxiomEngine.

Context length guard โ€” Long conversational prompts silently truncate at n_ctx=512. No user warning. Fix: pre-measure token count before JNI call.

Exact alarm drift โ€” Dream alarm uses setAndAllowWhileIdle (โ‰ค15 min drift) rather than exact alarms, which require explicit permission on Android 12+. Can drift to 30+ min during deep Doze. Acceptable for overnight dreaming.


Project Structure

app/src/main/java/com/axiom/axiomnew/
โ”œโ”€โ”€ MainActivity.kt              Home screen, input, context card, world model, dream UI
โ”œโ”€โ”€ AxiomService.kt              Always-on service, inference hub, dream cycle, all sensor loops
โ”œโ”€โ”€ AxiomEngine.kt               JNI bridge to libaxiom_engine.so
โ”œโ”€โ”€ ContextCardEngine.kt         Live home screen context card generator
โ”œโ”€โ”€ InsightActivity.kt           Intelligence hub: Battery Doctor, Insight, Mode
โ”œโ”€โ”€ InsightEngine.kt             Weekly pattern analysis
โ”œโ”€โ”€ BatteryDoctor.kt             On-device battery AI diagnosis
โ”œโ”€โ”€ PhoneModeManager.kt          Auto mode detection and switching
โ”œโ”€โ”€ LifeContextAssistant.kt      Calendar-driven proactive suggestions
โ”œโ”€โ”€ UsageAnalyser.kt             PACKAGE_USAGE_STATS processing
โ”œโ”€โ”€ AppIntentRegistry.kt         100+ app profiles for smart action routing
โ”œโ”€โ”€ ContactResolver.kt           Contact name โ†’ number resolver
โ”œโ”€โ”€ DreamingAnimationView.kt     Neural constellation Canvas animation
โ”œโ”€โ”€ Dreamreceiver.kt             ChargingReceiver + DreamService constants + DreamReceiver
โ”œโ”€โ”€ HealthCheckActivity.kt       18-module system diagnostic
โ”œโ”€โ”€ AiContentDetector.kt         Human vs AI text detection
โ”œโ”€โ”€ AiDetectorActivity.kt
โ”œโ”€โ”€ FileSearchEngine.kt          On-device natural language file search
โ”œโ”€โ”€ FileSearchActivity.kt
โ”œโ”€โ”€ EventViewerActivity.kt       Debug: event log, adapter stats, dream history
โ”œโ”€โ”€ NotifTapReceiver.kt          Notification tap โ†’ accept/reject feedback
โ”œโ”€โ”€ ModeConfirmReceiver.kt       Mode suggestion confirm/skip
โ”œโ”€โ”€ ModeCancelReceiver.kt        "Never today" mode suppression
โ”œโ”€โ”€ OnboardingActivity.kt        First-launch permission + setup flow
โ”œโ”€โ”€ AxiomProfileActivity.kt      "What Axiom Knows" โ€” stats and milestones
โ””โ”€โ”€ ServiceRestartReceiver.kt    Restart guard

app/src/main/res/layout/
โ”œโ”€โ”€ activity_main.xml
โ”œโ”€โ”€ activity_insight.xml
โ”œโ”€โ”€ activity_health_check.xml
โ”œโ”€โ”€ item_health_row.xml
โ””โ”€โ”€ ...

app/src/main/assets/
โ””โ”€โ”€ axiom_seed_q4.gguf           ~900 MB, Qwen2.5-1.5B Q4

Build Notes

  • minSdk: 26 (Android 8.0) ยท targetSdk: 36
  • Namespace: com.axiom.axiomnew (set in build.gradle, not in manifest)
  • AGP 8+: package attribute removed from AndroidManifest.xml

Native library exports (JNI symbol names):

Java_com_axiom_axiomnew_AxiomEngine_initAxiomEngine
Java_com_axiom_axiomnew_AxiomEngine_infer
Java_com_axiom_axiomnew_AxiomEngine_runDreamLearning
Java_com_axiom_axiomnew_AxiomEngine_getAdapterStats
Java_com_axiom_axiomnew_AxiomEngine_feedFeedback
Java_com_axiom_axiomnew_AxiomEngine_shutdownEngine

Vulkan required for GPU inference layers. Devices without Vulkan fall back to CPU (3โ€“10ร— slower).


Privacy

  • Zero network permissions โ€” INTERNET absent from manifest. OS enforces this.
  • All weights on-device โ€” copied from assets on first launch, no download required after.
  • All learning data in filesDir โ€” inaccessible to other apps without root.
  • Adapter contains no raw data โ€” only abstract weight values. Queries are never stored in it.
  • No analytics, no crash reporting, no telemetry of any kind.
  • No account, no login, no server.

Your AI. Your device. Your world.


Package: com.axiom.axiomnew ยท AGPL-3.0

License

Axiom is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).

This means: if you use, modify, or distribute this software โ€” including running it as a network service โ€” you must release your complete source code under AGPL-3.0.

License: AGPL v3

About

ChatGPT knows everything about the world but nothing about you. Axiom knows everything about your world.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages