n8n-nodes-tembory 1.1.32 → 1.1.34

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,19 @@
2
2
 
3
3
  Node de memoria operacional da Tembory para agentes de IA no n8n.
4
4
 
5
- Versao atual: `1.1.32`.
5
+ Versao atual: `1.1.34`.
6
+
7
+ ## 1.1.34
8
+
9
+ - Adiciona `statusAnswerMaterial` no contexto do Agent para perguntas sobre historico operacional.
10
+ - Quando o usuario pergunta quais tools foram chamadas, o Agent recebe um bloco direto com tool count, inputs, outputs, timestamps e action ledger.
11
+ - Instrui explicitamente o Agent a responder desse material e nao dizer que nao tem acesso quando o historico existe.
12
+
13
+ ## 1.1.33
14
+
15
+ - Corrige o runtime do `Modo Simples Recomendado` para usar defaults seguros nos parametros que ficam escondidos na interface.
16
+ - Evita erro `Could not get parameter` em nodes novos quando `memoryKey`, `retrievalMode` e `payloadFormat` nao estao gravados no workflow.
17
+ - Mantem o modo avancado com todas as opcoes disponiveis.
6
18
 
7
19
  ## 1.1.32
8
20
 
@@ -2609,6 +2609,22 @@ const compactSaveAuditForAgent = (capture = {}) => cleanContextValue({
2609
2609
  dedupe: capture.last_save_dedupe_summary,
2610
2610
  },
2611
2611
  });
2612
+ const buildStatusAnswerMaterialForAgent = ({ query, workingMemory = {}, toolHistory = [], actionLedger = [] }) => {
2613
+ const intent = workingMemory.last_user_intent || inferUserIntent(query, []);
2614
+ if (intent !== 'operational_status_question')
2615
+ return undefined;
2616
+ const toolEvents = pruneByLimit(toolHistory || [], 12).map((tool) => compactToolAuditForSideChannel(tool));
2617
+ const ledgerItems = compactActionLedgerForAgent(actionLedger || [], 12, true);
2618
+ return cleanContextValue({
2619
+ instruction: toolEvents.length
2620
+ ? 'The current user is asking about prior tool calls. Answer directly from this material. Do not call tools. Do not say you lack access to tool history, inputs, outputs, or timestamps.'
2621
+ : 'The current user is asking about prior tool calls, but no prior tool events are available in memory. Answer that no prior tool calls are available in this thread unless the current transcript shows otherwise.',
2622
+ current_user_request: truncate(query, 500),
2623
+ tool_count: toolEvents.length,
2624
+ tool_events: toolEvents,
2625
+ action_ledger: ledgerItems,
2626
+ });
2627
+ };
2612
2628
  const compactEntityTimelineForAgent = (timeline = [], maxItems = 8) => pruneByLimit(timeline || [], maxItems).map((item) => cleanContextValue({
2613
2629
  entity: item.entity || item.source || item.name,
2614
2630
  event: truncate(item.event || item.fact || item.relation || item.kind || item.value, 220),
@@ -2885,6 +2901,7 @@ const loadedSectionsForSideChannel = (parsed = {}, memoryAudit = {}) => cleanCon
2885
2901
  memoryCompression: Boolean(parsed.memoryCompression),
2886
2902
  operationalState: Boolean(parsed.operationalState),
2887
2903
  actionLedger: Array.isArray(parsed.actionLedger),
2904
+ statusAnswerMaterial: Boolean(parsed.statusAnswerMaterial || parsed.status_answer_material),
2888
2905
  turnBrief: Boolean(parsed.turnBrief || parsed.turn_brief),
2889
2906
  memoryAudit: Boolean(memoryAudit && Object.keys(memoryAudit).length),
2890
2907
  entityTimeline: Array.isArray(parsed.entityTimeline),
@@ -2923,6 +2940,7 @@ const agentContextBudgetForSideChannel = (messages = [], parsed = {}) => {
2923
2940
  ['conversation', parsed.conversation],
2924
2941
  ['current_turn_focus', parsed.current_turn_focus || parsed.currentTurn || parsed.current_turn],
2925
2942
  ['action_directive', parsed.action_directive],
2943
+ ['status_answer_material', parsed.statusAnswerMaterial || parsed.status_answer_material],
2926
2944
  ['turn_brief', parsed.turnBrief || parsed.turn_brief],
2927
2945
  ['summary', parsed.summary],
2928
2946
  ['working_memory', parsed.workingMemory || parsed.working_memory],
@@ -3174,6 +3192,14 @@ const buildContextMessages = ({ payloadFormat, query, userId, profileFacts, work
3174
3192
  title: 'Turn brief',
3175
3193
  value: turnBrief,
3176
3194
  });
3195
+ const statusAnswerMaterial = buildStatusAnswerMaterialForAgent({ query, workingMemory, toolHistory, actionLedger });
3196
+ if (statusAnswerMaterial) {
3197
+ sections.push({
3198
+ section: 'status_answer_material',
3199
+ title: 'Status answer material',
3200
+ value: statusAnswerMaterial,
3201
+ });
3202
+ }
3177
3203
  const actionDirective = buildActionDirective({ workingMemory, operationalState });
3178
3204
  if (actionDirective) {
3179
3205
  sections.push({
@@ -3289,6 +3315,7 @@ const buildContextMessages = ({ payloadFormat, query, userId, profileFacts, work
3289
3315
  instruction: focus.instruction,
3290
3316
  }),
3291
3317
  currentTurn: diagnostics?.currentTurn,
3318
+ statusAnswerMaterial: sectionValue('status_answer_material'),
3292
3319
  action_directive: directive ? cleanContextValue({
3293
3320
  required_tool: directive.required_tool,
3294
3321
  next_expected_action: directive.next_expected_action,
@@ -3737,7 +3764,7 @@ class TemboryMemory {
3737
3764
  // For AI connections, n8n reads from supplyData. The AI Agent expects a
3738
3765
  // memory-like object, not raw JSON, so expose the LangChain memory contract.
3739
3766
  async supplyData(itemIndex) {
3740
- const memoryKey = this.getNodeParameter('memoryKey', itemIndex);
3767
+ const memoryKey = this.getNodeParameter('memoryKey', itemIndex, 'chatHistory');
3741
3768
  let currentMessages = [];
3742
3769
  const loadCache = new Map();
3743
3770
  const recordMemoryEvent = (action, payload = {}, error) => {
@@ -4354,8 +4381,8 @@ class TemboryMemory {
4354
4381
  }
4355
4382
  async loadMemoryVariablesForItem(itemIndex, inputValues = {}) {
4356
4383
  var _a, _b, _c, _d, _e, _f, _g;
4357
- const memoryKey = this.getNodeParameter('memoryKey', itemIndex);
4358
- const requestedRetrievalMode = this.getNodeParameter('retrievalMode', itemIndex);
4384
+ const memoryKey = this.getNodeParameter('memoryKey', itemIndex, 'chatHistory');
4385
+ const requestedRetrievalMode = this.getNodeParameter('retrievalMode', itemIndex, 'basic');
4359
4386
  let payloadFormat = this.getNodeParameter('payloadFormat', itemIndex, 'structured');
4360
4387
  const threadId = this.getNodeParameter('threadId', itemIndex);
4361
4388
  const project = this.getNodeParameter('project', itemIndex, '');
@@ -4996,8 +5023,8 @@ class TemboryMemory {
4996
5023
  const returnData = [];
4997
5024
  const count = Math.max(items.length, 1);
4998
5025
  for (let i = 0; i < count; i++) {
4999
- const memoryKey = this.getNodeParameter('memoryKey', i);
5000
- const requestedRetrievalMode = this.getNodeParameter('retrievalMode', i);
5026
+ const memoryKey = this.getNodeParameter('memoryKey', i, 'chatHistory');
5027
+ const requestedRetrievalMode = this.getNodeParameter('retrievalMode', i, 'basic');
5001
5028
  const threadId = this.getNodeParameter('threadId', i);
5002
5029
  const project = this.getNodeParameter('project', i, '');
5003
5030
  const adv = applyOperationalPreset(readAdvancedOptions(this, i));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-tembory",
3
- "version": "1.1.32",
3
+ "version": "1.1.34",
4
4
  "description": "Tembory node for n8n AI Agents with operational memory, tool history and decision state",
5
5
  "license": "MIT",
6
6
  "homepage": "https://tembory.com",