Admin Settings
Export User Data to Persona JSON
Runs scripts/generate_personas.js — maps each user's CSV data into the persona schema, classifies every food item via scripts/food_taxonomy.js, and writes one JSON per user to advancedAnalysis/persona_data/. Runs automatically every night at 01:00 Pacific; you can also trigger it manually below.
Scheduled export history (click to expand)
Taxonomy & Mapping Reference
How user entries are transformed into the JSON consumed by analyze_personas.m, and how the tree of food classifications is built.
Food classification tree hierarchy
food (e.g. "chicken vindaloo with rice")
└── ingredient[] (e.g. chicken, basmati_rice, tomato, yogurt, spices)
├── macros ← USDA FoodData Central (protein, carbs, fat, fiber, calories, sodium)
├── allergens ← Big-9 keyword match + LLM verify (milk, egg, fish, shellfish,
│ tree_nuts, peanuts, wheat, soy, sesame)
├── crd ← LLM-suggested component-resolved markers (Ara h 2, Gal d 1,
│ Bet v 1, …). Always tagged unverified — clinical reference
│ only with allergist verification.
└── biochem ← LLM qualitative summary + compound list
(proteins, lipids, carbs, phytochemicals)
How app entries map to persona_<user>.json
| App source | Persona JSON path | Transformation |
|---|---|---|
| profile_<u>.json (sex, birthday) | demographics.{gender, age} | age computed from birthday |
| profile_<u>.json (primaryConcern) | health_profile.primary_concern | verbatim |
| entries_<u>.csv (symptom rows) | diary[].symptoms[] | filter "no symptoms"; name + severity |
| entries_<u>.csv (activity rows) | diary[].activities[] | name + duration_min (regex extract) |
| entries_<u>.csv (food rows) | diary[].meals[].{foods, ingredients, classifications} | grouped into meal slot by time; LLM parse; food_taxonomy classifyFood |
| entries_<u>.csv (medication rows) | diary[].medications[] | name + time + dose (regex) |
| sleep_<u>.csv | diary[].sleep | duration_hours + quality (rested → 1–4) |
| symptom entries mentioning "anxious/anxiety" | diary[].anxiety | 0–3; severity of first matching entry |
Difference from persona_data/staticCaricatures/
staticCaricatures are hand-authored archetype personas (alcoholicMan, weightLifter, holisticYoga, schizophrenia, unhousedMan, alcoholicWoman). They represent fixed reference points in the reduced-dimension space so real users can be visually compared against pattern extremes.
- Source: static JSON files committed to the repo — not generated from user CSVs.
- Food entries: often synthetic / illustrative. They typically ship with pre-filled ingredient lists but no
classificationstree fromfood_taxonomy.js, because they were authored before that classifier existed. - In the analysis: loaded as caricatures (
is_caricature = true); rendered as diamond markers in the Progression plot. - Identity: real users are
persona_<username>.json; caricatures arestaticCaricature_<label>.jsoninside thestaticCaricaturessubfolder.
Handling mapping discrepancies
- Missing food classification on a caricature: ingredient-level features (macros, allergens) fall back to zero/absent. The caricature still contributes to the reduced-dimension space via activities/sleep/symptoms; food-derived features will show as gaps.
- Field missing on real user: any per-day field missing (no sleep logged, no symptoms logged) is written as
null/empty so downstream code can decide — never silently zeroed. - LLM classifier failure: a failed
classifyFoodcall is logged and the food is still written intomeals[].foodswithout aclassificationsentry. The cache is saved after every meal slot so partial progress survives a crash. - Big-9 false-negatives: keyword matcher is conservative; LLM verify can add hidden allergens (e.g. mayonnaise → egg). Both sets are stored (
keyword_hits,llm_hits) so you can audit which rule fired. - CRD: every LLM-sourced CRD marker carries
unverified: trueand a disclaimer. Do not use for clinical decisions. - Objective: analyze_personas can compute correlations at multiple granularities — individual food (
chicken_vindaloo), individual ingredient (tomato), allergen class (peanuts), macro bin (high-protein), or biochem compound (capsaicin) — so symptom-trigger relationships that only appear at an abstract level become detectable.
Advanced Analysis
Run analyze_personas against a user's exported persona JSON. Export the user data first using the section above, then configure and run the analysis below.