Spaces:
Sleeping
Sleeping
| 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()) | |