diff --git a/app.js b/app.js index 5249187..fb8dbaf 100644 --- a/app.js +++ b/app.js @@ -2124,6 +2124,18 @@ function saveSession() { html: el.innerHTML, className: el.className })); + + // Store in MemPalace + if (window.mempalace) { + mempalace.add_drawer('chat_history', { + content: JSON.stringify(msgs), + metadata: { + type: 'chat', + timestamp: Date.now() + } + }); + } + localStorage.setItem('nexus_chat_history', JSON.stringify(msgs)); } @@ -2148,6 +2160,17 @@ function addChatMessage(agent, text, shouldSave = true) { const div = document.createElement('div'); div.className = `chat-msg chat-msg-${agent}`; + // Store in MemPalace + if (window.mempalace) { + mempalace.add_drawer('chat_history', { + content: text, + metadata: { + agent, + timestamp: Date.now() + } + }); + } + // Store in MemPalace if (agent !== 'system') { // In a real implementation, we'd use mempalace.add_drawer() diff --git a/index.html b/index.html index e96b630..2fc3a89 100644 --- a/index.html +++ b/index.html @@ -309,6 +309,11 @@