Create or edit a memory
Without id, creates a memory, and outcome is one of:
saved: the memory was written.replaced: a lesson or fact of the same kind was similar enough to count as a near-duplicate ([memory] duplicate_similarity). The new memory was written and the old one deleted;previous_titlenames it.duplicate: nothing was written, andidis the memory that already exists. This happens when the same text is already stored under the same id, and when an episode has a near-duplicate episode, because episodes are never replaced.
With id, edits that memory. A successful edit always answers
replaced, with the memory’s id after the edit and its own old title
in previous_title. Tell an edit from a replaced near-duplicate by
whether you sent id. An edit that changes the kind or text changes
the id, because the id derives from both. If that new id belongs to a
different memory that already exists, nothing is written and the
answer is duplicate with that memory’s id.
Writes are serialised inside the dashboard.
Request
lesson, fact or episode (case-insensitive).
global or an empty string for a global memory; otherwise the project path it applies to.
Leave out to create a memory. Give an existing id (or unique prefix) to edit it. A blank id is refused.
Response
Either a new memory replaced a near-duplicate of the same kind,
which is now gone, or an edit succeeded. id is the memory’s id
after the write.
Nothing was written. id is the memory that already exists: the
same text under the same id, a near-duplicate episode, or the
memory an edit’s new id would collide with.