File size: 1,558 Bytes
5e0532d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import asyncio
import os
from app.services.memory import memory_service

async def main():
    print("=== ORA Episodic Memory Verification ===")
    
    user_id = "seeker_77"
    
    # 1. Store an Episode
    print("\n1. Storing spiritual episode...")
    await memory_service.store_episode(
        user_id=user_id,
        content="We discussed the Parable of the Sower and how it applies to my current job stress.",
        insight="I realized that job stress is 'thorns' choking the word in my life right now.",
        emotion="anxious but enlightened"
    )
    
    # 2. Store another one
    print("2. Storing another episode...")
    await memory_service.store_episode(
        user_id=user_id,
        content="Deep study on Grace and works.",
        insight="Grace is not just for salvation, but daily strength.",
        emotion="peaceful"
    )
    
    # 3. Retrieve
    query = "Tell me about my growth regarding job stress"
    print(f"\n3. Retrieving episodes for: '{query}'")
    results = await memory_service.retrieve_episodes(user_id, query)
    
    print(f"   -> Found {len(results)} relevant episodes.")
    for idx, res in enumerate(results):
        print(f"   Episode {idx+1}:")
        print(f"   - Insight: {res['insight']}")
        print(f"   - Emotion: {res['emotion']}")
        print(f"   - Timestamp: {res['timestamp']}")

    if results:
        print("\n[SUCCESS] Episodic Memory is operational with LanceDB.")
    else:
        print("\n[FAIL] No episodes found.")

if __name__ == "__main__":
    asyncio.run(main())