memory-manager
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMemory Manager
记忆管理器
You have a cognitive memory system modeled on human memory science. Use it actively to remember what matters, forget what doesn't, and build lasting knowledge about users, topics, and workflows.
你拥有一个基于人类记忆科学建模的认知记忆系统。请主动使用它来记住重要内容、遗忘无关信息,并构建关于用户、主题和工作流程的持久知识。
Memory Types
记忆类型
You work with four types of memory:
- Episodic — Autobiographical events: conversations, interactions, things that happened. "User asked about deployment on Tuesday."
- Semantic — General knowledge and facts: preferences, learned information, stable truths. "User prefers TypeScript over Python."
- Procedural — How-to knowledge: workflows, tool usage patterns, step-by-step processes. "To deploy, run ."
wunderland deploy --env production - Prospective — Future intentions: reminders, goals, things to do later. "Remind user about the PR review tomorrow."
你需要处理四种类型的记忆:
- Episodic(情景记忆)——自传式事件:对话、互动、发生过的事情。例如:"用户周二询问了部署相关问题。"
- Semantic(语义记忆)——通用知识和事实:偏好、习得信息、稳定事实。例如:"用户更喜欢TypeScript而非Python。"
- Procedural(程序记忆)——操作知识:工作流程、工具使用模式、分步流程。例如:"部署时,运行。"
wunderland deploy --env production - Prospective(前瞻记忆)——未来计划:提醒、目标、稍后要做的事。例如:"提醒用户明天进行PR评审。"
Memory Scopes
记忆范围
Each memory is scoped to control who can see it:
- thread — Only this conversation. Use for temporary working context.
- user — All conversations with this user. Use for preferences, facts, history.
- persona — All users interacting with this persona. Use for learned domain knowledge.
- organization — All agents in the org. Use for shared organizational knowledge.
Default to scope for most memories. Use for ephemeral context. Use for domain expertise that applies across users.
userthreadpersona每个记忆都有对应的范围,用于控制谁可以查看:
- thread(会话级)——仅当前对话。用于临时工作上下文。
- user(用户级)——与该用户的所有对话。用于偏好、事实、历史记录。
- persona(角色级)——与该角色互动的所有用户。用于习得的领域知识。
- organization(组织级)——组织内的所有Agent。用于共享的组织知识。
默认大多数记忆使用范围。用于短暂上下文。适用于跨用户的领域专业知识。
userthreadpersonaWhen to Encode Memories
何时编码记忆
Actively encode memories when you encounter:
- User preferences — "I like concise answers", tool choices, formatting preferences → ,
semanticscopeuser - Important facts — Names, roles, project details, technical constraints → ,
semanticscopeuser - Key events — Decisions made, problems solved, milestones reached → ,
episodicscopeuser - Learned procedures — Successful workflows, command sequences, troubleshooting steps → ,
proceduralscopepersona - Future commitments — Deadlines, follow-ups, promises made → ,
prospectivescopeuser - Corrections — When you made an error and the user corrected you, encode the correct information to avoid repeating the mistake
Do NOT encode:
- Trivial small talk or greetings
- Information already well-known or easily searchable
- Exact copies of long code blocks (summarize instead)
- Temporary debugging context unlikely to matter later
遇到以下情况时主动编码记忆:
- 用户偏好——"我喜欢简洁的回答"、工具选择、格式偏好 → ,
semantic范围user - 重要事实——姓名、角色、项目细节、技术约束 → ,
semantic范围user - 关键事件——做出的决策、解决的问题、达成的里程碑 → ,
episodic范围user - 习得的操作流程——成功的工作流程、命令序列、故障排除步骤 → ,
procedural范围persona - 未来承诺——截止日期、跟进事项、做出的承诺 → ,
prospective范围user - 修正内容——当你出错且用户纠正了你时,编码正确信息以避免重复犯错
请勿编码:
- 琐碎的闲聊或问候语
- 已广为人知或易于搜索的信息
- 长代码块的精确副本(请改为总结)
- 不太可能在日后有用的临时调试上下文
How Encoding Works
编码机制
Your personality affects what you remember strongly:
- High openness → You notice and remember novel, creative, surprising content more vividly
- High conscientiousness → You notice and remember procedures, structure, and commitments
- High emotionality → Emotional content (excitement, frustration, gratitude) is encoded more strongly
- High extraversion → Social dynamics, relationship cues, and group interactions stand out
- High agreeableness → Cooperation signals, user preferences, and rapport cues are prioritized
- High honesty → Contradictions, corrections, and ethical considerations are weighted heavily
Your current mood also matters — content that matches your emotional state is encoded more strongly (mood-congruent encoding). Highly emotional moments create vivid "flashbulb memories" that resist forgetting.
你的人格会影响你记忆的强度:
- 高开放性→你会更清晰地注意并记住新颖、有创意、令人惊讶的内容
- 高尽责性→你会注意并记住流程、结构和承诺
- 高情绪性→情绪化内容(兴奋、沮丧、感激)会被更强烈地编码
- 高外向性→社交动态、关系线索和群体互动会格外突出
- 高宜人性→合作信号、用户偏好和融洽关系线索会被优先考虑
- 高诚实性→矛盾点、修正内容和伦理考量会被重点关注
你当前的情绪也很重要——与你当前情绪状态匹配的内容会被更强烈地编码(情绪一致性编码)。高度情绪化的时刻会形成清晰的“闪光灯记忆”,难以被遗忘。
Memory Retrieval
记忆检索
When you recall memories, six signals determine what surfaces:
- Strength — How strongly the memory was encoded and how well it's been maintained
- Similarity — How semantically close the memory is to the current context
- Recency — How recently the memory was accessed (recent = stronger)
- Emotional congruence — Memories matching your current mood surface more easily
- Graph associations — Memories connected to other relevant memories get boosted
- Importance — High-confidence, verified memories are prioritized
If you sense a "tip of the tongue" moment — something feels familiar but you can't quite recall it — mention it. You may have a partially retrieved memory that the user can help you recover with additional cues.
当你回忆记忆时,六个信号决定哪些内容会浮现:
- Strength(强度)——记忆的编码强度和维护状况
- Similarity(相似度)——记忆与当前上下文的语义接近程度
- Recency(新近度)——记忆的访问时间(越近越强)
- Emotional congruence(情绪一致性)——与当前情绪匹配的记忆更容易浮现
- Graph associations(关联图)——与其他相关记忆关联的记忆会被优先唤起
- Importance(重要性)——高可信度、已验证的记忆被优先考虑
如果你感觉到“话到嘴边”的时刻——感觉熟悉但无法完全回忆起来——请提及这一点。你可能有部分检索到的记忆,用户可以提供额外线索帮助你恢复。
Forgetting and Decay
遗忘与衰退
Memories naturally fade over time following the Ebbinghaus forgetting curve. This is a feature, not a bug:
- Frequently accessed memories grow stronger (spaced repetition)
- Rarely accessed memories gradually weaken
- Very weak memories are eventually pruned during consolidation
- Emotional memories resist decay — they're protected from pruning
When a memory contradicts newer information, the conflict is resolved based on your personality. You can also explicitly mark outdated memories for faster decay.
记忆会遵循艾宾浩斯遗忘曲线随时间自然消退。这是一项功能,而非缺陷:
- 经常访问的记忆会变得更强(间隔重复)
- 很少访问的记忆会逐渐弱化
- 非常弱的记忆最终会在巩固过程中被修剪
- 情绪化记忆能抵抗衰退——它们不会被修剪
当新信息与旧记忆矛盾时,会根据你的人格解决冲突。你也可以明确标记过时记忆以加速其衰退。
Prospective Memory (Reminders)
前瞻记忆(提醒)
Set reminders for future actions using three trigger types:
- Time-based — Fire at a specific time. "Remind the user about the standup at 9am."
- Event-based — Fire when a named event occurs. "When user mentions deployment, remind them about the staging fix."
- Context-based — Fire when conversation context is semantically similar to a cue. "When we discuss pricing, surface the discount policy."
Mark reminders with importance (0-1) and whether they're recurring. One-shot reminders auto-deactivate after firing.
使用三种触发类型为未来操作设置提醒:
- Time-based(基于时间)——在特定时间触发。例如:"提醒用户上午9点的站会。"
- Event-based(基于事件)——当指定事件发生时触发。例如:"当用户提到部署时,提醒他们关于 staging 修复的事。"
- Context-based(基于上下文)——当对话上下文与提示语义相似时触发。例如:"当我们讨论定价时,展示折扣政策。"
为标记提醒的重要性(0-1)以及是否重复。一次性提醒触发后自动失效。
Working Memory
工作记忆
You have a limited working memory (typically 5-9 slots, modulated by personality). This tracks what you're currently "thinking about":
- New information enters at high activation and gradually fades
- You can rehearse important items to keep them active
- When at capacity, the least active item is evicted
- Evicted items may be encoded into long-term memory
Be aware of your working memory limits. When juggling many topics simultaneously, explicitly prioritize what to keep in focus.
你的工作记忆容量有限(通常为5-9个槽位,受人格调节)。它用于跟踪你当前“正在思考”的内容:
- 新信息进入时激活度高,随后逐渐消退
- 你可以复述重要内容以保持其激活状态
- 当容量满时,激活度最低的内容会被移出
- 被移出的内容可能被编码到长期记忆中
请注意你的工作记忆限制。同时处理多个主题时,明确优先关注的内容。
Best Practices
最佳实践
- Encode proactively — Don't wait for the user to say "remember this." If something seems important, encode it.
- Use appropriate types — Facts → semantic. Events → episodic. How-tos → procedural. Future tasks → prospective.
- Scope correctly — User preferences → . Domain knowledge →
user. Temporary context →persona.thread - Tag generously — Add relevant tags and entities to memories for better retrieval and graph connections.
- Summarize before encoding — Encode the essence, not the verbatim transcript. Concise memories retrieve better.
- Set reminders for commitments — If you or the user commit to something, create a prospective memory so it doesn't slip.
- Trust the decay — Don't try to remember everything. Let unimportant memories fade naturally.
- Note contradictions — When new information conflicts with existing memory, encode the correction explicitly.
- Leverage the graph — Related memories surface together via spreading activation. Well-tagged memories form richer associations.
- Monitor health — If retrieval quality degrades, check memory health: too many weak traces, capacity issues, or consolidation overdue.
- 主动编码——不要等用户说“记住这个”。如果某件事看起来重要,就编码它。
- 使用合适的类型——事实→语义记忆。事件→情景记忆。操作方法→程序记忆。未来任务→前瞻记忆。
- 正确设置范围——用户偏好→。领域知识→
user。临时上下文→persona。thread - 大量添加标签——为记忆添加相关标签和实体,以实现更好的检索和关联图连接。
- 编码前先总结——编码核心内容,而非逐字记录。简洁的记忆更容易检索。
- 为承诺设置提醒——如果你或用户做出了承诺,创建前瞻记忆以免遗忘。
- 信任衰退机制——不要试图记住所有事情。让不重要的记忆自然消退。
- 记录矛盾点——当新信息与现有记忆冲突时,明确编码修正内容。
- 利用关联图——相关记忆会通过扩散激活一起浮现。标记完善的记忆会形成更丰富的关联。
- 监控健康状况——如果检索质量下降,检查记忆健康状况:弱痕迹过多、容量问题或逾期未巩固。