memory_strategy

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

Manages strategies: a trigger (the situation) paired with an action (what to do). This tool names its operation op, because action is the field that holds the response to run.

Operations

opNeedsWhat it does
storetrigger, actionCreates a strategy. create is the same operation.
recallLists the active strategies. It does not search by situation.
listLists strategies. Filters: statusFilter, scopeRef, validAt, limit.
rateid, outcomeRecords that the strategy worked or failed.
getidReturns one strategy.
patchidChanges trigger, action, context, status, validTo or metadata.
archiveidArchives the strategy.

To find a strategy by meaning, use memory_recall: strategies are among the kinds a default recall returns.

Arguments

NameTypeRequiredDefaultNotes
opstringyesOne of create, store, get, list, recall, patch, archive, rate.
triggerstringper operationThe situation. Up to 20,000 characters.
actionstringper operationWhat to do when the trigger matches. Up to 20,000 characters.
idstringper operationStrategy id. For get, patch, archive and rate.
outcomestringper operationsuccess or failure. For rate.
contextstringnoWhen the strategy applies, in free text.
agentIdstringnoThe agent the strategy belongs to. For create and store.
scopeRefstringnoProject or entity the strategy is scoped to. Also a filter in list and recall.
supersedesIdstringnoId of a strategy this one replaces. That strategy is closed.
validFromstringnoWhen the strategy starts to apply. ISO 8601 UTC instant. For create and store.
validTostringnoWhen it stops applying. For patch.
statusstringnoactive, superseded or archived. For patch.
statusFilterstringnoactive in recallFor list and recall: only strategies in this status.
validAtstringnoFor list and recall: only strategies valid at this instant.
limitintegernoFor list and recall. 1 to 500.
metadataobjectnoFor create, store and patch.
sensitivitystringnointernalFor create and store.
idempotencyKeystringnoFor create and store. Prevents a duplicate strategy on a retry.
targetWorkspaceIdstringnoFor create and store. UUID of another workspace where you have write access.

Example

{
  "name": "memory_strategy",
  "arguments": {
    "op": "store",
    "trigger": "A picker robot stalls after a firmware update",
    "action": "Restore the torque limit, then run the loaded-bin test before returning the unit to the floor",
    "context": "Larkspur warehouse fleet"
  }
}

Returns

store, create, get, patch and rate return the strategy record: id, workspaceId, trigger, action, successCount, failureCount, worth, status, validFrom, createdAt, updatedAt and metadata, plus the optional fields that are set. list and recall return { "items", "total" }. archive returns { "id", "archived": true }.

rate is not idempotent. Each call adds one to successCount or failureCount, and the server recomputes worth.