import { ZepClient } from "@getzep/zep-js";
import { Supermemory } from "supermemory";
// Initialize clients
const zep = new ZepClient({ apiKey: "your_zep_api_key" });
const supermemory = new Supermemory({ apiKey: "your_supermemory_api_key" });
// Export from Zep and import to Supermemory
const sessionIds = ["session_1", "session_2"]; // Add your session IDs
for (const sessionId of sessionIds) {
const memory = await zep.memory.get(sessionId);
const memories = memory?.memories || [];
for (const mem of memories) {
if (mem.content) {
await supermemory.add({
content: mem.content,
containerTag: [`session_${sessionId}`, `user_${memory.user_id || "unknown"}`],
metadata: {
role: mem.role,
type: "message",
original_uuid: mem.uuid,
...mem.metadata
}
});
console.log(`✅ Imported: ${mem.content.substring(0, 50)}...`);
}
}
}
console.log("Migration complete!");