A write is accepted asynchronously, so this addresses the operation rather
than the memory it will become. There is no idx to read here, and a revert
issued straight away can report RevertOutcome.NOT_FOUND because
ingestion has not finished.
operationId is null when the write was accepted but no id could be
minted: the content is worth more than the ability to undo it, so that
degrades the write rather than rejecting it.
MemoryOperations.revertMemory takes a string, so narrow it rather
than asserting — a null fed back in is refused locally as a blank
operation_id, which is a confusing way to be told the write was fine.
Example
constwritten = awaitsession.createMemory({ query:'how do I authenticate against the memory API', title:'The Bearer prefix is case-sensitive', content:'A lowercase bearer is rejected with UNAUTHENTICATED.' }) if (written.operationId !== null) { awaitsession.revertMemory(written.operationId) }
What MemoryOperations.createMemory and MemoryOperations.enrichMemory return.
A write is accepted asynchronously, so this addresses the operation rather than the memory it will become. There is no idx to read here, and a revert issued straight away can report RevertOutcome.NOT_FOUND because ingestion has not finished.
operationIdisnullwhen the write was accepted but no id could be minted: the content is worth more than the ability to undo it, so that degrades the write rather than rejecting it. MemoryOperations.revertMemory takes astring, so narrow it rather than asserting — anullfed back in is refused locally as a blankoperation_id, which is a confusing way to be told the write was fine.Example