memory_reasoning
Alpha, on the 3.6.x line. The API can still change within 3.x.
Stores a chain of reasoning (a question, the steps and the conclusion)
so it can be reused. Before working through a problem, resolve checks
whether a similar question was already answered.
Actions
action | Needs | What it does |
|---|---|---|
resolve | query | Looks a question up in the stored reasoning. |
record | question, chain, conclusion | Stores a chain, with an optional outcome. |
feedback | reasoningId, outcome | Rates a stored chain as success or fail. |
create | question, chain, conclusion | Creates a reasoning record. |
get | id | Returns one record. |
list | Lists records. Filters: status, topicKeyFilter, limit. | |
patch | id | Changes status, chain, conclusion or metadata. |
archive | id | Archives the record. |
Arguments
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
action | string | yes | One of the eight actions above. | |
query | string | per action | The question to look up. For resolve. | |
question | string | per action | The question reasoned about. Up to 20,000 characters. | |
chain | object[] | per action | The steps, in order. Each one is { "step", "reasoning", "conclusion" }; conclusion is optional. Up to 200 steps. | |
conclusion | string | per action | Where the reasoning ended. | |
reasoningId | string | per action | The record to rate. For feedback. | |
outcome | string | per action | success or fail. Required for feedback, optional for record. | |
id | string | per action | Record id. For get, patch and archive. | |
topicKey | string | no | Groups records about the same question. For create, record and resolve. | |
agentId | string | no | The agent that reasoned. For create and record. | |
status | string | no | active, archived, pruned, quarantined or golden. New status in patch, filter in list. | |
metadata | object | no | For create and patch. | |
sensitivity | string | no | internal | For create and record. |
topicKeyFilter | string | no | For list: only records with this topic key. | |
limit | integer | no | For list. 1 to 500. | |
targetWorkspaceId | string | no | For create only, not for record. UUID of another workspace where you have write access. |
Example
{
"name": "memory_reasoning",
"arguments": {
"action": "resolve",
"query": "Why does a Larkspur picker robot stall after a firmware update?"
}
}Returns
resolve returns an action field. hit means a stored chain matches,
and the response carries reasoning_id, cached_cot (the steps) and
conclusion. execute means nothing matched and the agent should reason
it through; similar_attempts can list near matches.
{
"action": "hit",
"reasoning_id": "<reasoning id>",
"cached_cot": [
{ "step": 0, "reasoning": "The stall starts right after the update, so compare the motor controller config before and after." },
{ "step": 1, "reasoning": "Firmware 4.2 resets the torque limit to the factory value.", "conclusion": "The torque limit is too low for loaded bins." }
],
"conclusion": "Restore the torque limit after each firmware update."
}create, record, get and patch return the reasoning record, with
successCount, failureCount and worth. archive returns
{ "id", "archived": true }.
Reasoning records are indexed but not returned by a default recall. Pass
kinds: ["reasoning"] to memory_recall to include them.
Related
- CoT distillation, the concept
- REST:
POST /reasoning/resolve,POST /reasoning/record,POST /reasoning/feedback