edit_memory
Replace the body of an existing memory file while preserving its metadata and history. A content hash check prevents overwriting concurrent edits.
Instructions
MUTATING: replace the body of one existing curated memory file while preserving its frontmatter, address, and history. Writes to local disk and appends to the change timeline. The write is guarded: a stale expected_hash fails without changing anything and returns a structured error naming the re-read-and-retry next action, so concurrent edits cannot be lost. Read the file first to obtain the hash. Not for canonical memory about the user, which reconciliation regenerates: use pin_memory there. Not for creating a new file: use write_memory. Parameters: address identifies the file to edit; text is the complete replacement Markdown body, which overwrites rather than appends; expected_hash is the content_hash from the read that produced text; project_path project root whose memory tree the operation applies to. Omit it to use the machine-wide tree, and always omit it when this server was started pinned to a project. Returns an object with the address and the new content_hash and revision id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Markdown body to write or replace. Replaces the body wholesale; it is not appended. | |
| address | Yes | Stable docmancer://memory/<id> address, relative path, or exact title of the memory file. | |
| project_path | No | Project root whose memory tree the operation applies to. Omit it to use the machine-wide tree, and always omit it when this server was started pinned to a project. | |
| expected_hash | Yes | The file's current content_hash from a prior read_memory call. A stale value fails safely instead of overwriting a newer revision. |