Dear n8n Community,
Describe the problem/error/question
I tried to create an AI agent following the YouTube instructions. Unfortunately, an error occurs after inserting the “simple memory node.”
I first set up a Telegram trigger.
From there, it goes to a switch node that distinguishes between voice and text messages. {{ $json.message.text }} or {{ $json.message.voice.file_id }}
The text message is edited from “message.text” to “text.”
Then it goes to the AI agent. Without the memory node, the output via Telegram works.
When I now insert the memory node and trigger the workflow, the memory node flashes green briefly, but then turns red as shown in the image.
What is the error message (if any)?
Cannot create property ‘additional_kwargs’ on number ‘6407142739’
{
“nodes”: [
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $(‘Switch’).item.json.message.chat.id }}”,
“options”: {
“systemMessage”: “=# ROLLE\nDu bist ein freundlicher und hilfreicher Agent.\n\n# EXTRA INFORMATION\nDu sprichts gerade mit {{ $(‘Switch’).item.json.message.from.first_name }}”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.8,
“position”: [
1320,
0
],
“id”: “55a1acc1-f13b-4d5a-a6d0-2f64fc8b1d76”,
“name”: “AI Agent”
}
],
“connections”: {
“AI Agent”: {
“main”: [
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “31ca1c67a3c7e76535e44397c465cad5d69925544f50cfe7ba32b9a7bf7a61fc”
}
}
Please share your workflow
KI-Agent
{
“nodes”: [
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $(‘Switch’).item.json.message.chat.id }}”,
“options”: {
“systemMessage”: “=# ROLLE\nDu bist ein freundlicher und hilfreicher Agent.\n\n# EXTRA INFORMATION\nDu sprichts gerade mit {{ $(‘Switch’).item.json.message.from.first_name }}”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.8,
“position”: [
1320,
0
],
“id”: “55a1acc1-f13b-4d5a-a6d0-2f64fc8b1d76”,
“name”: “AI Agent”
}
],
“connections”: {
“AI Agent”: {
“main”: [
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “31ca1c67a3c7e76535e44397c465cad5d69925544f50cfe7ba32b9a7bf7a61fc”
}
}
Memorynode:
{
“nodes”: [
{
“parameters”: {
“sessionIdType”: “customKey”,
“sessionKey”: “={{ $(‘Telegram Trigger’).item.json.message.chat.id }}”,
“contextWindowLength”: 30
},
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“typeVersion”: 1.3,
“position”: [
1440,
200
],
“id”: “1968ecb5-e489-43dc-b555-bb95779c0f73”,
“name”: “Simple Memory”
}
],
“connections”: {
“Simple Memory”: {
“ai_memory”: [
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “31ca1c67a3c7e76535e44397c465cad5d69925544f50cfe7ba32b9a7bf7a61fc”
}
}
Share the output returned by the last node
Cannot create property ‘additional_kwargs’ on number ‘6407142739’
Information on your n8n setup
- n8n version: 1.84.1
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): n9n.cloud
- Operating system: Win 11
What am I doing wrong? What can I do?
Thank you for your help.
Best regards,
Andreas