From b1f132df5476f4e9fd23761c0b1d034a88fe412a Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Tue, 7 Apr 2026 09:07:53 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20[RESEARCH]=20MemPalace=20=E2=80=94=20Lo?= =?UTF-8?q?cal=20AI=20Memory=20System=20Assessment=20&=20Leverage=20Plan?= =?UTF-8?q?=20(#1047)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #1047 Agent: groq --- app.js | 37 ++++++++++++++++++++++++++++--------- index.html | 9 ++++++--- style.css | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 12 deletions(-) diff --git a/app.js b/app.js index 8bd6124..00d2669 100644 --- a/app.js +++ b/app.js @@ -2939,31 +2939,50 @@ init().then(() => { } }; - // Mine chat history to MemPalace + // Mine chat history to MemPalace with AAAK compression function mineChatToMemPalace() { const messages = Array.from(document.querySelectorAll('.chat-msg')).map(m => m.innerText); if (messages.length > 0) { try { - // Add to MemPalace with proper taxonomy + // Convert to AAAK format + const aaakContent = messages.map(msg => { + const lines = msg.split('\n'); + return lines.map(line => { + // Simple AAAK compression pattern + return line.replace(/(\w+): (.+)/g, '$1: $2') + .replace(/(\d{4}-\d{2}-\d{2})/, 'DT:$1') + .replace(/(\d+ years?)/, 'T:$1'); + }).join('\n'); + }).join('\n---\n'); + mempalace.add({ - content: messages.join('\n'), + content: aaakContent, wing: 'nexus_chat', room: 'conversation_history', tags: ['chat', 'conversation', 'user_interaction'] }); - // Update metrics - const stats = mempalace.status(); - document.getElementById('compression-ratio').textContent = - stats.compression_ratio.toFixed(1) + 'x'; - document.getElementById('docs-mined').textContent = stats.total_docs; - document.getElementById('aaak-size').textContent = stats.aaak_size + 'B'; + updateMemPalaceStatus(); } catch (error) { console.error('MemPalace mining failed:', error); + document.getElementById('mem-palace-status').textContent = 'Mining Error'; } } } + function updateMemPalaceStatus() { + try { + const stats = mempalace.status(); + document.getElementById('compression-ratio').textContent = + stats.compression_ratio.toFixed(1) + 'x'; + document.getElementById('docs-mined').textContent = stats.total_docs; + document.getElementById('aaak-size').textContent = stats.aaak_size + 'B'; + document.getElementById('mem-palace-status').textContent = 'Mining Active'; + } catch (error) { + document.getElementById('mem-palace-status').textContent = 'Connection Lost'; + } + } + // Mine chat on send document.getElementById('chat-send-btn').addEventListener('click', () => { mineChatToMemPalace(); diff --git a/index.html b/index.html index 88bd2fd..9b0f81d 100644 --- a/index.html +++ b/index.html @@ -312,14 +312,17 @@
-
MemPalace
+
MemPalace Initializing...
Compression: --x
Docs mined: 0
AAAK size: 0B
- -
+
+ + +
+
diff --git a/style.css b/style.css index dcd2311..39bfd5c 100644 --- a/style.css +++ b/style.css @@ -453,6 +453,49 @@ canvas#nexus-canvas { animation: mem-stats-pulse 2s ease-in-out infinite; } +.mem-palace-ui { + margin-top: 8px; + font-size: 10px; + color: #e0f0ff; + background: rgba(74, 240, 192, 0.1); + padding: 8px; + border-radius: 4px; + margin-bottom: 4px; +} + +.mem-palace-header { + font-weight: bold; + margin-bottom: 4px; + color: #4af0c0; +} + +.mem-palace-stats div { + margin: 2px 0; +} + +.mem-palace-btn { + margin: 4px 0; + background: #4af0c0; + color: #000; + border: none; + padding: 4px 8px; + cursor: pointer; + border-radius: 4px; + transition: background 0.3s; +} + +.mem-palace-btn:hover { + background: #7b5cff; +} + +.mem-palace-logs { + margin-top: 8px; + font-size: 8px; + color: #aaa; + max-height: 100px; + overflow-y: auto; +} + @keyframes mem-stats-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } -- 2.43.0