MCPcopy
hub / github.com/agent0ai/agent-zero / bulkExportMemories

Function bulkExportMemories

plugins/_memory/webui/memory-dashboard-store.js:411–450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

409 },
410
411 bulkExportMemories() {
412 const selectedMemories = this.selectedMemories;
413 if (selectedMemories.length === 0) return;
414
415 const exportData = {
416 export_timestamp: getCurrentUserISOString(),
417 memory_subdir: this.selectedMemorySubdir,
418 total_memories: selectedMemories.length,
419 memories: selectedMemories.map((memory) => ({
420 id: memory.id,
421 area: memory.area,
422 timestamp: memory.timestamp,
423 content: memory.content_full,
424 tags: memory.tags || [],
425 knowledge_source: memory.knowledge_source,
426 source_file: memory.source_file || null,
427 metadata: memory.metadata || {},
428 })),
429 };
430
431 const jsonString = JSON.stringify(exportData, null, 2);
432 const blob = new Blob([jsonString], { type: "application/json" });
433 const url = URL.createObjectURL(blob);
434
435 const timestamp = getCurrentUserDateString();
436 const filename = `memories_${this.selectedMemorySubdir}_selected_${selectedMemories.length}_${timestamp}.json`;
437
438 const a = document.createElement("a");
439 a.href = url;
440 a.download = filename;
441 document.body.appendChild(a);
442 a.click();
443 document.body.removeChild(a);
444 URL.revokeObjectURL(url);
445
446 justToast(
447 `Exported ${selectedMemories.length} selected memories to ${filename}`,
448 "success"
449 );
450 },
451
452 // Memory detail modal (standard approach)
453 showMemoryDetails(memory) {

Callers

nothing calls this directly

Calls 5

getCurrentUserISOStringFunction · 0.90
getCurrentUserDateStringFunction · 0.90
mapMethod · 0.80
clickMethod · 0.80
justToastFunction · 0.70

Tested by

no test coverage detected