观点
出自《The components of agent memory》· Dreaming can promote notes up the memory hierarchy
拥有长期历史的 AI agent 无法把每一段过往经历都塞进每一次新对话中。Anthropic 描述了持久记忆的四个层次:可搜索的会话记录、关于有用经验的笔记、相互关联的知识(如 wiki),以及启动时加载的少量上下文。一个简短的启动索引告诉 agent 存在哪些知识以及在哪里可以找到它们,而详细笔记则保留下来供按需检索。Claude Code 通过仅加载其 MEMORY.md 索引的前 200 行或 25 KB 来体现这一方法。
适用条件
对于稳定且经常需要的指导或指引,可使用自动加载。过长或不准确的启动指令会消耗上下文,并导致错误在多次会话中重复出现;即便是已加载的指令也可能被忽略。Claude Code 的大小限制只是一个实现示例,并非普遍适用的最优值。
译自英文 · 看原文
AI agents should load a short memory index at the start of each session and retrieve detailed knowledge only when needed.
An AI agent with a long history cannot fit every past experience into each new conversation. Anthropic describes four layers of persistent memory: searchable session records, notes about useful experiences, linked knowledge such as wikis, and a small amount of context loaded at startup. A short startup index tells the agent what knowledge exists and where to find it, while detailed notes stay available for on-demand retrieval. Claude Code illustrates this approach by loading only the first 200 lines or 25 KB of its MEMORY.md index.
Use automatic loading for stable, frequently needed guidance or pointers. Long or inaccurate startup instructions can consume context and repeat mistakes across sessions; even loaded instructions may be ignored. The Claude Code size limit is an implementation example, not a general optimum.
翻译:deepseek-flash
