memory_save
Persist knowledge for future recall by saving decisions, solutions, lessons, facts, and conventions with context and importance.
Instructions
Save knowledge explicitly. Types: decision (MUST include WHY in context), solution, lesson, fact, convention. Saving the same words again (case and punctuation aside) replaces the stored record, so it carries the latest date; any other text, including a changed value, is stored as a new record. v10: a quality gate scores the record before save; below-threshold records are rejected with a rejected_by_quality_gate: true response (override with MEMORY_QUALITY_GATE_ENABLED=false). Use importance to surface critical decisions at recall time (boosts the final RRF score). v11.0: routes to fast hot path when MEMORY_MODE=fast (default). Use memory_save_fast for explicit fast routing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| type | Yes | ||
| coref | No | Opt into v10 coreference rewrite — expand pronouns ('after this it broke') into self-contained text using recent session history. Costs ~1s LLM round-trip; default off. | |
| branch | No | Git branch this knowledge relates to | |
| filter | No | Optional content filter (pytest|cargo|git_status|docker_ps|generic_logs). Trims noisy CLI output while preserving URLs/paths/code. | |
| content | Yes | The knowledge to save | |
| context | No | Additional context, WHY for decisions | |
| project | No | general | |
| agent_id | No | Optional Claude Code subagent ID (x-claude-code-agent-id header / OTEL agent_id attribute, v2.1.139+). Lets recall trace which subagent produced this knowledge. | |
| supersede | No | Retire active records of the same project and type that this one gives a new value for: same opening words, different trailing value ("X's citizenship is Argentina" -> "... is Armenia"). Use for single-valued facts only; "likes jazz" would retire "likes rock". The retired ids are returned as `superseded`. | |
| importance | No | Recall-time boost: critical x1.5, high x1.2, medium x1.0, low x0.8. Reserve `critical` for migration-blocking decisions and security incidents. | medium |
| source_format | No | Conversation preserves dialogue structure and bypasses automatic CLI filters. | auto |
| parent_agent_id | No | Optional parent agent ID (the dispatching Agent tool / parent span). Together with agent_id forms the subagent lineage tree. |