Update agent memory
PATCH/v2/agents/:agent_key/memory
Replace the agent's _learned_memory skill content. The submitted content fully replaces the previous memory — the API does not append.
Each successful update increments memory_version and records a full snapshot in the memory history.
To guard against concurrent updates, pass expected_version equal to the memory_version you last read.
If it no longer matches the current version, the update is rejected with 409 Conflict; re-read the memory and retry.
Omit expected_version to update unconditionally.
Request
Responses
- 200
- 400
- 403
- 404
- 409
The agent's memory after the update.
Invalid request (e.g. content exceeds the size limit).
Permissions do not allow modifying this agent.
Agent not found.
The memory was modified concurrently; the provided expected_version no longer matches the current version.