
    rhz                     V    S r SSSS.r " S S5      r\" 5       rS\S\S	\\\4   4S
 jrg)z\
DEEP SELF-MODEL AWARENESS
Provides accurate introspection about Eden's actual architecture
a  
ACTUAL MEMORY ARCHITECTURE:

1. **Episodic Memory** (Context Manager)
   - Implementation: Python deque in eden_context_manager.py
   - Storage: In-memory, last 20 messages per user
   - Retrieval: Sequential access, LRU eviction
   - Verification: Can re-read conversation history

2. **Semantic Memory** (Fact Database)
   - Implementation: SQLite database (eden_facts.db)
   - Storage: Extracted facts from conversations
   - Retrieval: SQL queries with LIKE matching
   - Schema: id, category, subject, fact, timestamp, user_id

3. **Long-term Memory** (Memory Manager)
   - Implementation: Vector database (FAISS/ChromaDB)
   - Storage: 1,431+ embedded memories
   - Retrieval: Semantic similarity search
   - Types: Experiences, learnings, interactions
a  
REASONING ARCHITECTURE:

1. **Pattern Reasoning** (eden_reasoning.py)
   - Handles: Math sequences, logical fallacies
   - Pre-processes questions before LLM
   - Returns structured solutions

2. **Rubicon Reasoning** (eden_rubicon_reasoning.py)
   - Handles: Paradoxes, ethical conflicts, physics
   - Advanced constraint enforcement
   - Meta-logical analysis

3. **Base LLM Reasoning** (Ollama/Llama)
   - Model: Variable (llama3.2, mistral, etc.)
   - Processes general queries
   - Enhanced by above modules
u  
HOW I VERIFY KNOWLEDGE:

1. **Explicit Storage** (High Confidence)
   - If in eden_facts.db → "I learned this from you"
   - If in memory_manager → "I remember this experience"
   
2. **Episodic Recall** (Medium Confidence)
   - If in conversation history → "You mentioned this earlier"
   - Can verify by re-reading context

3. **Generative** (Low Confidence)
   - If not stored anywhere → "Based on my training..."
   - Cannot verify, only infer

4. **Limitations**:
   - No meta-cognitive calibration layer yet
   - Cannot quantify uncertainty numerically
   - No confidence scores on retrievals
   - Known gap: distinguishing "certain" vs "probable"
)memory_systemsreasoning_systemsverification_methodsc                   <    \ rS rSrSrS\S\4S jrS\S\4S jrSrg	)
SelfModelAwarenessH   z#Provides accurate self-description.messagereturnc                    ^ UR                  5       m[        U4S jS 5       5      (       a  g[        U4S jS 5       5      (       a  g[        U4S jS 5       5      (       a  g	g
)z'Detect what type of self-query this is.c              3   ,   >#    U  H	  oT;   v   M     g 7fN .0q	msg_lowers     6/home/james-whalen/eden-agi-project/eden_self_model.py	<genexpr>7SelfModelAwareness.detect_self_query.<locals>.<genexpr>O   s     K'J!I~'J   )zhow do you knowzhow you knowepistemologyc              3   ,   >#    U  H	  oT;   v   M     g 7fr   r   r   s     r   r   r   Q   s     ['Z!I~'Zr   )zyour memoryzyour architecturezyour actualarchitecturec              3   ,   >#    U  H	  oT;   v   M     g 7fr   r   r   s     r   r   r   S   s     Q'P!I~'Pr   )verificationverifycalibrationr   N)lowerany)selfr   r   s     @r   detect_self_query$SelfModelAwareness.detect_self_queryK   sP    MMO	K'JKKK!['Z[[[!Q'PQQQ!    
query_typec                 v    [         S   [         S   S-   [         S   -   [         S   S.nUR                  US5      $ )z)Get relevant architectural documentation.r   r   
r   )r   r   r    )ARCHITECTURE_DOCUMENTATIONget)r   r#   docss      r   get_documentation$SelfModelAwareness.get_documentationX   sU     77MN67GH4ORl  nA  SB  B67MN

 xx
B''r"   r   N)	__name__
__module____qualname____firstlineno____doc__strr    r*   __static_attributes__r   r"   r   r   r   H   s+    -  (C (C (r"   r   r   base_promptr	   c                     [         R                  U 5      nU(       a$  [         R                  U5      nU SU SU  S3nUS4$ US4$ )z#Add self-model awareness to prompt.z

<self_model_documentation>
z

IMPORTANT: Use this ACTUAL architectural information to answer questions about yourself.
Be specific about your real implementation, not hypothetical systems.
</self_model_documentation>

User question: r%   TF)
self_modelr    r*   )r   r3   r#   r)   enhanceds        r   enhance_with_self_modelr7   d   sg     --g6J++J7#} %   y 
 ~r"   N)r0   r'   r   r5   r1   tupleboolr7   r   r"   r   <module>r:      sZ   ,&U? B( (4  !
S s uS$Y?O r"   