Skip to main content

07 · AI SYSTEM

ML architecture · Training pipeline · AI Coach · AI Wallet Agent · AI Insurance Agent · Predictive analytics

⚠️ AI Yield Engine optimizes allocation but does not guarantee returns. Target Yield depends on DeFi market conditions.


1. Overview

The Wellex AI system consists of five interconnected components united by the Lazy Factor principle: the user does the minimum — AI handles everything else.

#ComponentPurposeDeployment
1AI CoachWellness recommendations (video / audio / text)On-device + Cloud
2AI Wallet AgentAuto-compound, rebalancing, 800+ ML strategies, risk managementCloud (server-side)
3AI Insurance AgentRisk assessment, personalized insurance recommendationsCloud
4AI Dashboard AgentsPromotion, content, analytics, mentoringCloud
5Predictive Analytics EngineHealth, churn, and income forecastingCloud

2. AI Coach

2.1 Pipeline Architecture

Wellex Band → BLE → Raw Biometrics

Feature Engine (on-device)
HRV, sleep stages, activity, emotions, stress index

Context Builder
WVI, 7-day trend, weak spots, time of day,
user profile, recommendation history

Fine-tuned LLM
Llama 3.1 8B (on-device) / GPT-4o (cloud, complex queries)

Output: 🎥 Video · 🎧 Audio · 📝 Text + Personalized action plan

2.2 ML Models

ModelArchitectureInputOutputAccuracy
Emotion ClassifierXGBoost ensembleHRV + EDA (12 features)11 emotions + confidence78.2% (11-class)
Sleep Staging1D-CNN + BiLSTMPPG + Accel (30 s epochs)Wake / N1 / N2 / N3 / REMκ = 0.72
Activity ClassifierLightGBMAccel + Gyro + HR12 workout types91.3%
Stress PredictorLSTM (seq2seq)HRV time series (5 min)Stress score + 1 h forecastMAE = 6.2
Recommendation LLMFine-tuned Llama 3.1 8BContext vector + user profileText recommendationHuman eval: 4.3/5
Content GeneratorGPT-4o (API)Recommendation + formatVideo script / audio textHuman eval: 4.5/5

2.3 Training Pipeline

1. Data collection
├── WESAD (PPG + EDA, N = 15)
├── AMIGOS (multimodal, N = 40)
├── Sleep-EDF (PSG-verified, N = 197)
├── Wellex proprietary (N = 3,200+)
└── Continuous collection from users (opt-in)

2. Preprocessing
├── Artifact removal (PPG motion artifacts)
├── Bandpass filtering (0.5–40 Hz for PPG)
├── RR interval extraction (Pan-Tompkins)
├── Feature extraction (time + frequency domain)
└── Normalization (per-user z-score)

3. Training
├── 80/10/10 split (train / val / test)
├── 5-fold cross-validation
├── Hyperparameter tuning (Optuna)
├── Class balancing (SMOTE + class weights)
└── Early stopping (patience = 10)

4. Validation
├── Hold-out test set
├── Cross-dataset validation
├── A/B testing of recommendations
└── Expert review (clinical advisory board)

5. Deployment
├── ONNX export → CoreML / TFLite
├── On-device inference (< 50 ms)
├── Cloud fallback for complex queries
├── Model versioning (MLflow)
└── Gradual rollout (5% → 25% → 100%)

6. Continuous learning
├── Federated learning (no raw data transfer)
├── Monthly retraining
├── Drift detection (PSI > 0.2 → retrain)
└── User feedback loop

2.4 Personalized Recommendations

TypeTriggerExampleFormat
MorningEvery morning"Recovery 74. Good day for moderate load"Push + Text
PreventiveHRV drop > 15%"Stress rising — 4-7-8 breathing for 5 min"Push + Video
Sleep correctionSleep < 6 h"Sleep 5 h 20 min last night — go to bed by 22:30"Push + Text
MotivationWVI near yield threshold"Next Monthly Yield level +8 WVI! A walk will help"Push + Audio
Evening21:00–22:00"Avoid coffee and screens after 22:00, fall asleep by 23:00"Push + Text
WeeklySundayVideo report: trends, achievements, plan for the weekVideo (3 min)
MilestoneStreak / level up"30-day streak! Monthly Yield bonus +0.5%"Push + Animation

Personalization factors: age, gender, fitness level, chronotype, recommendation history (no repeats), effectiveness of past advice (CTR, follow-through rate), preferred format (video / text).

2.5 AI Coach Pricing

Pricing tierCostCapabilities
Basic$0/moBasic text recommendations, WVI
Wellex Subscription$19/moFull AI Coach: video / audio, detailed analytics, free band

3. AI Wallet Agent

3.1 Architecture

Data sources
├── The Graph (protocol TVL, Monthly Yield)
├── DeFiLlama API (cross-protocol)
├── Chainlink (price feeds)
└── Internal analytics (user behavior)

Gauntlet-style simulation · 10,000 scenarios per decision

Decision Engine (PPO agent)
State: market conditions + portfolio
Action: rebalancing / compound
Reward: risk-adjusted return

TX Builder
Ethers.js + Tenderly Simulation → Gelato Keeper execution

3.2 Autonomous AI Actions

ActionConditionExample
Auto-compound yieldWhen activated ($129)Reinvest yield → WellexVault
Reward harvestingAlwaysCRV, COMP → convert to USDC → vault
DeFi allocation rebalancingDeviation > 5% from targetLending/AMM/RWA → rebalance to optimal
Cross-chain transferYield differential > 2%Move USDC liquidity from BSC to Ethereum via LayerZero
Gas optimizationAlwaysBatching UserOps, low-gas windows
Emergency withdrawalDepeg > 2%, exploit detectedInstant withdrawal to stablecoins

3.3 Actions Requiring User Confirmation

ActionReason
Withdrawal to external addressSecurity
Strategy changeRisk profile change
Allocation outside whitelistSmart contract risk
Operations > 25% of portfolio in 24 hProtection from large moves

3.4 AI Wallet Agent Allocation (Unified WellexVault)

The AI Wallet Agent manages a single WellexVault (ERC-4626). Manual strategy selection by the user is not available — AI automatically optimizes DeFi allocation distribution based on market conditions and the user's WVI.

DeFi categoryAllocation targetProtocols
Lending35–55%Aave v3, Compound III, Morpho
AMM fees / LP10–20%Uniswap v3, Curve
RWA / Treasuries10–25%Ondo USDY, Mountain USDM
Liquidity incentives5–15%CRV/CVX incentives, LM programs
Rate/basis arbitrage0–10%Funding/basis, cross-protocol spreads
Structured strategies0–15%Delta-neutral, covered/hedged structures
Cash buffer5–10%USDC — for gas and rebalancing

Auto AI principles:

  • Allocation reviewed daily (response to market conditions)
  • High WVI (≥70) → AI allows more complex strategies (higher expected yield)
  • Low WVI (<40) → AI reduces incentives/structured share → conservative allocation
  • Tenderly simulation of each transaction before execution

Expected Monthly Yield (from WellexVault) is strictly determined by the user's WVI per the unified table in REBUILD_PLAN.md. Actual yield depends on DeFi market conditions.


4. AI Insurance Agent

4.1 Concept

The AI Insurance Agent analyzes biometric data and the user's financial profile to generate personalized insurance recommendations.

4.2 Architecture

Input data:
├── WVI history (30 / 90 / 365 days)
├── Biometric trends (HRV, sleep, activity)
├── Age, gender, BMI, lifestyle factors
├── Deposit and yield history
└── Regional factors (healthcare costs)

Risk Scoring Engine
Actuarial model + ML (Gradient Boosting / XGBoost)
Trained on insurance datasets

Outputs:
├── Personal Health Risk Score (0–100)
├── Recommended insurance type and coverage
├── Premium calculation (insurance partners)
├── Preventive recommendations (premium reduction)
└── "Saved $X thanks to your WVI"

4.3 Functions

FunctionDescription
Health Risk ScoreML risk assessment based on 90+ days of biometrics
Coverage RecommendationsInsurance type and coverage based on user profile
Premium Optimization"Your WVI 80 → 15% discount with partner X"
Preventive Actions"Add 1 h of sleep → 8% risk score reduction"
Claims AssistantAI assistance with insurance claim filing
Partner MarketplaceOffers from partner insurance companies

4.4 Monetization

SourceRate
Commission from insurance partners5–15% of insurance premium
Lead generation$20–50 per qualified lead
Detailed Health Risk ReportIncluded in $19/mo subscription

5. AI Dashboard Agents

5.1 "Promotion" Agent

FunctionDescription
ReactivationDetect inactive partners → personalized scripts
Audience analysisPartner profile → channel acquisition recommendations
Forecasting"+3 referrals/mo → Master rank in 6 mo, income ~$1,700"
Weekly planStep-by-step action plan with priorities

5.2 "Content" Agent

FunctionDescription
Post generationInstagram, Telegram, Facebook — by prompt or automatically
Video scriptsScripts for Reels, TikTok, YouTube Shorts
StoriesReady visuals + text
Prompting trainingHelp crafting effective prompts

5.3 "Analytics" Agent (Guardian+)

FunctionDescription
FunnelInvitations → Registrations → Active → Paying
Bottlenecks"80% drop-off at band connection — help the team"
Cohort analysisRetention by acquisition month

5.4 "Mentoring" Agent (Master+)

FunctionDescription
Team trainingWebinar templates, call scripts
Delegation"@user1 ready for Guardian rank — help close 3 referrals"
Team WVIRecommendations for growing team average WVI

6. Predictive Analytics Engine

6.1 Models

ModelTaskArchitectureHorizonMetric
WVI Forecast7/30-day WVI forecastLSTM (seq2seq)7–30 daysMAE = 4.1
Churn PredictorChurn probabilityGradient Boosting30 daysAUC = 0.87
Monthly Yield OptimizerOptimal strategyRL (PPO)Real-timeSharpe > 1.8
Health AlertEarly warning of issuesAnomaly detection (Isolation Forest)24–72 hPrecision = 0.82
Revenue ForecastMRR / ARR forecastProphet + XGBoost3–12 moMAPE = 8%
Network GrowthPartner network growthGraph Neural Network1–6 moMAE = 12%

6.2 Predictive Insight Examples

For the user:

  • "HRV has been declining for three days. 72% probability WVI will drop below 60 tomorrow. Recommendation: walk + sleep by 22:00"
  • "At current trajectory, March Monthly Yield will be 14.2%. For 16% you need +4 to average WVI"

For the administrator:

  • "February cohort: 30d retention = 78%, 90d forecast = 62%. Bottleneck: 23% did not connect the band"
  • "Q2 TVL forecast: $8.2M (+95% vs current). Risk in market correction: $5.1M"

7. Technology Stack

ComponentTechnologyPurpose
On-device LLMLlama 3.1 8B (ONNX → CoreML / TFLite)Wellness recommendations (< 50 ms)
Cloud LLMGPT-4o / Claude APIComplex queries, content generation
ML FrameworkPyTorch 2.x + LightningModel training
ML ServingONNX Runtime (device), TorchServe (cloud)Inference
Experiment TrackingMLflow + Weights & BiasesMetrics, artifacts
Hyperparameter TuningOptunaAutomated HPO
Feature StoreFeast (on Redis)Real-time + batch features
Data PipelineApache AirflowETL, retraining schedules
Vector DBQdrantSimilarity search for recommendations
RL EnvironmentGymnasium + Stable Baselines3Wallet Agent training
Market DataThe Graph + DeFiLlama APIMonthly Yield, TVL, utilization
TX BuilderEthers.js + Tenderly SimulationTransaction building and verification
KeeperGelato Web3 FunctionsOn-chain execution
MonitoringForta + custom alertsAnomaly detection
NotificationsFirebase + Telegram Bot APIPush notifications

8. AI Security

Three-Layer Protection

Layer 1 — Smart Contract Limits (on-chain)

  • Protocol whitelist (updates via governance)
  • Maximum transaction size per action
  • Daily volume limit (25% of portfolio)
  • Emergency pause (multisig 2-of-3)
  • Rate limits (5% TVL/h)

Layer 2 — AI Guardrails (off-chain)

  • Risk assessment for each transaction (1–100 scale)
  • Anomaly detection (Isolation Forest)
  • Tenderly simulation before execution
  • Auto-reject when risk score > 70 without user confirmation
  • Human-in-the-loop for operations > $50,000

Layer 3 — User Controls

  • Instant AI pause (Pause Agent)
  • Override any AI decision
  • User-defined limits (max per tx, daily cap)
  • Full manual mode (AI disabled)
  • Activity log (all AI actions are transparent)

9. Data Privacy

PrincipleImplementation
On-device firstBasic inference on device; raw data never leaves the phone
E2E encryptionBiometrics encrypted with AES-256 before cloud upload
Federated learningModels improve without transferring raw data to server
Data minimizationServer receives only WVI score + aggregated features
User controlExport / delete all data (GDPR Art. 17)
AnonymizationResearch uses only de-identified data

→ Related documents: 04_APP_UX.md (AI assistant screen) · 05_DASHBOARD.md (AI Dashboard Agents) · 06_YIELD_PROTOCOL.md (yield mechanics) · 08_HARDWARE.md (band data)

Wellex © 2026 · Confidential