n8n-nodes-tembory 1.0.26 → 1.0.27
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 +7 -1
- package/dist/nodes/Mem0/Mem0Memory.node.js +14 -11
- package/package.json +1 -1
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.
|
|
5
|
+
Versao atual: `1.0.27`.
|
|
6
|
+
|
|
7
|
+
## 1.0.27
|
|
8
|
+
|
|
9
|
+
- Aumenta a janela deterministica de conversa para 30 mensagens por padrao em todos os presets de producao.
|
|
10
|
+
- Entrega `conversation_history_chronological` e `all_user_messages_chronological` no frame de conversa.
|
|
11
|
+
- Para conversas curtas/medias, o historico completo recente vira a fonte primaria; vetor e resumo ficam como complemento.
|
|
6
12
|
|
|
7
13
|
## 1.0.26
|
|
8
14
|
|
|
@@ -925,7 +925,7 @@ const applyOperationalPreset = (advanced = {}) => {
|
|
|
925
925
|
topK: 8,
|
|
926
926
|
lastN: 12,
|
|
927
927
|
toolHistoryLastN: 15,
|
|
928
|
-
recentMessagesLastN:
|
|
928
|
+
recentMessagesLastN: 30,
|
|
929
929
|
},
|
|
930
930
|
productionBalanced: {
|
|
931
931
|
summarySource: 'auto',
|
|
@@ -958,7 +958,7 @@ const applyOperationalPreset = (advanced = {}) => {
|
|
|
958
958
|
topK: 6,
|
|
959
959
|
lastN: 8,
|
|
960
960
|
toolHistoryLastN: 10,
|
|
961
|
-
recentMessagesLastN:
|
|
961
|
+
recentMessagesLastN: 30,
|
|
962
962
|
vectorMemoryMaxChars: 360,
|
|
963
963
|
contextMaxChars: 10000,
|
|
964
964
|
connectedModelSummaryMaxChars: 1200,
|
|
@@ -995,7 +995,7 @@ const applyOperationalPreset = (advanced = {}) => {
|
|
|
995
995
|
topK: 4,
|
|
996
996
|
lastN: 4,
|
|
997
997
|
toolHistoryLastN: 5,
|
|
998
|
-
recentMessagesLastN:
|
|
998
|
+
recentMessagesLastN: 30,
|
|
999
999
|
vectorMemoryMaxChars: 260,
|
|
1000
1000
|
contextMaxChars: 7000,
|
|
1001
1001
|
connectedModelSummaryMaxChars: 1000,
|
|
@@ -1033,7 +1033,7 @@ const applyOperationalPreset = (advanced = {}) => {
|
|
|
1033
1033
|
lastN: 4,
|
|
1034
1034
|
maxReturn: 6,
|
|
1035
1035
|
toolHistoryLastN: 6,
|
|
1036
|
-
recentMessagesLastN:
|
|
1036
|
+
recentMessagesLastN: 30,
|
|
1037
1037
|
vectorMemoryMaxChars: 220,
|
|
1038
1038
|
contextMaxChars: 7000,
|
|
1039
1039
|
connectedModelSummaryMaxChars: 1200,
|
|
@@ -1063,7 +1063,7 @@ const applyOperationalPreset = (advanced = {}) => {
|
|
|
1063
1063
|
topK: 10,
|
|
1064
1064
|
lastN: 20,
|
|
1065
1065
|
toolHistoryLastN: 20,
|
|
1066
|
-
recentMessagesLastN:
|
|
1066
|
+
recentMessagesLastN: 30,
|
|
1067
1067
|
payloadFormat: 'auditJson',
|
|
1068
1068
|
},
|
|
1069
1069
|
};
|
|
@@ -1225,21 +1225,24 @@ const buildConversationFrame = ({ query = '', recentMessages = [], workingMemory
|
|
|
1225
1225
|
const previousUser = previousUserMessageForQuery(query, recentMessages);
|
|
1226
1226
|
const firstUser = firstUserMessageFromConversation(recentMessages);
|
|
1227
1227
|
const previousUserMessage = previousUser ? truncate(previousUser.content, 500) : previousUserFallbackFromWorkingMemory(query, workingMemory);
|
|
1228
|
-
const chronological =
|
|
1228
|
+
const chronological = (recentMessages || []).map((msg) => ({
|
|
1229
1229
|
role: msg.role,
|
|
1230
1230
|
content: truncate(msg.content, 500),
|
|
1231
1231
|
at: msg.at,
|
|
1232
1232
|
}));
|
|
1233
|
+
const userMessagesChronological = chronological.filter((msg) => /^(user|human)$/i.test(String(msg.role || '')));
|
|
1233
1234
|
const frame = cleanContextValue({
|
|
1234
1235
|
current_user_message: currentUser ? truncate(currentUser.content, 500) : truncate(query, 500),
|
|
1235
1236
|
first_user_message: firstUser ? truncate(firstUser.content, 500) : null,
|
|
1236
1237
|
previous_user_message: previousUserMessage,
|
|
1238
|
+
conversation_history_chronological: chronological,
|
|
1237
1239
|
recent_messages_chronological: chronological,
|
|
1240
|
+
all_user_messages_chronological: userMessagesChronological,
|
|
1238
1241
|
recent_user_messages: users
|
|
1239
1242
|
.filter((msg) => normalizeIntentText(msg.content).trim() !== normalizedQuery)
|
|
1240
1243
|
.slice(0, 5)
|
|
1241
1244
|
.map((msg) => ({ role: msg.role, content: truncate(msg.content, 500), at: msg.at })),
|
|
1242
|
-
instruction: 'This is the authoritative short-term conversation frame. If the user asks about first/current/previous/last client messages, answer from first_user_message/current_user_message/previous_user_message/
|
|
1245
|
+
instruction: 'This is the authoritative short-term conversation frame. If the user asks about first/current/previous/last client messages or what they already said, answer from first_user_message/current_user_message/previous_user_message/conversation_history_chronological/all_user_messages_chronological before using vector memories, summaries, operational state, or tool history.',
|
|
1243
1246
|
});
|
|
1244
1247
|
if (!previousUserMessage)
|
|
1245
1248
|
frame.previous_user_message = null;
|
|
@@ -1934,8 +1937,8 @@ const buildContextMessages = ({ payloadFormat, query, userId, profileFacts, work
|
|
|
1934
1937
|
section: 'context_header',
|
|
1935
1938
|
title: 'Tembory context',
|
|
1936
1939
|
value: compactForAgent || compactStateSections
|
|
1937
|
-
? 'Read-only memory. Conversation frame is authoritative for first/current/previous client messages. Follow next_expected_action when present. Before calling downstream tools, verify required prior tool context in tool_history or operational_state. Do not repeat tools listed in do_not_repeat_tools.'
|
|
1938
|
-
: 'Use this context as read-only memory. Prefer it over guessing. Do not mention internal section names to the user. The Conversation frame is authoritative for first, current, previous, and recent client messages. Treat next_expected_action as an instruction, not as a suggestion. If it says to call a tool now, call that tool instead of asking the user the same question again. If the user asks to continue, chooses a slot, says ok/sim, reserve, confirm, update, cancel, or performs any downstream action that depends on a prior tool result, first verify the required prior result in tool_history, recent_messages, or vector memories. If the required prior result is absent, do not call the downstream tool; ask for the missing context or call the appropriate prerequisite tool.',
|
|
1940
|
+
? 'Read-only memory. Conversation frame is authoritative for the full recent transcript, including first/current/previous client messages. Follow next_expected_action when present. Before calling downstream tools, verify required prior tool context in tool_history or operational_state. Do not repeat tools listed in do_not_repeat_tools.'
|
|
1941
|
+
: 'Use this context as read-only memory. Prefer it over guessing. Do not mention internal section names to the user. The Conversation frame is authoritative for the full recent transcript, including first, current, previous, and recent client messages. Treat next_expected_action as an instruction, not as a suggestion. If it says to call a tool now, call that tool instead of asking the user the same question again. If the user asks to continue, chooses a slot, says ok/sim, reserve, confirm, update, cancel, or performs any downstream action that depends on a prior tool result, first verify the required prior result in tool_history, recent_messages, or vector memories. If the required prior result is absent, do not call the downstream tool; ask for the missing context or call the appropriate prerequisite tool.',
|
|
1939
1942
|
});
|
|
1940
1943
|
}
|
|
1941
1944
|
sections.push({
|
|
@@ -2358,7 +2361,7 @@ class Mem0Memory {
|
|
|
2358
2361
|
values: [
|
|
2359
2362
|
{ displayName: 'Incluir Profile Facts', name: 'includeProfileFacts', type: 'boolean', default: true },
|
|
2360
2363
|
{ displayName: 'Incluir Mensagens Recentes', name: 'includeRecentMessages', type: 'boolean', default: true },
|
|
2361
|
-
{ displayName: 'Últimas N Mensagens', name: 'recentMessagesLastN', type: 'number', default:
|
|
2364
|
+
{ displayName: 'Últimas N Mensagens', name: 'recentMessagesLastN', type: 'number', default: 30 },
|
|
2362
2365
|
{ displayName: 'Incluir Highlights Recentes', name: 'includeRecentHighlights', type: 'boolean', default: true },
|
|
2363
2366
|
{ displayName: 'Máximo de Highlights', name: 'recentHighlightsMaxItems', type: 'number', default: 6 },
|
|
2364
2367
|
{ displayName: 'Incluir Grafo', name: 'includeRelations', type: 'boolean', default: true },
|
|
@@ -2513,7 +2516,7 @@ class Mem0Memory {
|
|
|
2513
2516
|
{ displayName: 'Incluir Entity Timeline', name: 'includeEntityTimeline', type: 'boolean', default: true, description: 'Injeta uma timeline compacta de entidades, fatos de perfil, relações do grafo e eventos importantes da sessão.' },
|
|
2514
2517
|
{ displayName: 'Incluir Compressão de Memória', name: 'includeMemoryCompression', type: 'boolean', default: true, description: 'Injeta resumos compactos de turno, sessão, entidades e workflow para reduzir ruído.' },
|
|
2515
2518
|
{ displayName: 'Incluir Mensagens Recentes', name: 'includeRecentMessages', type: 'boolean', default: true },
|
|
2516
|
-
{ displayName: 'Últimas N Mensagens', name: 'recentMessagesLastN', type: 'number', default:
|
|
2519
|
+
{ displayName: 'Últimas N Mensagens', name: 'recentMessagesLastN', type: 'number', default: 30 },
|
|
2517
2520
|
{ displayName: 'Incluir Highlights Recentes', name: 'includeRecentHighlights', type: 'boolean', default: true },
|
|
2518
2521
|
{ displayName: 'Máximo de Highlights', name: 'recentHighlightsMaxItems', type: 'number', default: 6 },
|
|
2519
2522
|
],
|
package/package.json
CHANGED