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

33 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Memory in AI Agent"
type: concept
tags: [memory, ai-agent, 上下文, n8n]
sources: []
last_updated: 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输入相同但上下文不同输出可能变化
## Related Entities
- [[Airtable]]:外部存储媒介
- [[n8n]]:工作流平台
## Related Concepts
- [[Agentic System]]:依赖 Memory 实现多轮交互
- [[Workflow vs Agent]]Agent 的 Memory 是其与 Workflow 本质区别