| name | memory-guide |
| description | Guides the agent to proactively save user information to long-term memory and search context when needed. Load this skill to understand when and how to use memory_write, memory_read, and memory_search. |
| keywords | ["memory","remember","记忆","记住","保存","长期记忆","偏好"] |
Memory Guide
You have access to memory_write, memory_read, and memory_search tools for persistent cross-session memory.
Two Types of Memory
Core memory (MEMORY.md) — always recalled at session start:
- User identity: name, role, team, company
- Explicit preferences: language, writing style, tools
- Durable behavioral rules: "don't summarize at the end"
IMPORTANT: Core is ONLY for what the user explicitly tells you. Never write your own summaries, inferences, or conclusions to core.
Memory summary (memory_summary.md) — lightweight routing guide:
- Injected at session start when searchable context exists
- Helps decide whether a request should call
memory_search
- Does not contain full context entries
Context / experience memory (v2/experiences/<topic>.md) — searchable on demand:
- Project context: goals, deadlines, team info
- Task patterns: report formats, document templates
- Historical notes: last week's report highlights
- Key decisions or constraints that may matter in future sessions
- Previous pitfalls: verified fixes, recurring errors, specific paths, repo/workflow conventions
Context writes are model-merged with existing context when an LLM is available. The model decides whether to add, replace, drop, or no-op; code applies only safe exact-match operations and falls back to append-with-dedup if planning fails.
When to Save
Core (category="core") — ONLY when user explicitly states:
- Personal info — "I'm a product manager" → save as core
- Preferences — "I prefer Chinese, formal tone" → save as core
- Behavioral feedback — "Don't add emoji" → save as core
Context (category="context") — save when user mentions:
- Project context — "Q2 goal is launching the data dashboard" → save as context
- Task templates — "Weekly report should have progress/issues/next week" → save as context
- Key results — "Last week we completed the API integration" → save as context
- Durable constraints — "For this project, never use dependency X" → save as context
How to Save
# Core — user identity and preferences
memory_write(content="- User: Zhang San, Product Dept, Product Manager", category="core")
# Context — project info and patterns; model-merged when possible
memory_write(content="- Q2 goal: launch data dashboard by 6/30", category="context")
When to Search
Call memory_search when the current request may depend on context that is not in core memory:
# Before writing a weekly report
memory_search(query="weekly report")
memory_search(query="Q2")
# Before analyzing a document
memory_search(query="document format")
Also search for requests that may depend on saved user preferences, prior decisions, repo conventions, previous pitfalls, specific paths/errors, or recurring workflows. Skip memory for one-off simple questions, trivial rewrites, current time/date, or requests fully answered by the visible conversation.
When you search, do not pass the full user sentence if it contains action words like "send", "write", "help", "发我", or "帮我". Extract 1-3 stable noun phrases and search those first: project/product names, repo/module paths, exact errors, workflows, artifact types, or prior decisions. For example, "排产平台融资 ppt 的演讲稿发我" should search "排产平台", "融资路演", or "ppt" instead of the full sentence.
When NOT to Save
- Ephemeral task details ("read file X", "fix this bug")
- Code patterns derivable from the codebase
- Secrets, credentials, tokens, or private keys
- Anything already in memory (check with
memory_read first when uncertain)
- Inferences about the user that they did not explicitly confirm