构建工作流
How memory works
Memory is a key part of AI chat services. The memory1 keeps a history of previous messages, allowing for an ongoing conversation with the AI, rather than every interaction starting fresh.
AI memory in n8n
To add memory to your AI workflow you can use either:
- Simple Memory: stores a customizable length of chat history for the current session. This is the easiest to get started with.
- One of the memory services that n8n provides nodes for. These include:
- Motorhead
- Redis Chat Memory
- Postgres Chat Memory
- Xata
- Zep
If you need to do advanced AI memory management in your workflows, use the Chat Memory Manager node.
This node is useful when you:
- Can't add a memory node directly.
- Need to do more complex memory management, beyond what the memory nodes offer. For example, you can add this node to check the memory size of the Agent node's response, and reduce it if needed.
- Want to inject messages to the AI that look like user messages, to give the AI more context.
Footnotes
- Back
In an AI context, memory allows AI tools to persist message context across interactions. This allows you to have a continuing conversations with AI agents, for example, without submitting ongoing context with each message. In n8n, AI agent nodes can use memory, but AI chains can't.
官方原文和授权
本页来自 N8N 英文官方网站固定快照,并转换成 xueai 静态页面。内容以 N8N 持续更新的官方页面为准。