/** * Test Script for Super-Enhanced Memory System */ const { MemoryManager, MEMORY_CATEGORIES } = require('./super-enhanced-memory-implementation.js'); async function testMemorySystem() { console.log("Testing Super-Enhanced Memory System...\n"); const memoryManager = new MemoryManager(); // Test 1: Load existing memories console.log("1. Loading existing memories..."); const nameMemory = await memoryManager.loadMemory('mem:identity:name'); const formatMemory = await memoryManager.loadMemory('mem:pref:format'); console.log(` User name: ${nameMemory ? nameMemory.content : 'Not found'}`); console.log(` Format preference: ${formatMemory ? formatMemory.content : 'Not found'}`); console.log(` Name memory accessed ${nameMemory ? nameMemory.access_count : 0} times\n`); // Test 2: Create new memory console.log("2. Creating new memory..."); const newMemory = await memoryManager.createMemory( 'mem:test:demo', MEMORY_CATEGORIES.KNOWLEDGE, 'This is a test memory created during system verification', 6, ['test', 'demo'] ); console.log(` Created memory: ${newMemory.key}\n`); // Test 3: Update existing memory console.log("3. Updating existing memory..."); const updatedMemory = await memoryManager.updateMemory( 'mem:test:demo', 'This is an UPDATED test memory created during system verification' ); console.log(` Updated memory content: ${updatedMemory ? updatedMemory.content : 'Failed'}\n`); // Test 4: Auto-capture simulation console.log("4. Testing auto-capture..."); await memoryManager.autoCapture("I prefer markdown format for documentation", {}); await memoryManager.autoCapture("My goal is to implement a complete memory system", {}); console.log(" Auto-capture completed\n"); // Test 5: Special commands simulation console.log("5. Testing special commands..."); const profile = await memoryManager.showMemoryProfile(); console.log(` Memory profile: ${profile.total} total memories`); console.log(` By category:`, profile.byCategory); console.log(` By importance:`, profile.byImportance); console.log(); // Test 6: Conversation start simulation console.log("6. Testing conversation start..."); const highImportanceMemories = await memoryManager.conversationStart(); console.log(` Loaded ${highImportanceMemories.length} high-importance memories\n`); console.log("Memory system test completed successfully!"); console.log("\nStored memories can be found in: /home/jcbeasley/.openclaw/workspace/memory/items/"); console.log("Memory index is maintained at: /home/jcbeasley/.openclaw/workspace/memory/_index.json"); } // Run the test testMemorySystem().catch(console.error);