← Hub

The Data Flywheel — AI-Enabled Attention Training

Status: Vision + roadmap, approved direction (Ian, 2026-07-04)

Owners: Ian (product, priorities) · Harsha (signal validity, data pipeline) · Fable (implementation prep) · External neuroscience advisor (methodology validation)

Relationship to other docs: extends PRODUCT_PLAN.md §6 (the EEG differentiator ladder) into an execution roadmap; inherits all guardrails from handoff/methodology-guardrails.md.


1. Why this is the moat — stated precisely

Every competitor sells an invisible effect and asks users to trust a study. Our position is the opposite: measure it, per person, and improve it per person. That position is only defensible if we systematically learn from our own data — and we are structurally the only product collecting the complete learning triplet:

Stimulus (what audio, exactly, when)Response (EEG during it)Outcome (ratings, completion, retention)
Brain.fm❌ no sensorpartial
Endelpartial
Muse❌ static contentpartial
Myndlift❌ clinician-setpartial
Second Attention✅ (after PR below)✅ raw EEG archived✅ ratings + behavior

Stimulus→response→outcome, per user, across time, is what learning systems eat. Nobody else has the triplet; each new user and session compounds it. That is the flywheel: better data → better personalization → better results → more usage → better data.

The honest-measurement brand is what makes this sellable: "tuned to your measured alpha frequency, and here's the data" is a claim no incumbent can copy without rebuilding their product around a sensor.


2. What we capture today — audit (2026-07-04, grounded in code)

Triplet componentTodayGap
Response✅ Raw EEG archived per session (msdf.tar.gz in the eeg-data bucket: raw channels + metadata.json with device, timestamps, sample counts)None material — this is the hard part and it's done
Outcome✅ Ratings (post_session_data: focus, audio experience, time-feel, notes) · completion/duration/abandonment on the session rowmeditation_rating is a crude 3-rating average — store the three raw values distinctly (kit v2 rating screen already collects them)
StimulusNothing. Only recommended_session_id (a static playlist pointer). No play/pause/seek timeline, no volume changes, no phase/entrainment parameter events, no background/foreground, no signal-quality timelineThis is the gap that matters. Sessions collected without it cannot be used for stimulus-response learning — ever. Retrofit is impossible
Alignment infra⚠️ The MSDF file format already has a timestamped event stream (offsets from recording start)… but it defines only 4 event types (blink, jaw clench, headband on/off) and appears to have no callersThe vehicle exists; it just carries nothing

Conclusion: one small PR converts every future session into training data. That PR is the "first move" and is specified in §4.


3. The roadmap — five phases, each shippable alone

Phase 1 — Log the triplet (now; rides the Vayu Flow integration PRs)

Stimulus-timeline logging (§4), raw rating values, pre-session state, consent copy (§5). Zero user-visible change; converts the entire future dataset. Owner: Fable implements, Harsha reviews.

Phase 2 — Narrated insights (the LLM layer) (with V1 launch)

An LLM narrates honestly computed metrics into the personal "Session Insight" cards already designed in UI Kit v2 ("your alpha held longer in the back half; your last three Trees sessions outperformed Oxalis"). Strict rule: the model narrates measured facts; it never generates claims. Server-side (processing repo), cached per session. This is 90% of perceived "AI-powered" at the cost of an API call. Owner: Fable; copy boundary enforced by the claims validator.

Phase 3 — Personal calibration + per-user optimization (the scientific core)

The PRODUCT_PLAN "anti-quiz," now made concrete:

Phase 4 — Cross-user priors (where the data compounds)

With calibrations from enough users: hierarchical/Bayesian mapping from cheap first-session features → good starting parameters. New users get a warm start no competitor can produce without our dataset. Also unlocks honest population insights ("users with your baseline profile respond best to…"). Batch, in second-attention-processing.

Phase 5 — Research bets (optional, later)

Fine-tune a pretrained self-supervised EEG foundation model (LaBraM-class, 2024–25 generation) for state detection (focused/drifting) on our 4-channel data — potentially beating band-ratio heuristics. And formalized n-of-1 self-experiments ("two weeks entrainment-on vs off — see your own data"), the cancellation-proof retention loop from PRODUCT_PLAN Rung 4.

Sequencing logic: each phase produces user value alone; each depends only on the previous; Phase 1 is prerequisite to everything and costs days, not weeks.


4. The first PR — stimulus-timeline logging (spec for review)

Principle: reuse the existing MSDF event stream (same clock as the EEG samples — offsets from recording start — so alignment is free) and extend metadata.json. No new infrastructure.

New event types (extend the existing EVENT_* constants in eegFileWriter.ts):

EventPayloadWhen
AUDIO_PLAY / AUDIO_PAUSE / AUDIO_SEEKposition msplayer state changes
TRACK_STARTsong ideach track begins
VOLUME_SET0–1user volume change
PHASE_CHANGEphase idDUEP phase boundaries (Vayu Flow sessions)
ENTRAINMENT_PARAMScarrier Hz, beat Hz, modulation depth, prominenceat start + every change
APP_BACKGROUND / APP_FOREGROUNDlifecycle (also relevant to the lock-screen bug domain — coordinate with Harsha's timing fixes)
SIGNAL_QUALITYper-channel qualitysampled ~every 10s

Also:

Non-goals: no on-device learning, no new servers, no schema migrations beyond JSONB contents, no changes to any signal-processing code.

Size estimate: small — the writer, the event constants, and ~8 call sites in the player. Reviewable in one sitting.


5. Guardrails — what keeps this "us"

> "Your brain activity recordings are used to measure your sessions and, over time, personalize your audio to your brain's responses. They're stored securely, never sold, and you can delete them any time in Settings."


6. Questions for the neuroscience advisor (additions to the existing call agenda)


7. Success metrics (honest ones)