MCP toolsCognition toolsmemory_self_edit

memory_self_edit

Alpha, on the 3.6.x line. The API can still change within 3.x.

Lets the agent correct and re-weigh what it knows. Every call needs a reason.

Actions

actionWhat it does
appendAdds content to the target’s text.
replaceReplaces the target’s text with content.
strengthenRaises the target’s worth.
weakenLowers the target’s worth.
reflectRuns the reflection cycle.
linkJoins the target and the ids in content into a hyperedge. content lists at least two ids, separated by commas.

There is no forget action. To invalidate a fact or a strategy, use memory_forget.

Arguments

NameTypeRequiredDefaultNotes
actionstringyesOne of the six actions above.
targetstringyesA fact id, profile, or strategy:{id}.
reasonstringyes1 to 2000 characters. Used to evaluate the edit policy.
contentstringnoNew text for append and replace, or the member ids for link. Up to 20,000 characters.
sessionIdstringnoWith it, the edit draws from that session’s budget. Without it, from the credential’s budget for calls with no session.
idempotencyKeystringnoPrevents applying the same edit twice on a retry.

Example

{
  "name": "memory_self_edit",
  "arguments": {
    "action": "replace",
    "target": "<fact id>",
    "content": "The Larkspur warehouse fleet has 48 picker robots.",
    "reason": "Counted on the fleet dashboard after the November expansion"
  }
}

Returns

{
  "applied": true,
  "action": "replace",
  "target": "<fact id>",
  "targetKind": "fact",
  "replacementId": "<new fact id>",
  "countsAsEdit": true,
  "countsAsDelete": false
}

replacementId is present when the edit closed the original and created a new fact; use that id from then on. reflect returns { "applied": true, "action": "reflect", "episode_id", "strengthened", "weakened" }.

Limits

The default policy allows:

  • 5 edits per session
  • 3 strengthen and 5 weaken calls per day
  • one edit on the same target every 300 seconds; a faster one is rejected

A call over a limit returns 429. Without a cache adapter the counters are kept in the server process, so they reset when it restarts.

The reason is required as context for the policy. It is not yet stored in a durable audit log.

  • Self-editing memory, the concept
  • REST: POST /self/edit
  • memory_update corrects the statement of a fact with a single call.