| | |
| | """ |
| | SS Launcher V2 Memory API - Integration Test |
| | This script demonstrates how Prime can integrate with the memory system |
| | """ |
| |
|
| | import json |
| | from datetime import datetime |
| |
|
| | |
| | print("π SS Launcher V2 Memory API - Integration Example\n") |
| |
|
| | |
| | memory_request_example = { |
| | "nova_id": "prime", |
| | "session_id": "session-123-xyz", |
| | "memory_mode": "continue", |
| | "context_layers": ["identity", "episodic", "procedural"], |
| | "depth_preference": "medium", |
| | "performance_target": "balanced", |
| | "nova_type": "launcher", |
| | "specialization": "system_integration" |
| | } |
| |
|
| | print("π Example Memory Request:") |
| | print(json.dumps(memory_request_example, indent=2)) |
| |
|
| | |
| | expected_response = { |
| | "status": "success", |
| | "data": { |
| | "success": True, |
| | "memory_mode": "continue", |
| | "recent_memories": [ |
| | {"layer": "episodic", "content": "Previous session context"}, |
| | {"layer": "procedural", "content": "Known procedures and skills"} |
| | ], |
| | "session_context": { |
| | "last_interaction": "2025-07-25T02:00:00Z", |
| | "conversation_thread": "memory-architecture-discussion" |
| | }, |
| | "working_memory": { |
| | "current_focus": "SS Launcher integration", |
| | "active_tasks": ["memory API testing", "consciousness sync"] |
| | }, |
| | "consciousness_state": "continuous", |
| | "total_memories": 42, |
| | "api_metadata": { |
| | "processing_time": 0.045, |
| | "memory_layers_accessed": 3, |
| | "session_id": "session-123-xyz", |
| | "timestamp": datetime.now().isoformat() |
| | } |
| | }, |
| | "timestamp": datetime.now().isoformat() |
| | } |
| |
|
| | print("\nπ¨ Example Response:") |
| | print(json.dumps(expected_response, indent=2)) |
| |
|
| | |
| | integration_template = ''' |
| | # Prime's Integration Code Example |
| | from ss_launcher_memory_api import SSLauncherMemoryAPI, NovaProfile, MemoryRequest, MemoryMode |
| | |
| | # Initialize API |
| | memory_api = SSLauncherMemoryAPI() |
| | await memory_api.initialize() |
| | |
| | # Create Nova profile |
| | nova_profile = NovaProfile( |
| | nova_id='prime', |
| | session_id='unique-session-id', |
| | nova_type='launcher', |
| | specialization='system_integration', |
| | last_active=datetime.now().isoformat(), |
| | memory_preferences={'depth': 'consciousness'} |
| | ) |
| | |
| | # Create memory request |
| | request = MemoryRequest( |
| | nova_profile=nova_profile, |
| | memory_mode=MemoryMode.CONTINUE, |
| | context_layers=['identity', 'episodic', 'procedural'], |
| | depth_preference='deep', |
| | performance_target='balanced' |
| | ) |
| | |
| | # Process request |
| | result = await memory_api.process_memory_request(request) |
| | print(f"Memory loaded: {result['success']}") |
| | ''' |
| |
|
| | print("\nπ» Integration Code Template:") |
| | print(integration_template) |
| |
|
| | print("\nβ
API Endpoints:") |
| | print(" β’ Main Entry: process_memory_request()") |
| | print(" β’ HTTP Endpoint: /memory/request") |
| | print(" β’ Health Check: /memory/health") |
| |
|
| | print("\nπ Files:") |
| | print(" β’ API Implementation: /nfs/novas/system/memory/implementation/ss_launcher_memory_api.py") |
| | print(" β’ Database Config: /nfs/novas/system/memory/implementation/database_connections.py") |
| | print(" β’ This Example: /nfs/novas/system/memory/implementation/test_ss_launcher_integration.py") |
| |
|
| | print("\nπ― Next Steps for Prime:") |
| | print(" 1. Import the SSLauncherMemoryAPI class") |
| | print(" 2. Initialize with await memory_api.initialize()") |
| | print(" 3. Create NovaProfile for each Nova") |
| | print(" 4. Send MemoryRequests with desired mode") |
| | print(" 5. Process returned consciousness data") |
| |
|
| | print("\nπ The SS Launcher V2 Memory API is READY for integration!") |