1import{j as e}from"./vendor-motion-CfBPC-kS.js";import{L as n}from"./vendor-react-BR_v4Ont.js";import{C as o}from"./ContentPage-BxMYAaUt.js";import"./index-VVKdn61F.js";import"./vendor-supabase-BSd6ADfF.js";import"./HireCTA-DktS03tb.js";import"./EmailGateModal-BCI8ZqlV.js";import"./dialog-my3VBzDi.js";const r=e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Symptoms â what you're seeing"}),e.jsxs("ul",{children:[e.jsx("li",{children:'Your n8n AI Agent workflow fails with an error referencing "Simple Memory," "Window Buffer Memory," or "Buffer Memory"'}),e.jsx("li",{children:'The error message includes "Cannot read properties of undefined" or "node type unknown"'}),e.jsx("li",{children:"A workflow that worked on n8n 0.x or early 1.x fails after upgrading to n8n 1.30+"}),e.jsx("li",{children:"The AI Agent node can't connect to its memory node â the connection line turns red or the memory node shows a warning icon"}),e.jsx("li",{children:`You see "Node type 'n8n-nodes-langchain.memoryBufferWindow' is not known" in the execution log`})]}),e.jsx("h2",{children:"Why this happens"}),e.jsxs("p",{children:["n8n overhauled its AI/LangChain node ecosystem between versions 1.20 and 1.40. The old memory nodes â ",e.jsx("strong",{children:"Simple Memory"}),", ",e.jsx("strong",{children:"Buffer Memory"}),", and ",e.jsx("strong",{children:"Window Buffer Memory"})," â were replaced with a unified ",e.jsx("strong",{children:"Simple Memory"}),' node (sometimes called "Chat Memory" in newer versions). The node type identifiers changed, which means workflows exported from an older version reference node types that no longer exist in the current version.']}),e.jsx("p",{children:"This isn't a misconfiguration â it's a breaking change in n8n's LangChain integration. The fix is to replace the legacy memory node with its current equivalent and re-wire the connection."}),e.jsx("h2",{children:"The fix, step by step"}),e.jsxs("ol",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Identify which memory node you're using."}),` Click on the memory node in your workflow. If it shows a warning icon or says "unknown node type," it's a legacy node that needs replacement.`,e.jsx("pre",{style:{background:"var(--tm-code-bg)",color:"var(--tm-code-text)",padding:16,borderRadius:4,marginTop:8,fontSize:13,overflowX:"auto"},children:`# Legacy node types (broken on n8n 1.30+) 2n8n-nodes-langchain.memoryBufferWindow 3n8n-nodes-langchain.memorySimple 4 5# Current node type 6@n8n/n8n-nodes-langchain.memoryBufferWindow`})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Delete the old memory node."})," Select it and press Delete. Note the AI Agent node it was connected to."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Add the new memory node."}),' In the node panel, search for "Window Buffer Memory" (or "Simple Memory" in newer builds). It will be under the AI â Memory category. Drag it onto the canvas.']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Connect it to the AI Agent node."}),` The AI Agent node has a dedicated "Memory" input slot (shown as a small dot on the left side, separate from the main input). Connect the new memory node's output to this slot.`]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Configure the context window."})," The key setting is ",e.jsx("strong",{children:"Context Window Length"})," â this controls how many previous messages the AI remembers:",e.jsx("pre",{style:{background:"var(--tm-code-bg)",color:"var(--tm-code-text)",padding:16,borderRadius:4,marginTop:8,fontSize:13,overflowX:"auto"},children:`Context Window Length: 10 (default, keeps last 10 messages) 7 8# For chatbots: 10-20 messages is usually enough 9# For summarization chains: 5 messages 10# For simple Q&A: 3-5 messages 11# More context = more tokens = higher cost per execution`})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Set the Session ID."})," If your workflow handles multiple users/conversations, set the Session ID field to a unique identifier per conversation (e.g., ",e.jsx("code",{children:"{{ $json.chatId }}"})," or ",e.jsx("code",{children:"{{ $json.userId }}"}
11),"). Without this, all conversations share the same memory."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Test the workflow."})," Send a test message through the AI Agent. Then send a follow-up message referencing the first â if memory is working, the AI will have context from the previous exchange."]})]}),e.jsx("h2",{children:"If you're importing a workflow JSON"}),e.jsx("p",{children:"If you downloaded a workflow template that uses legacy memory nodes, you can fix it before importing by editing the JSON directly:"}),e.jsx("pre",{style:{background:"var(--tm-code-bg)",color:"var(--tm-code-text)",padding:16,borderRadius:4,marginTop:8,fontSize:13,overflowX:"auto"},children:`// Find this in the JSON: 12"type": "n8n-nodes-langchain.memoryBufferWindow" 13 14// Replace with: 15"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow" 16 17// Also check for: 18"type": "n8n-nodes-langchain.memorySimple" 19// Replace with: 20"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow"`}),e.jsx("p",{children:"Save the modified JSON and import it. The memory node should now load correctly."}),e.jsx("h2",{children:"Common variations"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:`"Memory node loads but AI doesn't remember previous messages"`})," â the Session ID is the same for every execution. Each execution gets a fresh memory. Set Session ID to a value that persists across the conversation (a chat ID, user ID, or thread ID from your trigger)."]}),e.jsxs("li",{children:[e.jsx("strong",{children:'"Memory works in test but not in production"'})," â n8n's built-in memory storage is in-memory by default (lost on restart). For production, use a ",e.jsx("strong",{children:"Postgres Chat Memory"})," or ",e.jsx("strong",{children:"Redis Chat Memory"})," node instead of Window Buffer Memory."]}),e.jsxs("li",{children:[e.jsx("strong",{children:`"Error: Cannot find module 'langchain/memory'"`})," â your self-hosted n8n is missing the ",e.jsx("code",{children:"@n8n/n8n-nodes-langchain"})," package. Reinstall n8n or update to the latest version. On Docker: pull the latest ",e.jsx("code",{children:"n8nio/n8n"})," image."]}),e.jsxs("li",{children:[e.jsx("strong",{children:`"AI Agent says it doesn't have access to previous messages"`})," â memory is connected but the AI Agent's system prompt tells it not to reference prior context. Check the system prompt for conflicting instructions."]})]}),e.jsx("h2",{children:"When this isn't the issue"}),e.jsxs("ul",{children:[e.jsx("li",{children:"If the AI Agent fails with a model-related error (401, 429, model not found), the memory node isn't the problem â check your API credentials and model configuration"}),e.jsx("li",{children:"If the workflow runs but the AI gives wrong answers, the issue is in your prompt engineering or the model choice, not memory"}),e.jsx("li",{children:'If you see "context length exceeded" errors, your memory window is too large â reduce the Context Window Length or switch to a summarization memory pattern'})]}),e.jsxs("p",{style:{marginTop:24},children:["For the full guide on building production-ready AI Agent workflows, see the ",e.jsx(n,{to:"/lab/n8n-production-reliability",style:{color:"var(--tm-accent)"},children:"n8n production reliability checklist"}),"."]}),e.jsx("p",{style:{marginTop:16},children:e.jsx(n,{to:"/workflows",style:{color:"var(--tm-accent)"},children:"Browse 4,900+ ready-to-import workflow templates â"})})]}),m=()=>e.jsx(o,{tier:1,slug:"n8n-simple-memory-node-error",title:"Fix: n8n Simple Memory / Window Buffer Memory node error",subtitle:"Your AI Agent workflow fails because the memory node type changed between n8n versions. Here's how to replace the legacy node and keep conversation context working.",metaDescription:"n8n AI Agent failing on Simple Memory? The Window Buffer Memory node type changed between versions. Here's how to swap it and keep context.",lastUpdated:"2026-06-08",readTime:"5",techStack:["n8n","AI Agent","LangChain","Window Buffer Memory"],relatedPages:[{title:"Fix: n8n OpenAI 429 rate limit error",slug:"n8n-openai-rate-limit-429",tier:1},{title:"n8n production reliability checklist",slug:"n8n-production-reliability",tier:3}],relatedServices:["AI Agent","OpenAI","LangChain"],faq:[{q:"Why does the memory node load but the AI doesn't remember previous messages?",a:"The Session ID is the same for every execution. Each execution gets a fresh memory. Set Session ID to a value that persists across the conversation (a chat ID, user ID, or thread ID from your trigger)."},{q:"Why does memory work in test but not in production?",a:"n8n's built-in memory storage is in-memory by default (lost on restart). For production, use a Postgres Chat Memory or Redis Chat Memory node instead of Window Buffer Memory."},{q:`What causes "Error: Cannot find module 'langchain/memory'"?`,a:"Your self-hosted n8n is missing the @n8n/n8n-nodes-langchain package. Reinstall n8n or update to the latest version. On Docker: pull the latest n8nio/n8n image."},{q:"Why does the AI Agent say it doesn't have access to previous messages?",a:"Memory is connected but the AI Agent's system prompt tells it not to reference prior context. Check the system prompt for conflicting instructions."}],body:r});export{m as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.