""" longitudinal_demo.py — demo longitudinal 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: startup-lead demo profile self.person = SimPerson( name="Jordan", openness=0.4, conscientiousness=0.9, extraversion=0.7, agreeableness=0.25, neuroticism=0.8 ) def pre_seed_arjun(self): """Pre-seeds demo 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=0.68, metrics_diff_str="romantic:+10.0, stress_level:-5.0", reasoning="This profile responds better to upfront communication about work delays than reactive apologies." ) # Memory from a general work win self.memory.store_trajectory( conflict_title="Project Overload", route_taken="negotiate(career) -> delegate(career)", total_reward=0.75, metrics_diff_str="workload:-20.0, stress_level:-15.0", reasoning="For startup executives, aggressive negotiation of deliverables works better than resting alone, which leaves work pending." ) def show_longitudinal_comparison(self) -> str: """Returns the HTML for the longitudinal journey tab.""" return """