Files
nexus/wiki/concepts/Memory-in-AI-Agent.md

1.1 KiB
Raw Blame History

title, type, tags, sources, last_updated
title type tags sources last_updated
Memory in AI Agent concept
memory
ai-agent
上下文
n8n
2025-03-06

Definition

Memory记忆是 AI Agent 保持多轮对话上下文连贯性的机制,通过在每次交互中注入历史消息,使 Agent 能够记住之前的对话内容,输出更相关和连贯的响应。

工作原理

  1. 每次对话 → 将历史消息追加到 context
  2. Agent 在决策时读取完整 context
  3. 结合 Memory + 当前输入 → 生成响应

N8N 实现

N8N AI Agent 节点内置 Memory 配置,支持:

  • 对话历史注入
  • 与外部数据库(如 Airtable)联动存储长期记忆

与传统 Workflow 的区别

  • Workflow完全确定性每次执行相同输入=相同输出
  • 带 Memory 的 Agent输入相同但上下文不同输出可能变化