[{"data":1,"prerenderedAt":22},["ShallowReactive",2],{"$fj5038u3fgonz":3},{"href":4,"title":5,"description":6,"kind":7,"mark":7,"planned":8,"contributors":9,"provenance":7,"express":8,"bridge":8,"html":10,"headings":11},"\u002Fdocs\u002Ftools\u002Fbuilt-in\u002Fmemory","Memory tools","The memory.* tools: ask enterprise memory a question, and teach it a note.",null,false,[],"\u003Cp>\u003Cem>Generated from the built-in tools registry. Do not edit by hand.\u003C\u002Fem>\u003C\u002Fp>\n\u003Cp>Enterprise memory is what the company has learned, in layers: a task, a member, a role, a team and the whole enterprise. Every run already consults it before its work and learns from it afterwards, without calling anything.\u003C\u002Fp>\n\u003Cp>These two tools are for a run that needs more: \u003Ccode>memory.ask\u003C\u002Fcode> asks a question of its own mid-run, and \u003Ccode>memory.train\u003C\u002Fcode> records something the run established. Train what the run observed, never what an ask just gave back.\u003C\u002Fp>\n\u003Cp>A person’s own agent uploads a note to a team or the whole enterprise with \u003Ccode>memory.upload\u003C\u002Fcode>, over the API and the OS MCP server, under \u003Ccode>memory:write\u003C\u002Fcode>. Task, member and role notes stay on \u003Ccode>memory.train\u003C\u002Fcode>. A run never calls \u003Ccode>memory.upload\u003C\u002Fcode>, so a task that declares it is refused when it is saved (\u003Ccode>tool_not_run_callable\u003C\u002Fcode>).\u003C\u002Fp>\n\u003Cdiv class=\"prose__table\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Tool\u003C\u002Fth>\n\u003Cth>What it does\u003C\u002Fth>\n\u003Cth>Effect\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ca href=\"\u002Fdocs\u002Ftools\u002Fbuilt-in\u002Fmemory#memory-ask\">\u003Ccode>memory.ask\u003C\u002Fcode>\u003C\u002Fa>\u003C\u002Ftd>\n\u003Ctd>Ask enterprise memory a question, and get an answer with its evidence.\u003C\u002Ftd>\n\u003Ctd>read\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ca href=\"\u002Fdocs\u002Ftools\u002Fbuilt-in\u002Fmemory#memory-train\">\u003Ccode>memory.train\u003C\u002Fcode>\u003C\u002Fa>\u003C\u002Ftd>\n\u003Ctd>Teach enterprise memory one note, at the task layer by default.\u003C\u002Ftd>\n\u003Ctd>write\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ca href=\"\u002Fdocs\u002Ftools\u002Fbuilt-in\u002Fmemory#memory-upload\">\u003Ccode>memory.upload\u003C\u002Fcode>\u003C\u002Fa>\u003C\u002Ftd>\n\u003Ctd>Upload one note to a team or the whole enterprise.\u003C\u002Ftd>\n\u003Ctd>write\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fdiv>\n\u003Ch2 id=\"memory-ask\">\u003Ccode>memory.ask\u003C\u002Fcode>\u003C\u002Fh2>\n\u003Cp>Ask enterprise memory a question, and get an answer with its evidence.\u003C\u002Fp>\n\u003Cp>What the model reads:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-text\">Ask enterprise memory a question and get an answer with the evidence behind it. Pass purpose (what you need it for) and, to restrict the search, teamId or projectId — an explicit filter is honoured as given and never widened, so omit both to search the whole enterprise. Pass selection to say which notes may answer: any (the default), trained (only what somebody taught, never what a run retained after its work) or confirmed (only the owner's own word: a note a person taught, or a decision they made at a gate). Before asking a person something they may already have decided, ask with selection confirmed and a purpose that does not quote the answer: insufficient_evidence means nothing confirmed matched, so you may ask. Returns answer, evidence, appliedFilters, appliedSelection, status and usage. Each evidence row carries its origin, kind, authorKind, sourceEventId and its layer and layerId, which say what it covers. A status of unavailable means memory could not be asked: carry on without it, and never read it as memory knowing nothing. In a run the reply always fits one result: evidence holds the notes that fit, whole; a first note too long on its own is cut and marked partial, with chars as its full length; and omitted names each note that matched and is not there. answer names the notes cited, and their text is in evidence only. Pass limit to get at most that many notes. Asking never stores anything.\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cdiv class=\"prose__table\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Field\u003C\u002Fth>\n\u003Cth>Type\u003C\u002Fth>\n\u003Cth>Required\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>purpose\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>What you need the answer for. Shown in the answer.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>teamId\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>Restrict to this team. Never widened back out.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>projectId\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>Restrict to this project. Never widened back out.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>limit\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>integer, 1 to 20\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>The most notes to return. Defaults to 20.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>selection\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string, one of \u003Ccode>any\u003C\u002Fcode>, \u003Ccode>trained\u003C\u002Fcode>, \u003Ccode>confirmed\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>Which notes may answer. Defaults to any. trained leaves out what runs retained after their work; confirmed keeps only the owner's own word. Never widened.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fdiv>\n\u003Cp>No other fields are accepted.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Effect:\u003C\u002Fstrong> read.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Retry:\u003C\u002Fstrong> Safe: repeating the call changes nothing. Asking never stores anything.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Called by:\u003C\u002Fstrong> a run, the API, the CEO chat, the OS MCP server.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Returns:\u003C\u002Fstrong> \u003Ccode>{ answer, evidence, appliedFilters, appliedSelection, status, usage }\u003C\u002Fcode>. \u003Ccode>status\u003C\u002Fcode> is \u003Ccode>answered\u003C\u002Fcode>, \u003Ccode>insufficient_evidence\u003C\u002Fcode> (nothing in scope, or nothing the selection allows), \u003Ccode>conflict\u003C\u002Fcode> (notes disagree) or \u003Ccode>unavailable\u003C\u002Fcode> (memory could not be asked: no answer and no evidence, and not the same as knowing nothing). \u003Ccode>appliedSelection\u003C\u002Fcode> is the selection the answer was drawn under: \u003Ccode>any\u003C\u002Fcode> when none was named. A run reads a fixed set of layers (task, team and enterprise): a filter narrows within them and never adds one. A run also gets \u003Ccode>omitted\u003C\u002Fcode>: \u003Ccode>[{ id, layer, sourceEventId, chars }]\u003C\u002Fcode> for each note that matched and did not fit in one result, and \u003Ccode>usage.evidenceOmitted\u003C\u002Fcode>. Over HTTP nothing is left out, and \u003Ccode>answer\u003C\u002Fcode> carries the text of every note.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>API:\u003C\u002Fstrong> \u003Ccode>GET \u002Fv1\u002Fmemory\u002Fask\u003C\u002Fcode> (\u003Ccode>memory:read\u003C\u002Fcode>)\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Example:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-json\">{\n  &quot;purpose&quot;: &quot;How has this task handled flaky checks before?&quot;\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Example, at most three notes:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-json\">{\n  &quot;purpose&quot;: &quot;What does the trial include?&quot;,\n  &quot;limit&quot;: 3\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Example, only the owner's own word:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-json\">{\n  &quot;purpose&quot;: &quot;prior owner decisions about refunds over the limit&quot;,\n  &quot;selection&quot;: &quot;confirmed&quot;\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"memory-train\">\u003Ccode>memory.train\u003C\u002Fcode>\u003C\u002Fh2>\n\u003Cp>Teach enterprise memory one note, at the task layer by default.\u003C\u002Fp>\n\u003Cp>What the model reads:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-text\">Teach enterprise memory one note. Pass body, optionally layer (task, the default; member and role are accepted; team and enterprise only when this task version grants that layer and the source event id starts with the granted prefix, on a cloned task too, unless a team the running member sits on or leads has withdrawn that layer, else clone_memory_not_granted), source ({eventId, revision}) naming the event you learned it from, so retrying it is not stored twice, and kind (fact, the default; inference, preference or correction). To correct a note, pass kind correction and supersedes ({entryId}) naming the entry it replaces: that retires the old note when it is in the layer you are writing, and a team or enterprise note only when this version grants that layer for the note's event id. Returns status (accepted, retained, consolidating or failed), the stored entry and usage. Author and enterprise come from this run, never from you.\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cdiv class=\"prose__table\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Field\u003C\u002Fth>\n\u003Cth>Type\u003C\u002Fth>\n\u003Cth>Required\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>body\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>yes\u003C\u002Ftd>\n\u003Ctd>The note to retain.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>layer\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string, one of \u003Ccode>task\u003C\u002Fcode>, \u003Ccode>member\u003C\u002Fcode>, \u003Ccode>role\u003C\u002Fcode>, \u003Ccode>team\u003C\u002Fcode>, \u003Ccode>enterprise\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>Defaults to task. team and enterprise need a grant on this task version.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>source\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>object\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>The source event this came from. Retrying the same pair is not stored twice.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>source.eventId\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>source.revision\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>kind\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string, one of \u003Ccode>fact\u003C\u002Fcode>, \u003Ccode>inference\u003C\u002Fcode>, \u003Ccode>preference\u003C\u002Fcode>, \u003Ccode>correction\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>What kind of note this is. Defaults to fact, and a kind outside this list is stored as a fact. A correction replaces the note named in supersedes.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>supersedes\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>object\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>The entry this note corrects. With kind correction it retires that entry: memory answers from the correction, and the old note stays only for audit. A run retires an entry in the layer it is writing. A team or enterprise note is retired only when this version grants that layer for the note's event id; one it cannot retire stays live, and the pair is reported as a conflict. Without kind correction the entry id is only recorded.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>supersedes.entryId\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>yes\u003C\u002Ftd>\n\u003Ctd>The id of the entry this note corrects.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fdiv>\n\u003Cp>What chat reads, through \u003Ccode>os.use_tool\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-text\">Teach enterprise memory one note about one of the enterprise's tasks, as the person asking: they are its author, and it needs their tasks:write. Pass taskId (os.list_task_definitions lists the tasks) and body, and optionally layer (task, the default; member, role, team or enterprise; team is the first team a holder of the task's role sits on, else memory_task_on_no_team; a cloned task trains its own task layer only, else clone_cannot_train_up), source ({eventId, revision}) naming the event it came from, so a retry is not stored twice, and kind (fact, the default; inference, preference or correction). To correct a note, pass kind correction and supersedes ({entryId}) naming the entry it replaces: a person's correction retires it in any layer. To teach a team by name, or the enterprise with no task, use memory.upload. Returns status (accepted, retained, consolidating or failed), the stored entry and usage. The enterprise comes from the conversation, never from the arguments.\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cdiv class=\"prose__table\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Field\u003C\u002Fth>\n\u003Cth>Type\u003C\u002Fth>\n\u003Cth>Required\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>taskId\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>yes\u003C\u002Ftd>\n\u003Ctd>The task the note is about, by id.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>body\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>yes\u003C\u002Ftd>\n\u003Ctd>The note to retain.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>layer\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string, one of \u003Ccode>task\u003C\u002Fcode>, \u003Ccode>member\u003C\u002Fcode>, \u003Ccode>role\u003C\u002Fcode>, \u003Ccode>team\u003C\u002Fcode>, \u003Ccode>enterprise\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>Defaults to task. team is the first team a holder of the task's role sits on. A cloned task trains task only.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>source\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>object\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>The source event this came from. Retrying the same pair is not stored twice.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>source.eventId\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>source.revision\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>kind\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string, one of \u003Ccode>fact\u003C\u002Fcode>, \u003Ccode>inference\u003C\u002Fcode>, \u003Ccode>preference\u003C\u002Fcode>, \u003Ccode>correction\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>What kind of note this is. Defaults to fact, and a kind outside this list is stored as a fact. A correction replaces the note named in supersedes.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>supersedes\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>object\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>The entry this note corrects. With kind correction it retires that entry: memory answers from the correction, and the old note stays only for audit. Without kind correction the entry id is only recorded.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>supersedes.entryId\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>yes\u003C\u002Ftd>\n\u003Ctd>The id of the entry this note corrects.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fdiv>\n\u003Cul>\n\u003Cli>\u003Cstrong>Effect:\u003C\u002Fstrong> write.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Retry:\u003C\u002Fstrong> Idempotent: a repeat of the same call acts once, or leaves the same state. Keyed on \u003Ccode>source\u003C\u002Fcode> (\u003Ccode>eventId\u003C\u002Fcode>, \u003Ccode>revision\u003C\u002Fcode>), or on the tool call when there is no source: a repeat is not stored twice.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Called by:\u003C\u002Fstrong> a run, the API, the CEO chat.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Needs:\u003C\u002Fstrong>\n\u003Cul>\n\u003Cli>\u003Ccode>task\u003C\u002Fcode> is always allowed. \u003Ccode>member\u003C\u002Fcode> and \u003Ccode>role\u003C\u002Fcode> only on an original task, never a clone. \u003Ccode>team\u003C\u002Fcode> and \u003Ccode>enterprise\u003C\u002Fcode> only when this version grants that layer and the source event id starts with the granted prefix. A cloned task may too, in its own enterprise's memory and never its publisher's, as a task the enterprise wrote itself may; only a layer withdrawn on the team's page of a team the running member sits on or leads stops it, with \u003Ccode>clone_memory_not_granted\u003C\u002Fcode>. Reserved event ids (\u003Ccode>team:\u003C\u002Fcode> and \u003Ccode>gate:\u003C\u002Fcode>) stay refused.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Returns:\u003C\u002Fstrong> \u003Ccode>{ status, entry, usage }\u003C\u002Fcode>. \u003Ccode>status\u003C\u002Fcode> is \u003Ccode>accepted\u003C\u002Fcode>, \u003Ccode>retained\u003C\u002Fcode>, \u003Ccode>consolidating\u003C\u002Fcode> or \u003Ccode>failed\u003C\u002Fcode>. Author and enterprise come from the run.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>API:\u003C\u002Fstrong> \u003Ccode>POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fmemory\u002Ftrain\u003C\u002Fcode> (\u003Ccode>tasks:write\u003C\u002Fcode>)\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cdiv class=\"prose__table\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Error\u003C\u002Fth>\n\u003Cth>When\u003C\u002Fth>\n\u003Cth>What happens\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>clone_cannot_train_up\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>A cloned task asked for the \u003Ccode>member\u003C\u002Fcode> or \u003Ccode>role\u003C\u002Fcode> layer.\u003C\u002Ftd>\n\u003Ctd>Run fails\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>clone_memory_not_granted\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>A cloned task asked for \u003Ccode>team\u003C\u002Fcode> or \u003Ccode>enterprise\u003C\u002Fcode> and one of the running member's teams has withdrawn that layer on its page.\u003C\u002Ftd>\n\u003Ctd>Run fails\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>grant_denied\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>The call asked for \u003Ccode>team\u003C\u002Fcode> or \u003Ccode>enterprise\u003C\u002Fcode> and this version does not grant that layer for the event id.\u003C\u002Ftd>\n\u003Ctd>Run fails\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fdiv>\n\u003Cp>Example:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-json\">{\n  &quot;body&quot;: &quot;The release check needs the preview URL before it can start.&quot;,\n  &quot;source&quot;: {\n    &quot;eventId&quot;: &quot;evt_1&quot;,\n    &quot;revision&quot;: &quot;1&quot;\n  }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"memory-upload\">\u003Ccode>memory.upload\u003C\u002Fcode>\u003C\u002Fh2>\n\u003Cp>Upload one note to a team or the whole enterprise.\u003C\u002Fp>\n\u003Cp>What the model reads:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-text\">Upload one note to a team or the whole enterprise. Pass layer (team or enterprise) and body. A team upload also passes teamId, a team in this enterprise; an enterprise upload passes no teamId. Optionally pass kind (fact, the default; inference, preference or correction) and source ({ eventId, revision }), the event the note was learned from, so uploading it again is not stored twice. To correct a note, pass kind correction and supersedes ({ entryId }) naming the entry it replaces. Author and enterprise come from the caller. Task, member and role notes are not uploaded here. A task that declares this tool is refused when it is saved. eventId and revision are strings. A source that is not an object, or a half that is not a string, is refused with memory_source_invalid. A call that leaves source out, or leaves either half empty or out, is stored as a new note each time.\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cdiv class=\"prose__table\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Field\u003C\u002Fth>\n\u003Cth>Type\u003C\u002Fth>\n\u003Cth>Required\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>layer\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string, one of \u003Ccode>team\u003C\u002Fcode>, \u003Ccode>enterprise\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>yes\u003C\u002Ftd>\n\u003Ctd>team or enterprise. A team upload names teamId.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>teamId\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>The team, when layer is team. Leave it out when layer is enterprise.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>body\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string\u003C\u002Ftd>\n\u003Ctd>yes\u003C\u002Ftd>\n\u003Ctd>The note to retain, one claim in a sentence.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>kind\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>string, one of \u003Ccode>fact\u003C\u002Fcode>, \u003Ccode>inference\u003C\u002Fcode>, \u003Ccode>preference\u003C\u002Fcode>, \u003Ccode>correction\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>fact, the default; inference, preference or correction. A correction replaces the note named in supersedes.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>source\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>object\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>Where the note was learned, as { eventId, revision }, both strings. The same pair in this enterprise is stored once.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>supersedes\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>object\u003C\u002Ftd>\n\u003Ctd>no\u003C\u002Ftd>\n\u003Ctd>The entry this note corrects, as { entryId }. With kind correction it retires that entry.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fdiv>\n\u003Cp>No other fields are accepted.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Effect:\u003C\u002Fstrong> write.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Retry:\u003C\u002Fstrong> Idempotent: a repeat of the same call acts once, or leaves the same state. Keyed on source (eventId, revision). A call that leaves source out, or leaves either half empty or out, has no key, so each such call is stored as its own note.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Called by:\u003C\u002Fstrong> the API, the CEO chat, the OS MCP server.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Returns:\u003C\u002Fstrong> \u003Ccode>{ status, entry, usage }\u003C\u002Fcode>. \u003Ccode>status\u003C\u002Fcode> is \u003Ccode>accepted\u003C\u002Fcode>, \u003Ccode>retained\u003C\u002Fcode>, \u003Ccode>consolidating\u003C\u002Fcode> or \u003Ccode>failed\u003C\u002Fcode>. Author and enterprise come from the caller.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>API:\u003C\u002Fstrong> \u003Ccode>POST \u002Fv1\u002Fmemory\u002Ftrain\u003C\u002Fcode> (\u003Ccode>memory:write\u003C\u002Fcode>)\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cdiv class=\"prose__table\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Error\u003C\u002Fth>\n\u003Cth>When\u003C\u002Fth>\n\u003Cth>What happens\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>memory_org_layer_required\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>\u003Ccode>layer\u003C\u002Fcode> is not team or enterprise. Task, member and role notes are not uploaded here.\u003C\u002Ftd>\n\u003Ctd>Tool error\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>memory_team_required\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>\u003Ccode>layer\u003C\u002Fcode> is team and \u003Ccode>teamId\u003C\u002Fcode> is missing.\u003C\u002Ftd>\n\u003Ctd>Tool error\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>memory_team_not_applicable\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>\u003Ccode>layer\u003C\u002Fcode> is enterprise and \u003Ccode>teamId\u003C\u002Fcode> is set.\u003C\u002Ftd>\n\u003Ctd>Tool error\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>team_not_found\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>\u003Ccode>teamId\u003C\u002Fcode> names no team in this enterprise.\u003C\u002Ftd>\n\u003Ctd>Tool error\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>memory_source_invalid\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>\u003Ccode>source\u003C\u002Fcode> is not an object, or its \u003Ccode>eventId\u003C\u002Fcode> or \u003Ccode>revision\u003C\u002Fcode> is there but is not a string. Nothing is stored.\u003C\u002Ftd>\n\u003Ctd>Tool error\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>reserved_source_event\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>\u003Ccode>source.eventId\u003C\u002Fcode> is a key the OS writes itself, such as team:&lt;teamId&gt;:… or a gate-learning key.\u003C\u002Ftd>\n\u003Ctd>Tool error\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fdiv>\n\u003Cp>Example:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-json\">{\n  &quot;layer&quot;: &quot;team&quot;,\n  &quot;teamId&quot;: &quot;5f0c1d2e-0000-4000-8000-000000000012&quot;,\n  &quot;body&quot;: &quot;Releases ship on Tuesday.&quot;,\n  &quot;kind&quot;: &quot;fact&quot;,\n  &quot;source&quot;: {\n    &quot;eventId&quot;: &quot;note-1&quot;,\n    &quot;revision&quot;: &quot;1&quot;\n  }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n",[12,16,19],{"id":13,"text":14,"level":15,"planned":8},"memory-ask","memory.ask",2,{"id":17,"text":18,"level":15,"planned":8},"memory-train","memory.train",{"id":20,"text":21,"level":15,"planned":8},"memory-upload","memory.upload",1794928143342]