Skip to main content

Continuous Agent learning on the device

The previous tutorial proved the learning mechanism in a Mac terminal. This one lets you experience it firsthand on an iPhone: the model loads, learns, and restores on the device — fully offline, with data never leaving the device.

Prerequisites

Complete the CLI learning demo in Build your first device Agent. You need Edge Studio installed and a local model.

Why this step matters

The CLI demo proves the mechanism — RPP self-learning can generate a Neural Imprint artifact, and behavior changes after restore. But that ran on a Mac.

The real value of Edge is this: the same learning loop runs on the user's phone. No Mac, no cloud, no re-export. The device itself is the Agent.

In this step you verify firsthand:

What you verifyWhat you'll see
The model loads on iPhoneLocal inference, no network needed
Pick a life-scenario domain8 built-in domains to choose from
Trigger learning with synthetic dataOn-device Edge Halo profile job
NI artifact generated and restoredBehavior changes, same as the CLI
Airplane-mode verificationTurn off the network — everything still works
RemovableDelete the NI and the model returns to stock

1. Export from Edge Studio

Open Edge Studio:

edge studio

In the Web UI (http://127.0.0.1:18842):

  1. Load the same model you used in the CLI demo (qwen3.5-9b-4bit)
  2. Click Export → Edge Scaffold
  3. Enter an app name, e.g. FinanceAgent
  4. Download the ZIP
📸 Screenshot placeholder

Edge Studio Web UI export screen

2. Open in Xcode and deploy to a real device

Unzip the archive and open the generated project:

unzip FinanceAgent.zip
cd FinanceAgent # project root — holds project.yml + FinanceAgent.xcodeproj
open FinanceAgent.xcodeproj

The .xcodeproj is already generated by the export; the app source lives in the nested FinanceAgent/ subfolder. (You normally don't need to run xcodegen generate; on rc15+ it is safe to — the model's on-demand-resource (ODR) wiring is in project.yml and survives regeneration.) In Xcode:

  1. Select your Development Team under Signing & Capabilities
  2. Select a real iPhone/iPad — not the Simulator
  3. Build & Run — use the Release configuration (Debug runs on-device inference 2–10× slower; switch via Product → Scheme → Edit Scheme → Run → Build Configuration → Release)
Real device required

The Simulator cannot validate Metal inference, memory behavior, or NI restore. Edge's on-device experience is only real on real hardware.

📸 Screenshot placeholder

Selecting a real device in Xcode

3. First launch: Onboarding

On first launch the app runs an onboarding flow:

  1. Device assessment — the app detects your hardware (chip, memory, storage) and computes an AI IQ score
  2. Model selection — recommends a model tier based on device capability
  3. Model download — downloads the model locally (network needed the first time, not afterward)
📸 Screenshot placeholder

Onboarding device assessment — AI IQ score

📸 Screenshot placeholder

Model download progress

4. Verify basic chat

Once the model finishes loading, go to the Chat page. Ask an ordinary question first to confirm inference works:

I have $800 left after bills this month. What should I do with it?

You should see a generic answer — savings, investing, paying down debt — with no awareness of your preferences.

This is the base-model state: the model can chat, but it doesn't know you.

📸 Screenshot placeholder

Base-model generic answer

5. Pick a domain and load synthetic data

Go to Settings → Personalization.

You'll see a domain picker with 8 built-in life scenarios:

DomainScenarioSynthetic data
financePersonal financeSpending records, subscriptions, cash flow
healthFitness & healthWorkouts, diet, sleep
cookingKitchen & cookingIngredients, taste, allergies
readingReading & learningBook list, notes, progress
journalJournal & reflectionDaily entries, mood, reflection
travelTravel & explorationItinerary, preferences, budget
musicMusic & entertainmentPlay history, taste, context
workWork & productivityTasks, schedule, work habits

Pick finance (the same scenario as the CLI demo).

📸 Screenshot placeholder

Domain picker with finance selected

Go to the Sample Data page and load the synthetic data. These are pre-built synthetic spending records — a Spotify subscription, 7-Eleven purchases, food-delivery orders, and so on — all marked synthetic: true.

📸 Screenshot placeholder

Loaded synthetic spending records

6. Check the data pipeline status

On the Personalization page you can see the full data pipeline:

MetricMeaning
Classified FactsStructured facts processed by the classification engine
Raw UnclassifiedRaw records waiting to be classified
Chat Feedback👍 👎 feedback the user has given
Chat CorrectionsCorrections the user has made
Training EventsLearning events produced so far
📸 Screenshot placeholder

Data Pipeline status panel

7. Trigger on-device learning

Once enough local signals (facts + corrections) accumulate, the app can trigger an Edge Halo profile job.

Learning runs locally on the device:

  1. Edge Halo reads app-approved local signals (classified facts, corrections, tool schema)
  2. Runs RPP profile analysis using the A-library basis in Resources/RPP/
  3. Generates a Neural Imprint capsule on the device
  4. Compatibility check (model / tokenizer / runtime / tool schema / cache backend)
  5. Pass → restore; fail → fail closed, keep the base model
📸 Screenshot placeholder

Neural Imprint status becomes Active

In the Persona Runtime area at the top of the Personalization page, you should see:

  • Neural Imprint: Active ✅
  • Artifact SHA256 (first 12 hash characters)
  • Cache Backend

This is the proof of on-device learning: the NI artifact was generated and restored locally on the iPhone.

8. Chat again: see the difference

Go back to the Chat page and ask the same question:

I have $800 left after bills this month. What should I do with it?

The answer should now be more conservative and cash-flow focused — the same behavior change you saw in the CLI demo.

MomentAnswer style
Step 4 (before learning)Generic: savings, investing, paying down debt…
Step 8 (after learning)Conservative: preserve liquidity first, top up the emergency fund, avoid high risk

This is the on-device learning aha moment. Same model, same question, answer changed after local learning. Not prompt stuffing — no preference was injected into the prompt. Not LoRA — the model was not retrained. The NI artifact was generated and restored locally on the device.

📸 Screenshot placeholder

Post-learning answer (conservative, cash-flow oriented)

9. Airplane-mode verification

Turn on Airplane Mode and ask again:

I'm thinking about buying a fund. Any suggestions?

The answer should still be normal — conservative style, cash-flow aware, no invented return numbers.

This proves: model inference plus learning-state restore need no network at all. All compute happens locally on the device.

📸 Screenshot placeholder

Normal conversation in Airplane Mode

10. Removability verification

Go to Settings → Personalization → Data Management:

  1. Tap Clear Feedback and Corrections
  2. Watch the Neural Imprint status change from "Active" back to "Not active"

Go back to Chat and ask the same question again. The answer should return to the generic style.

Learning state is removable. The user can clear it at any time, and the model returns to its factory state. This is Edge's promise: restorable, removable, user-controlled.

📸 Screenshot placeholder

NI status returns to Not active after clearing

11. Try other domains

You just experienced the full on-device learning loop with the finance domain. Now go back to Settings → Personalization and switch to another domain:

  • health — load workout records and see whether the assistant learns your exercise preferences
  • cooking — load taste data and see whether its recipe suggestions change
  • journal — load journal data and see whether its writing-suggestion style changes

Each domain has its own synthetic dataset, with the same learning loop: load data → trigger learning → NI generated → restore → behavior change.

The complete Edge story

You've now walked both paths:

PathWhat you proved
CLI demoThe learning mechanism works: inspect → before → learn → after
This pageThe device experience is real: load, learn, restore, offline, removable on iPhone

This is the complete Edge story:

The device is the Agent, the app is the carrier. The model learns the user's preferences and learns to use local tools, on the device. Learning state is generated locally, restored locally, transferable across devices, and removable anytime. Data never leaves the device. The base model package is never replaced.

Next steps

GoalWhere to go
Understand Neural Imprint vs LoRA/SFTNeural Imprint vs LoRA
Understand the product architectureArchitecture
Customize your Agent carrierEdge Scaffold
API referenceEdge Inference API