Strange, it also did not notify me of your reply.
I suppose your screenshot is from the TG output?
It now looks like:
By the way, something terrible happened.
After he was working, I made one simple amendment which is the append n8n attribution in the TG output (to remove the sent by n8n text in the reply msg) and now the bot has gone brainless, it is now again not recalling anything.
I try to switch it back but it also did not work (append n8n attribution I switched on and off.
My current flow
{
“nodes”: [
{
“parameters”: {
“chatId”: “1414559473”,
“text”: “={{ $node["Skynet"].json.output }}\n”,
“additionalFields”: {
“appendAttribution”: false,
“parse_mode”: “HTML”
}
},
“type”: “n8n-nodes-base.telegram”,
“typeVersion”: 1.2,
“position”: [
-192,
-240
],
“id”: “b74550a9-a7d5-4059-854b-652ffbef4e70”,
“name”: “Send reply to Sam”,
“webhookId”: “97f6f3e1-051b-40bb-a004-562ae930df96”,
“credentials”: {
“telegramApi”: {
“id”: “A3K059LClqeh1HI4”,
“name”: “Telegram account”
}
}
},
{
“parameters”: {
“updates”: [
“message”
],
“additionalFields”: {}
},
“type”: “n8n-nodes-base.telegramTrigger”,
“typeVersion”: 1.2,
“position”: [
-1024,
-224
],
“id”: “39189d2f-d9f4-4e92-b495-05da80465443”,
“name”: “Msg from Sam”,
“webhookId”: “8032114d-ae93-44cd-8c14-8943f0e920c7”,
“credentials”: {
“telegramApi”: {
“id”: “A3K059LClqeh1HI4”,
“name”: “Telegram account”
}
}
},
{
“parameters”: {
“sessionIdType”: “customKey”,
“sessionKey”: “=={{ $json.message.chat.id.toString() }}\n”,
“contextWindowLength”: 50000
},
“type”: “@n8n/n8n-nodes-langchain.memoryPostgresChat”,
“typeVersion”: 1.3,
“position”: [
-416,
-32
],
“id”: “c007be3e-8aa1-4fd4-abc6-a287e966150e”,
“name”: “Postgres Chat Memory”,
“credentials”: {
“postgres”: {
“id”: “GrbwOyRtZfuJh4iF”,
“name”: “Postgres account”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “loose”,
“version”: 3
},
“conditions”: [
{
“id”: “ffeb2252-c637-414e-ab78-3cd2a5463e8e”,
“leftValue”: “={{ Number($json.message.from.id) }}\n”,
“rightValue”: 1414559473,
“operator”: {
“type”: “number”,
“operation”: “equals”
}
}
],
“combinator”: “and”
},
“looseTypeValidation”: true,
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.3,
“position”: [
-832,
-224
],
“id”: “994287ac-9242-4cf5-b6a9-97782ce363d9”,
“name”: “If”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatGoogleGemini”,
“typeVersion”: 1,
“position”: [
-512,
-32
],
“id”: “e185f134-e803-418d-8a44-99a22b43810c”,
“name”: “Google Gemini Chat Model”,
“credentials”: {
“googlePalmApi”: {
“id”: “pDGgW7JgpO3Qrjc0”,
“name”: “Google Gemini(PaLM) Api account”
}
}
},
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $json.chatInput }}\n”,
“options”: {
“systemMessage”: “You are a stateful assistant.\n\nYou MUST treat the provided chat history as factual memory about the user.\n\nIf the user asks about:\n- preferences\n- facts about themselves\n- things they previously stated\n\nYou MUST search the chat history and answer from it.\n\nIf the answer exists in memory, you are NOT allowed to say:\n"I don’t know", "you haven’t told me", or similar.\n\nOnly say you don’t know if the information is truly absent from memory.\n”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 3.1,
“position”: [
-512,
-240
],
“id”: “e6553d20-92be-48b5-a3b4-ec09019e2c48”,
“name”: “Skynet”
}
],
“connections”: {
“Msg from Sam”: {
“main”: [
[
{
“node”: “If”,
“type”: “main”,
“index”: 0
}
]
]
},
“Postgres Chat Memory”: {
“ai_memory”: [
[
{
“node”: “Skynet”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“If”: {
“main”: [
[
{
“node”: “Skynet”,
“type”: “main”,
“index”: 0
}
]
]
},
“Google Gemini Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “Skynet”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Skynet”: {
“main”: [
[
{
“node”: “Send reply to Sam”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “296e6cc8a58e3c74d3b02e577223b5a9443313a173504ed35f8cc3e9a8d2b550”
}
}