You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello n8n developers, when I was using the “chat memory manager”, I found that the information was not recorded completely.
I only set up two chat memory manager modules, the first one to record user input, and the second one to read it.
However, when I input in the order of 1, 2, 3, 4, 5, 6, 7, I found that the memory module did not correctly record the information.
The pattern seems to be: the first time it records normally, the second time it overwrites the first record; the third time it extends the record normally (at this point there are two records), the fourth time it overwrites the third record.
Bug Description
Hello n8n developers, when I was using the “chat memory manager”, I found that the information was not recorded completely.
I only set up two chat memory manager modules, the first one to record user input, and the second one to read it.
However, when I input in the order of 1, 2, 3, 4, 5, 6, 7, I found that the memory module did not correctly record the information.
The pattern seems to be: the first time it records normally, the second time it overwrites the first record; the third time it extends the record normally (at this point there are two records), the fourth time it overwrites the third record.
To Reproduce
Here is the workflow:
{
"nodes": [
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.1,
"position": [
-540,
0
],
"id": "56adf3f1-6dc5-42b6-ae44-775f90412175",
"name": "When chat message received",
"webhookId": "e20be05c-d689-401d-9b59-1dcb9bd3ff36"
},
{
"parameters": {
"mode": "insert",
"messages": {
"messageValues": [
{
"type": "user",
"message": "={{ $json.chatInput }}"
}
]
}
},
"type": "@n8n/n8n-nodes-langchain.memoryManager",
"typeVersion": 1.1,
"position": [
-320,
0
],
"id": "d655e19a-afd5-4122-8717-a8e3b055ad57",
"name": "Chat Memory Manager"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.memoryManager",
"typeVersion": 1.1,
"position": [
56,
0
],
"id": "f46b34c8-fe0b-493a-8189-cd1c882c3c8f",
"name": "Chat Memory Manager1"
},
{
"parameters": {
"contextWindowLength": 20
},
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
"typeVersion": 1.3,
"position": [
-240,
220
],
"id": "c880c1fc-945a-4b1a-917d-20105cf2e32c",
"name": "Postgres Chat Memory",
"credentials": {
"postgres": {
"id": "NJGoko5aK43WWtl1",
"name": "Postgres account"
}
}
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $('When chat message received').item.json.sessionId }}",
"contextWindowLength": 20
},
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
"typeVersion": 1.3,
"position": [
160,
220
],
"id": "aa7d65fb-6f4c-4c6a-81d4-b804bd1578b2",
"name": "Postgres Chat Memory1",
"credentials": {
"postgres": {
"id": "NJGoko5aK43WWtl1",
"name": "Postgres account"
}
}
}
],
"connections": {
"When chat message received": {
"main": [
[
{
"node": "Chat Memory Manager",
"type": "main",
"index": 0
}
]
]
},
"Chat Memory Manager": {
"main": [
[
{
"node": "Chat Memory Manager1",
"type": "main",
"index": 0
}
]
]
},
"Postgres Chat Memory": {
"ai_memory": [
[
{
"node": "Chat Memory Manager",
"type": "ai_memory",
"index": 0
}
]
]
},
"Postgres Chat Memory1": {
"ai_memory": [
[
{
"node": "Chat Memory Manager1",
"type": "ai_memory",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateId": "PT1i+zU92Ii5O2XCObkhfHJR5h9rNJTpiCIkYJk9jHU=",
"templateCredsSetupCompleted": true,
"instanceId": "6c539a3c2a224c3bfb4e755552bac62e8eab064df7b664034faaed76747796b9"
}
}
Expected behavior
As above.
Operating System
Ubuntu 2204
n8n Version
1.94.1
Node.js Version
docker used
Database
SQLite (default)
Execution mode
main (default)
The text was updated successfully, but these errors were encountered: