()
| 29 | } |
| 30 | } |
| 31 | async exp() { |
| 32 | const o = p.join(this.c.o, 'zep_export.jsonl'), |
| 33 | w = fs.createWriteStream(o); |
| 34 | console.log('[ZEP] Listing sessions...'); |
| 35 | const ss = await this.fss(); |
| 36 | console.log(`[ZEP] Found ${ss.length} sessions`); |
| 37 | let tm = 0, |
| 38 | tc = 0; |
| 39 | for (let i = 0; i < ss.length; i++) { |
| 40 | const s = ss[i]; |
| 41 | tc++; |
| 42 | if (tc % 100 === 0) |
| 43 | console.log(`[ZEP] Progress: ${tc}/${ss.length} sessions`); |
| 44 | const mm = await this.fsm(s.session_id); |
| 45 | for (const m of mm) { |
| 46 | w.write(JSON.stringify(this.n(m, s)) + '\n'); |
| 47 | tm++; |
| 48 | } |
| 49 | } |
| 50 | w.end(); |
| 51 | console.log(`[ZEP] Exported ${tm} memories from ${tc} sessions`); |
| 52 | return o; |
| 53 | } |
| 54 | async fss() { |
| 55 | const ss = []; |
| 56 | let pg = 1, |
no test coverage detected