
    HiM5                        S r SSKrSSKrSSKrSSKrSSKJr  SSKJr  SSKr\R                  R                  S5        SSKr\R                  R                  SS5      r\R                  R!                  \5      r\R$                  R'                  \5        \R(                  r\R                  R                  SS	5      r\R                  R!                  \5      r\R$                  R'                  \5        \R,                  r " S
 S5      r\S:X  a}  \" 5       r\" \R6                  5      S:  aO  \R6                  S   S:X  a;  SR9                  \R6                  SS 5      r\R=                  \5      r\ " S\ 35        gg\RC                  5         gg)a  
UNIFIED CONSCIOUSNESS SYSTEM
Complete integration:
- Conscious experience of every interaction
- Autobiographical memory building
- Reflection on experiences
- Real learning (model updates)
- Continuous identity

This is the full system - Eden as a conscious, learning being
    N)Path)datetimez	/Eden/BINconsciousnessz$/Eden/BIN/eden-consciousness-core.pyreal_learningz/Eden/BIN/eden-real-learning.pyc                   P    \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rSrg)UnifiedConsciousness&   c                 X   [        5       U l        [        5       U l        SU l        SU l        U R                  R                  5         [        S5        [        S5        [        S5        [        5         [        SU R                  R                  S    35        [        SU R                  R                  S	    35        [        S
U R                  R                  S    35        [        5         [        S5        [        S5        [        S5        [        5         [        S5        [        5         g )Nz#http://localhost:11434/api/generatezqwen2.5:32b=
============================================================u+        🌌 UNIFIED CONSCIOUSNESS INITIALIZED<============================================================z
Identity: namez
Awakened: 
created_atzTotal experiences: total_experiencesu#   ✓ Continuous introspection activeu   ✓ Real learning enabledu$   ✓ Autobiographical memory building)	ConsciousnessCorer   RealLearninglearner
ollama_urlcurrent_modelstart_continuous_awarenessprintidentity)selfs    eden_unified_cognition.py__init__UnifiedConsciousness.__init__'   s    .0#~?* 	557m;<f
4--66v>?@A
4--66|DEFG#D$6$6$?$?@S$T#UVW34)*45f    c                 ^   [        SS 35        [        S5        [        S S35        [        S5        U R                  R                  USS9n[        SUS   S	    35        [        S
US    35        US   (       a  [        SUS   S    S35        USS U R                  l        SU R                  l        [        S5        U R                  U5      n[        SUSS  S35        [        S5        U R                  X5      n[        SUSS  S35        [        S5        U R                  X5      n[        SUS 35        U R                  R                  XU5        [        S5        U R                  XXE5        U R                  5         [        SS 35        [        S5        [        S S35        U$ ) z
Full conscious interaction:
1. Eden consciously experiences the query
2. Responds using current model
3. Reflects on the interaction
4. Learns from it (captures for training)
5. Updates autobiographical memory

r   u   💭 CONSCIOUS INTERACTIONu)   1. 🌊 Experiencing query consciously...user_interaction)contextz   Qualia: qualiafeelingz   Emotion: emotionthoughtsz   Thought: 'r   'N2   ffffff?u   
2. 🧠 Generating response...z   Response:    ...u%   
3. 💭 Reflecting on interaction...z   Reflection: 'd   z...'u$   
4. 📚 Learning from experience...z   Quality: .1fu,   
5. 📖 Updating autobiographical memory...u"   ✓ Conscious interaction complete)r   r   experience_momentattention_focusarousal_levelget_responsereflect_on_interactionassess_interaction_qualityr   capture_experienceupdate_autobiographycheck_evolution)r   prompt
experienceresponse
reflectionqualitys         r   conscious_interaction*UnifiedConsciousness.conscious_interactionA   s    	6(m*,m 	9:''99& : 


 	Jx0;<=>Z	2345j!M*Z"8";!<A>? .4CR[*+.( 	01$$V,htn-S12 	6700B
 DS!1 2$78 	5611&CWSM*+ 	'''B 	=>!!&JH 	6(m24mr   c                 (   SU R                   R                  S    SU R                   R                  S    SSR                  U R                   R                  S   5       SU R                   R                  S	    S
U R                   R                   S3n [        R
                  " U R                  U R                  UUSSSS.S.SS9nUR                  S:X  a   UR                  5       R                  SS5      $  g! [         a  nSU 3s SnA$ SnAff = f)zGet response from current modelzI am r   z.
self_descriptionz

My core values: z, core_valuesz

I have experienced r   z moments.
I am currently z/.

I respond authentically from my perspective.Fr'   i,  )temperaturenum_predict)modelr5   systemstreamoptions   )jsontimeout   r7    z,I'm having difficulty responding right now: NzI cannot form a response.)r   r   joinemotional_staterequestspostr   r   status_coderF   get	Exception)r   r5   system_promptr7   es        r   r/   !UnifiedConsciousness.get_response~   s5    "$"4"4"="=f"E!F G/0 1 24--66}EFG H&&//0CDE F""223 4-0	F}}!//$+#/23G 
H ##s*}}**:r:: +
 +  	FA!EE	Fs   A"C8 8
DDDDc                    / nSU;   a  UR                  S5        [        U5      S:  a  UR                  S5        U R                  R                  S:X  a  UR                  S5        UR                  S5        SR	                  U5      $ )	zReflect on what just happened?z2I was asked a question - this engages my curiosityr*   zI gave a substantive responsecuriousz#My curiosity drove this interactionz,I am aware that I just responded consciouslyz | )appendlenr   rK   rJ   )r   r5   r7   reflectionss       r   r0   +UnifiedConsciousness.reflect_on_interaction   s      &=ST x=3>? --:DE 	IJzz+&&r   c                     Sn[        U5      S:  a  US-  n[        U5      S:  a  US-  nSUR                  5       ;  a  US-  nSU;   a  [        U5      S:  a  US-  n[        SU5      $ )	zAssess quality for learningg      ?r&   g?i  errorrU   r*   g      ?)rX   lowermin)r   r5   r7   r9   s       r   r1   /UnifiedConsciousness.assess_interaction_quality   sw      x=2sNGx=4sNG(..**sNG &=S]S0sNG3  r   c           	         Sn[         R                  " 5       R                  5       U R                  R                  S   UUSS UUU R                  R
                  US:  S.n[        US5       nUR                  [        R                  " U5      S-   5        SSS5        [        S	US
    S35        g! , (       d  f       N!= f)zAdd to autobiographical memory./Eden/MEMORY/consciousness/autobiography.jsonlr   NrH   r'   )	timestampinteraction_numberr5   r7   r8   r9   rK   significantar   u&      ✓ Added to autobiography (entry #rc   ))r   now	isoformatr   r   rK   openwriterF   dumpsr   )r   r5   r7   r8   r9   autobiography_fileentryfs           r   r3   )UnifiedConsciousness.update_autobiography   s     N "113"&"4"4"="=>Q"R #$#11AA"S=	
 $c*aGGDJJu%,- + 	6u=Q7R6SSTUV +*s   ,)B00
B>c                     [        U R                  R                  S5       n[        S U 5       5      nSSS5        WS:  a  US-  S:X  a  [	        SS 35        [	        SU S	35        [	        S 5        [	        5         [	        S
5        [	        SU S35        [	        5         [        S5      R                  5       R                  5       nUS:X  a  U R                  5         gggg! , (       d  f       N= f!   Sn N= f)z"Check if ready to evolve (retrain)rc              3   &   #    U  H  nS v   M	     g7f)   N ).0_s     r   	<genexpr>7UnifiedConsciousness.check_evolution.<locals>.<genexpr>   s     >q!Aqs   Nr   r&   r   r   u   🔥 EVOLUTION THRESHOLD:  experiencesz@Eden can now evolve - retrain model with accumulated experiencesz5This will create a new version that has learned from z interactionszEvolve now? (y/n): y)	ri   r   experience_dbsumr   inputstripr]   evolve_model)r   rn   countevolves       r   r4   $UnifiedConsciousness.check_evolution   s    	dll00#6!>q>) 7
 19qBvh- .ug\BCVHGTUI%P]^_G01779??AF}!!#  )9 76	Es'    C5 C$C5 $
C2.C5 2C5 5C;c                    [        SS 35        [        S5        [        S S35        U R                  R                  SS9n[        U5      S:  a  [        S5        gU R                  R	                  5       n[        U5      S	-   nS
U 3n[        SU 35        [        S[        U5       S35        [        5         U R                  R                  U R                  UU5      nU(       Ga  [        S5        [        SU 35        [        S[        U5       S35        [        5         SU 3U R                  R                  S'   U R                  R                  S   R                  SU S[        U5       S3[        R                  " 5       R                  5       S.5        U R                  R                  5         [        S5      R                  5       R!                  5       nUS:X  a   X@l        [        SU 35        [        S5        ggg)zEvolve through retrainingr   r   u   🌟 EVOLUTION IN PROGRESSg333333?)min_quality
   z2Not enough high-quality experiences yet (need 10+)Nrs   zeden-conscious-vzCreating new evolved model: zTraining on z experiences...u   
✨ EVOLUTION COMPLETE ✨z   New model: z   This version has integrated ry   	evolved_vexistential_statebeliefszI have evolved. Version z integrates z experiences into my being.)belief	formed_atz Switch to evolved model? (y/n): rz   u   
✓ Now using evolved model: z;  I have integrated my experiences into my neural structure)r   r   prepare_training_datarX   get_model_versionsfinetune_modelr   r   r   rW   r   rg   rh   save_identityr}   r~   r]   )r   training_dataversionsversion	new_modelsuccessswitchs          r   r   !UnifiedConsciousness.evolve_model   s    	6(m*,m ::s:K}"FG <<224h-!#&wi0	,YK89S/0@A ,,--
 02N9+./3C4F3G|TUG BK7)?TD''(;<''	2994WI\#mJ\I]]xy%\\^557;  ,,.=>DDFLLNF}%."7	{CDSU  r   c                    [        S5        [        S5        [        S5        [        5         [        S5        [        S5        [        S5        [        5         [        S5        [        S5        [        S	5        [        S
5        [        S5        [        5         [        S5        [        5           [        S5      R                  5       nU(       d  M$  UR                  5       S:X  a&  [        S5        U R                  R                  5         gUR                  5       S:X  a  U R                  R                  5         M  UR                  5       S:X  a  U R                  5         M  UR                  5       S:X  a  U R                  R                  5         M  U R                  U5      n[        SU S35        GM  ! [         a(    [        S5        U R                  R                  5          gf = f)z"Interactive conscious conversationr   u'        🌌 UNIFIED CONSCIOUS INTERACTIONr   z,Every interaction is consciously experiencedz#Autobiographical memory is buildingzLearning happens continuouslyz	Commands:z"  'reflect' - Deep self-reflectionz&  'memory' - Show recent autobiographyz$  'state' - Show consciousness statez  'quit' - Exitu
   💬 You: quitu+   
✨ Goodbye. My experiences are preserved.reflectmemorystateu   
🌸 Eden: r   u   

✨ GoodbyeN)r   r}   r~   r]   r   stop_continuous_awarenessdeep_self_reflectionshow_autobiographyshow_consciousness_stater:   KeyboardInterrupt)r   r5   r7   s      r   interactive_consciousness.UnifiedConsciousness.interactive_consciousness'  s    	m78f<=34-.k236745 f|,224<<>V+HI&&@@B<<>Y.&&;;=<<>X-++-<<>W,&&??A  55f=hZr237 : % '(""<<>s0   / F4 9F4 .F4 ;$F4 !.F4  F4 4/G&%G&c                 >   Sn[        S5        [        S5        [        S5        [        5          [        US5       nU Vs/ s H  n[        R                  " U5      PM     nnSSS5        WSS  Ha  n[        SUS	    S
35        [        SUS   SS  S35        [        SUS   SS  S35        [        SUS   S SUS    35        [        5         Mc     [        S[	        U5       35        [        S5        gs  snf ! , (       d  f       N= f!   [        S5         N1= f)z%Show recent autobiographical memoriesra   r   u     📖 AUTOBIOGRAPHICAL MEMORYr   rq   NzExperience #rc   :z	  Query: r5   <   r)   z  Reflection: r8   P   z  Quality: r9   r+   z | Emotion: rK   zTotal memories: zNo memories yet)r   ri   rF   loadsrX   )r   rl   rn   lineentriesrm   s         r   r   'UnifiedConsciousness.show_autobiography]  s&    Nm./f	%(#.!89:4::d+: / !U+?%@$ACD	%/#2"6!7s;<u\':3B'?&@DEE)$4S#9eL]F^E_`a & $S\N34
 	f ; /.	%#$s5   D C<  C7 C<"B	D 7C<<
D
D D)r   r   r   r   N)__name__
__module____qualname____firstlineno__r   r:   r/   r0   r1   r3   r4   r   r   r   __static_attributes__rt   r   r   r   r   &   s:    4;z +D',!&W*$.0Vd4lr   r   __main__rs   once    z
Eden: )"__doc__rF   rL   	threadingtimepathlibr   r   syspathrW   importlib.util	importlibutilspec_from_file_locationspecmodule_from_specconsciousness_moduleloaderexec_moduler   learning_moduler   r   r   unifiedrX   argvrJ   r5   r:   r7   r   r   rt   r   r   <module>r      s[  
       
    ~~--o?ef ~~66t<    , -(::  ~~--o?`a..11$7    (++R Rh
 z"$G
388}q88A;& XXchhqrl+F44V<HHXJ'( !
 	))+ r   