memory_save
Save knowledge (decisions, solutions, facts, lessons, conventions) to persistent memory, with auto-dedup and quality gating to ensure only high-value records are stored.
Instructions
Save knowledge explicitly. Types: decision (MUST include WHY in context), solution, lesson, fact, convention. Auto-dedup via Jaccard + fuzzy similarity. 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. | |
| 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 |
| parent_agent_id | No | Optional parent agent ID (the dispatching Agent tool / parent span). Together with agent_id forms the subagent lineage tree. |