""" longitudinal_demo.py — Arjun's journey from baseline to expert agent support. """ import sys, os; sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from agent.memory import LifeStackMemory from core.life_state import LifeMetrics from intake.simperson import SimPerson class LongitudinalDemo: def __init__(self): self.memory = LifeStackMemory(silent=True) # Pre-loaded persona: 'Arjun' (high conscientiousness, high workload executive) self.person = SimPerson( name="Arjun", openness=0.4, conscientiousness=0.9, extraversion=0.7, agreeableness=0.25, neuroticism=0.8 ) def pre_seed_arjun(self): """Pre-seeds Arjun's high-reward precedents into ChromaDB.""" # Note: Session 1 (0.41) isn't stored as it's below the 0.5 reward threshold # defined in memory.py, which is correct (we only learn from SUCCESS). # Memory from Week 2 (Relationship success) self.memory.store_trajectory( conflict_title="Partner upset about dinner", route_taken="communicate(relationships)", total_reward=2.68, metrics_diff_str="romantic:+10.0, stress_level:-5.0", reasoning="Arjun's partner needs upfront communication about work delays, not just apologies later." ) # Memory from a general work win self.memory.store_trajectory( conflict_title="Project Overload", route_taken="negotiate(career) -> delegate(career)", total_reward=2.75, metrics_diff_str="workload:-20.0, stress_level:-15.0", reasoning="For startup executives like Arjun, aggressive negotiation of deliverables works better than just 'resting' which leaves work pending." ) def show_longitudinal_comparison(self) -> str: """Returns the HTML for the Arjun's Journey tab.""" return """