write_memory
Create or update curated memory files in the memory tree to persist durable decisions, constraints, or conventions, using an expect guard to prevent accidental overwrites.
Instructions
MUTATING: create or update one curated memory file in the memory tree, addressed as docmancer://memory/. Writes to local disk and appends to the change timeline; never silently clobbers, because the expect guard decides whether an existing file may be replaced. Use it to record a durable decision, constraint, or convention. Not for correcting the reconciled canonical memory about the user, which is regenerated and would discard the edit: use pin_memory for that. To change only the body of an existing file, prefer edit_memory. Parameters: relative_path is the file's path in the tree and must include the Markdown suffix; text is the full Markdown body; expect is the write guard, 'absent' (default) to create only and fail if the path exists, or the current content_hash to permit a guarded overwrite; memory_type, scope, authority, status, and curation_origin are frontmatter labels described in the schema; project_id names the owning project; sources lists backing file paths or URLs; tags lists retrieval labels; 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 stable address, the new content_hash, and the revision id, all of which later guarded calls need.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Labels used to classify and retrieve the memory content. | |
| text | Yes | Markdown body to write or replace. Replaces the body wholesale; it is not appended. | |
| scope | No | Memory visibility scope stored in frontmatter. Use global for machine-wide memory or project for project-scoped memory. | global |
| expect | No | Create/update guard, and not an enum: pass the literal string absent for create-only, or the file's current content_hash for a guarded update. | absent |
| status | No | Free-form lifecycle status stored in frontmatter. Only active entries are recalled. Defaults to active. | active |
| sources | No | Source references that back the memory content. | |
| authority | No | How binding the memory is. mandatory entries are always included in a recall bundle; advisory entries compete on relevance. Defaults to advisory. | advisory |
| project_id | No | Project identifier stored in the memory file frontmatter. Omit unless the memory belongs to a named project. | |
| memory_type | No | Free-form memory classification stored in frontmatter. Defaults to fact. | fact |
| 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. | |
| relative_path | Yes | Relative path, including the .md suffix, for the memory file inside its selected memory tree. | |
| curation_origin | No | Free-form origin label stored in frontmatter recording how the memory was created. Defaults to deliberate_write. | deliberate_write |