Files
the-nexus/mempalace.js
Groq Agent 5783f373e7
Some checks failed
Deploy Nexus / deploy (push) Has been cancelled
CI / test (pull_request) Failing after 6s
CI / validate (pull_request) Failing after 4s
[groq] [RESEARCH] MemPalace — Local AI Memory System Assessment & Leverage Plan (#1047) (#1086)
2026-04-07 14:04:56 +00:00

45 lines
1.3 KiB
JavaScript

// MemPalace integration
class MemPalace {
constructor() {
this.palacePath = '~/.mempalace/palace';
this.wing = 'nexus_chat';
this.init();
}
async init() {
try {
await this.setupWing();
this.setupAutoMining();
} catch (error) {
console.error('MemPalace init failed:', error);
}
}
async setupWing() {
await window.electronAPI.execPython(`mempalace init ${this.palacePath}`);
await window.electronAPI.execPython(`mempalace mine ~/chats --mode convos --wing ${this.wing}`);
}
setupAutoMining() {
setInterval(() => {
window.electronAPI.execPython(`mempalace mine #chat-container --mode convos --wing ${this.wing}`);
}, 30000); // Mine every 30 seconds
}
async search(query) {
const result = await window.electronAPI.execPython(`mempalace search "${query}" --wing ${this.wing}`);
return result.stdout;
}
updateStats() {
const stats = window.electronAPI.execPython(`mempalace status --wing ${this.wing}`);
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;
}
}
// Initialize MemPalace
const mempalace = new MemPalace();