Skip to content

Simple Memory 节点#

使用 Simple Memory 节点可以在您的工作流中持久化聊天历史记录。

本页面列出了 Simple Memory 节点支持的操作,并提供了更多资源的链接。

在队列模式下不要使用此节点

如果您的 n8n 实例使用队列模式,此节点无法在活跃的生产工作流中正常工作。这是因为 n8n 无法保证每次对 Simple Memory 的调用都会路由到同一个工作进程。

/// 注意 | 子节点中的参数解析 子节点在使用表达式处理多个项目时的行为与其他节点不同。

大多数节点(包括根节点)会接收任意数量的输入项,处理这些项目,然后输出结果。您可以使用表达式来引用输入项,节点会依次为每个项目解析表达式。例如,给定五个 name 值作为输入,表达式 {{ $json.name }} 会依次解析为每个名称。

而在子节点中,表达式总是解析为第一个项目。例如,给定五个 name 值作为输入,表达式 {{ $json.name }} 总是解析为第一个名称。 ///

节点参数#

配置以下参数来设置节点:

  • 会话键(Session Key):输入用于在工作流数据中存储记忆的键名。
  • 上下文窗口长度(Context Window Length):输入要考虑的先前交互数量作为上下文。

模板和示例#

AI agent chat

by n8n Team

View template details
Building Your First WhatsApp Chatbot

by Jimleuk

View template details
Build Your First AI Data Analyst Chatbot

by Solomon

View template details
Browse Simple Memory 节点文档 integration templates, or search all templates

相关资源#

有关该服务的更多信息,请参考 LangChain 的 Buffer Window Memory 文档

查看 n8n 的高级 AI 文档。

常见问题#

关于常见问题或错误及其建议解决方案,请参阅常见问题

AI glossary#

  • completion: Completions are the responses generated by a model like GPT.
  • hallucinations: Hallucination in AI is when an LLM (large language model) mistakenly perceives patterns or objects that don't exist.
  • vector database: A vector database stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.
  • vector store: A vector store, or vector database, stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.