n8n-nodes-tembory 1.0.21 → 1.0.22

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.
package/README.md CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  Node de memoria operacional da Tembory para agentes de IA no n8n.
4
4
 
5
- Versao atual: `1.0.21`.
5
+ Versao atual: `1.0.22`.
6
+
7
+ ## 1.0.22
8
+
9
+ - Corrige persistencia do transcript quando ha embedding conectado: mensagens recentes tambem sao gravadas como markers estruturados em `/v1/memories/`.
10
+ - Persiste tool history estruturado por padrao quando `includeToolHistory` esta ativo, mesmo sem `persistToolFactsToMem0`.
11
+ - Resolve falha real em n8n onde cada execucao carregava apenas a mensagem atual no `Conversation frame`.
6
12
 
7
13
  ## 1.0.21
8
14
 
@@ -2738,6 +2738,51 @@ class Mem0Memory {
2738
2738
  }
2739
2739
  }
2740
2740
  await saveClientVectorMemories(this, clientMemories, ids);
2741
+ if (adv.includeRecentMessages !== false && recentForMem0.length) {
2742
+ for (const recent of recentForMem0) {
2743
+ await GenericFunctions_1.mem0ApiRequest.call(this, 'POST', '/v1/memories/', {
2744
+ messages: [{ role: 'system', content: encodeRecentMessage(recent, threadId) }],
2745
+ infer: false,
2746
+ user_id: body.user_id,
2747
+ agent_id: body.agent_id,
2748
+ run_id: body.run_id,
2749
+ metadata: {
2750
+ kind: 'recent_message',
2751
+ role: recent.role,
2752
+ content: recent.content,
2753
+ at: recent.at,
2754
+ thread_id: threadId,
2755
+ project: project || undefined,
2756
+ source: 'tembory_transcript',
2757
+ },
2758
+ });
2759
+ }
2760
+ }
2761
+ if (adv.includeToolHistory !== false && toolCalls.length) {
2762
+ for (const tool of toolCalls) {
2763
+ await GenericFunctions_1.mem0ApiRequest.call(this, 'POST', '/v1/memories/', {
2764
+ messages: [{ role: 'system', content: encodeToolCall(tool, threadId) }],
2765
+ infer: false,
2766
+ user_id: body.user_id,
2767
+ agent_id: body.agent_id,
2768
+ run_id: body.run_id,
2769
+ metadata: {
2770
+ kind: 'tool_history',
2771
+ id: tool.id,
2772
+ sequence: tool.sequence,
2773
+ turn_id: tool.turnId,
2774
+ name: tool.name,
2775
+ input: tool.input,
2776
+ ok: tool.ok,
2777
+ result: tool.result,
2778
+ at: tool.at,
2779
+ source: tool.source || 'tembory_transcript',
2780
+ thread_id: threadId,
2781
+ project: project || undefined,
2782
+ },
2783
+ });
2784
+ }
2785
+ }
2741
2786
  return;
2742
2787
  }
2743
2788
  await GenericFunctions_1.mem0ApiRequest.call(this, 'POST', '/v1/memories/', body);
@@ -2760,6 +2805,31 @@ class Mem0Memory {
2760
2805
  });
2761
2806
  }
2762
2807
  }
2808
+ if (adv.includeToolHistory !== false && !adv.persistToolFactsToMem0 && toolCalls.length) {
2809
+ for (const tool of toolCalls) {
2810
+ await GenericFunctions_1.mem0ApiRequest.call(this, 'POST', '/v1/memories/', {
2811
+ messages: [{ role: 'system', content: encodeToolCall(tool, threadId) }],
2812
+ infer: false,
2813
+ user_id: body.user_id,
2814
+ agent_id: body.agent_id,
2815
+ run_id: body.run_id,
2816
+ metadata: {
2817
+ kind: 'tool_history',
2818
+ id: tool.id,
2819
+ sequence: tool.sequence,
2820
+ turn_id: tool.turnId,
2821
+ name: tool.name,
2822
+ input: tool.input,
2823
+ ok: tool.ok,
2824
+ result: tool.result,
2825
+ at: tool.at,
2826
+ source: tool.source || 'tembory_transcript',
2827
+ thread_id: threadId,
2828
+ project: project || undefined,
2829
+ },
2830
+ });
2831
+ }
2832
+ }
2763
2833
  if (adv.persistToolFactsToMem0 && toolCalls.length) {
2764
2834
  const facts = toolCalls.map((tool) => `Tool ${tool.name} input=${tool.input}${tool.result ? ` result=${tool.result}` : ''}`).join('\n');
2765
2835
  await GenericFunctions_1.mem0ApiRequest.call(this, 'POST', '/v1/memories/', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-tembory",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "Tembory node for n8n AI Agents with profile, tools, timeline, graph and semantic memory",
5
5
  "license": "MIT",
6
6
  "homepage": "https://tembory.com",