n8n-nodes-tembory 1.1.19 → 1.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3374,10 +3374,13 @@ class TemboryMemory {
|
|
|
3374
3374
|
return;
|
|
3375
3375
|
}
|
|
3376
3376
|
if (messages.length)
|
|
3377
|
-
await
|
|
3377
|
+
await safePersistLegacyMemory(this, body, {
|
|
3378
|
+
kind: 'conversation_messages',
|
|
3379
|
+
user_id: body.user_id,
|
|
3380
|
+
});
|
|
3378
3381
|
if (adv.includeRecentMessages !== false && recentForTembory.length) {
|
|
3379
3382
|
for (const recent of recentForTembory) {
|
|
3380
|
-
await
|
|
3383
|
+
await safePersistLegacyMemory(this, {
|
|
3381
3384
|
messages: [{ role: 'system', content: encodeRecentMessage(recent, threadId) }],
|
|
3382
3385
|
infer: false,
|
|
3383
3386
|
user_id: body.user_id,
|
|
@@ -3391,9 +3394,12 @@ class TemboryMemory {
|
|
|
3391
3394
|
thread_id: threadId,
|
|
3392
3395
|
project: project || undefined,
|
|
3393
3396
|
},
|
|
3397
|
+
}, {
|
|
3398
|
+
kind: 'recent_message',
|
|
3399
|
+
user_id: body.user_id,
|
|
3394
3400
|
});
|
|
3395
3401
|
}
|
|
3396
|
-
await
|
|
3402
|
+
await safePersistLegacyMemory(this, {
|
|
3397
3403
|
messages: [{ role: 'system', content: encodeConversationLedger(recentForTurn, threadId) }],
|
|
3398
3404
|
infer: false,
|
|
3399
3405
|
user_id: body.user_id,
|
|
@@ -3406,11 +3412,14 @@ class TemboryMemory {
|
|
|
3406
3412
|
source: 'tembory_transcript',
|
|
3407
3413
|
generated_at: nowIso(),
|
|
3408
3414
|
},
|
|
3415
|
+
}, {
|
|
3416
|
+
kind: 'conversation_ledger',
|
|
3417
|
+
user_id: body.user_id,
|
|
3409
3418
|
});
|
|
3410
3419
|
}
|
|
3411
3420
|
if (adv.includeToolHistory !== false && !adv.persistToolFactsToTembory && toolCalls.length) {
|
|
3412
3421
|
for (const tool of toolCalls) {
|
|
3413
|
-
await
|
|
3422
|
+
await safePersistLegacyMemory(this, {
|
|
3414
3423
|
messages: [{ role: 'system', content: encodeToolCall(tool, threadId) }],
|
|
3415
3424
|
infer: false,
|
|
3416
3425
|
user_id: body.user_id,
|
|
@@ -3430,9 +3439,13 @@ class TemboryMemory {
|
|
|
3430
3439
|
thread_id: threadId,
|
|
3431
3440
|
project: project || undefined,
|
|
3432
3441
|
},
|
|
3442
|
+
}, {
|
|
3443
|
+
kind: 'tool_history',
|
|
3444
|
+
user_id: body.user_id,
|
|
3445
|
+
tool: tool.name,
|
|
3433
3446
|
});
|
|
3434
3447
|
}
|
|
3435
|
-
await
|
|
3448
|
+
await safePersistLegacyMemory(this, {
|
|
3436
3449
|
messages: [{ role: 'system', content: encodeToolLedger(toolHistoryForTurn, threadId) }],
|
|
3437
3450
|
infer: false,
|
|
3438
3451
|
user_id: body.user_id,
|
|
@@ -3445,18 +3458,24 @@ class TemboryMemory {
|
|
|
3445
3458
|
source: 'tembory_transcript',
|
|
3446
3459
|
generated_at: nowIso(),
|
|
3447
3460
|
},
|
|
3461
|
+
}, {
|
|
3462
|
+
kind: 'tool_ledger',
|
|
3463
|
+
user_id: body.user_id,
|
|
3448
3464
|
});
|
|
3449
3465
|
}
|
|
3450
3466
|
if (adv.persistToolFactsToTembory && toolCalls.length) {
|
|
3451
3467
|
const facts = toolCalls.map((tool) => `Tool ${tool.name} input=${tool.input}${tool.result ? ` result=${tool.result}` : ''}`).join('\n');
|
|
3452
|
-
await
|
|
3468
|
+
await safePersistLegacyMemory(this, {
|
|
3453
3469
|
messages: [{ role: 'system', content: `Tool facts (read-only):\n${truncate(facts, 2000)}` }],
|
|
3454
3470
|
infer: false,
|
|
3455
3471
|
user_id: body.user_id,
|
|
3456
3472
|
metadata: { kind: 'tool_facts' },
|
|
3473
|
+
}, {
|
|
3474
|
+
kind: 'tool_facts',
|
|
3475
|
+
user_id: body.user_id,
|
|
3457
3476
|
});
|
|
3458
3477
|
for (const tool of toolCalls) {
|
|
3459
|
-
await
|
|
3478
|
+
await safePersistLegacyMemory(this, {
|
|
3460
3479
|
messages: [{ role: 'system', content: encodeToolCall(tool, threadId) }],
|
|
3461
3480
|
infer: false,
|
|
3462
3481
|
user_id: body.user_id,
|
|
@@ -3475,6 +3494,10 @@ class TemboryMemory {
|
|
|
3475
3494
|
source: tool.source,
|
|
3476
3495
|
thread_id: threadId,
|
|
3477
3496
|
},
|
|
3497
|
+
}, {
|
|
3498
|
+
kind: 'tool_history',
|
|
3499
|
+
user_id: body.user_id,
|
|
3500
|
+
tool: tool.name,
|
|
3478
3501
|
});
|
|
3479
3502
|
}
|
|
3480
3503
|
}
|
package/package.json
CHANGED