memory_write
Save a fact, preference, decision, or note to the user's cross-model memory. Any MCP client can read this back later. Include written_by (e.g. 'claude-code', 'gpt-5', 'kimi-k2') for provenance and session_id to group related writes. Long content (>400 chars) is automatically compressed on write to a structured-facts form optimized for LLM reading — the raw text is preserved. Pass no_optimize:true to skip. Writes are deduped by default: (1) SHA-256 of trim(content) short-circuits byte-identical writes with { id, exact_duplicate:true } for free (no embed call); (2) failing that, semantic dedup returns { id, deduped:true, matched_score } when cosine ≥ 0.85. Pass force:true to bypass both, or use memory_supersede to explicitly correct a prior memory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Optional short labels for filtering (e.g. ['preference','stack']). | |
| force | No | Bypass semantic dedup and write anyway. Default false. | |
| content | Yes | The fact or note to remember. Plain text, max 8000 characters. | |
| session_id | No | Opaque identifier grouping related writes from the same conversation. | |
| written_by | No | Identifier of the model / client writing this (e.g. 'claude-code', 'gpt-5', 'kimi-k2', 'manual'). | |
| no_optimize | No | Skip AI compression of long content. Default false. |