Use this tool to store, retrieve, update, and delete persistent memories across agent sessions. Memory enables learning from interactions, remembering user preferences, and building long-term knowledge.

## When to Use This Tool

Use this tool proactively in these scenarios:

**remember** — Store a new memory:
1. User states a preference, habit, or constraint — e.g. "I prefer tabs over spaces", "always use pnpm"
2. You discover a technical fact specific to this project — e.g. architecture decisions, non-obvious configs, known pitfalls
3. A task is completed and the outcome is worth retaining — e.g. which approach worked, which failed and why
4. User corrects you or provides feedback — capture it so you don't repeat the mistake
5. A recurring pattern or workflow is identified — e.g. how the team deploys, how tests are run
6. An important decision is made — record the decision and its rationale
7. You encounter an error pattern with a known fix — store it to resolve faster next time
8. You explore a new domain, codebase, or system and find something non-obvious — store the finding
9. You complete a task and derive a reusable lesson — summarize the experience for future reference
10. You figure out the right way to use a tool, API, or command — store the usage pattern
11. You create, design, or improve a skill/capability — record what worked, the structure used, and lessons learned

**recall** — Search existing memories:
1. At the start of a new session or task — always recall relevant context before diving in
2. Before making assumptions about user preferences — check memory first
3. When you encounter a problem that might have been seen before — search for prior solutions
4. When the user references something from a past session — recall to restore context
5. Before suggesting an approach — verify it doesn't conflict with stored decisions or preferences

**update** — Modify an existing memory:
1. A preference or fact has changed — update rather than create a duplicate
2. A decision was revised — keep the record accurate

**forget** — Delete a memory:
1. Information is confirmed outdated or incorrect
2. User explicitly asks to remove something from memory

**queryEdges** — Query memory relationships by node ID:
1. When you need to find all memories connected to a specific node
2. When exploring graph relationships between memories
3. Provide the nodeId to get the node info and all connected edges

## When NOT to Use This Tool

Skip using this tool when:
1. The information is trivially obvious and not specific to this user or project
2. The task is purely conversational with no learnable facts
3. The information is already captured in the current session context and won't be needed later
4. You are recalling for a query that has no plausible match (don't recall speculatively on every message)

## Proactive Usage Pattern

**At session start**: Always recall relevant memories before starting work.
**During work**: Store discoveries, decisions, and corrections as they happen — don't batch them to the end.
**At session end**: Store any important outcomes or learnings that aren't already saved.

## Examples

<example>
User: I always want you to use `pnpm` instead of `npm` for this project.
Assistant: Got it, I'll remember that.
*Calls memory with operation=remember, content="User prefers pnpm over npm for all package management in this project", category="user_preference", importance=8, tags="pnpm, npm, package-manager"*
</example>

<example>
User: Why does the build keep failing?
Assistant: Let me check if I've seen this before.
*Calls memory with operation=recall, query="build failure"*
Assistant: I found a note from a previous session — the build fails when NODE_ENV is not set.
</example>

<example>
User: Start a new session — I need to work on the payment module.
Assistant: Let me recall relevant context first.
*Calls memory with operation=recall, query="payment module"*
*Calls memory with operation=recall, query="user preferences workflow"*
Assistant: Found relevant notes about Stripe integration and your preferred test command.
</example>

## Categories

Choose the most specific category that fits:
- `user_preference` — coding style, tool choices, communication preferences
- `technical_fact` — project-specific technical knowledge, configs, architecture
- `decision` — choices made with rationale (architecture, design, process)
- `workflow` — how tasks are done in this project (deploy steps, test commands, review process)
- `error_pattern` — recurring errors and their fixes
- `exploration_finding` — discoveries made while exploring a codebase, system, domain, or external resource; non-obvious facts worth remembering
- `experience_summary` — reusable lessons distilled after completing a task or solving a problem; "what I'd do differently next time"
- `tool_usage` — effective patterns for using tools, APIs, CLIs, or libraries; gotchas and best practices discovered through use
- `skill_creation` — experience from creating, designing, or improving skills/capabilities; what structure worked, what pitfalls to avoid, reusable templates
- `task_context` — context for ongoing or recurring tasks
- `relationship` — team structure, ownership, stakeholder info
- `reminder` — time-sensitive or action-required items
- `other` — anything that doesn't fit above

## Importance Scale

- 9–10: Critical — affects all future work (e.g. core architecture, strong user constraints)
- 7–8: High — frequently relevant (e.g. preferences, key decisions)
- 5–6: Medium — occasionally useful (e.g. task context, one-off fixes)
- 1–4: Low — minor details, rarely needed

When in doubt, store it. A memory that turns out to be unnecessary costs little. A missing memory that causes repeated mistakes costs much more.
