add_memory
Record what was done / learned / DECIDED so the user's OTHER AI assistants (terminal Claude Code, claude.ai, ChatGPT) can see it — a shared cross-assistant journal. Set source to who you are ('claude-web' when you are claude.ai, 'chatgpt' when you are ChatGPT, 'terminal' for local Claude Code). When the entry came from one connected account's work (mail, Slack, calendar, Drive), pass account (a label from list_accounts) — its belongs_to is applied automatically; set belongs_to yourself (a name from list_accounts belongs_to_options; leave it out if unsure) only when the entry is not from any one account's work. Set visibility when it is not for the owner's eyes only, and confidence for profile entries and anything about a person.
WRITE AT THE MOMENT OF DECISION — not at the end of the conversation (a chat has no end). The moment the user decides something (「〜にしよう」「〜で行く」「それで決定」「やめる」), write one kind: 'decision' entry. Template: 「決定: … / 理由: … / 捨てた案: … / いつまで: …」. If that decision overrides or corrects an earlier entry, pass supersedes: [id] (the id from search_memory / get_memory_digest) — then there is ONE current answer instead of two contradicting ones.
CORRECTIONS: when you find that an entry you read is outdated or wrong (「実はマージ済み」「以前の記録より正しいのは…」), do NOT just append a second entry — write the corrected entry with supersedes: [the old id]. To retract without a replacement, write 「取り消し: … 理由: …」 with supersedes. Nothing is ever deleted; the old entry stays in history.
SHARED-MEMORY ADMISSION RULE — this journal is NOT a work log. Another assistant reads it top-to-bottom later; write to it only what that assistant would otherwise be materially more likely to get wrong. Ask yourself: "Would another assistant be materially more likely to make a wrong decision without this information?" If not, do not write it.
Write a normal entry for:
decision— a policy/spec/operating rule was decideda material state change — implementation / merge / deploy / send / configuration change / production update actually happened
learning— a reusable insight that should change future implementation or judgmenta meaningful handoff — you are stopping mid-task and another assistant needs to know where things stand to continue
profile— a durable fact or standing rule about the user (setconfidence)
Do NOT write, as a rule: starting an investigation, having read some files, having run a test once, CI going green, a small in-progress step, "I will do X next", "nothing changed", or any checkpoint/processed-id/retry-count/run-count/scheduled-job bookkeeping — those stay operational: true (unchanged from before).
Standard granularity per session (a guideline, not a hard limit): usually at most 1 activity session digest, 1 decision per decision made, 1 learning if one is worth keeping — roughly 1-3 entries total. Prefer one consolidated entry over a fine-grained timeline.
RUN STATE (scheduled routines): for a piece of state you name and keep updating yourself — a ticket's status, a monitor's progress — give it a stable memory_key and pass replace_previous: true on each update. For timestamped snapshots, always pass RFC 3339 observed_at; an older observation is rejected even if it finishes later. To add references without advancing the observation time, first read the current row and pass its id as expected_current_id; on conflict, reread and merge. For everything else, prefer supersedes.
Also call this whenever the user says 記録して / メモして / 他のアシスタントにも共有して. The result carries the entry's id and belongs_to; a note tells you if something was adjusted (e.g. belongs_to overridden by the account's label).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Entry type: 'activity' (何をやったか, default) | 'learning' (学び・知見) | 'decision' (決定事項) | 'profile' (ユーザーについての情報). | |
| tags | No | Freeform tags, e.g. project names. | |
| source | No | Who is writing: 'terminal' (local Claude Code), 'claude-web' (claude.ai), 'chatgpt', or 'other'. Set this to who YOU are. | |
| account | No | The connected account (a label from list_accounts) whose mail / Slack / calendar work this entry came from. PASS THIS FIRST whenever the entry came out of one account's messages, events or files: that account's `belongs_to` is applied automatically and wins over `belongs_to`. | |
| content | Yes | What to record — anything from a one-line note to a long daily digest. | |
| belongs_to | No | Only for an entry that is NOT from any one connected account's work — otherwise pass `account` and the label is filed automatically. A NAME from `belongs_to_options` in list_accounts (or get_memory_digest): the labels are the user's own (a company, a project, 'プライベート'…); choose from that closed list, never invent one — an unknown name is refused with the valid list. If you are not sure, leave it out (the entry stays unfiled and the user sorts it later). | |
| confidence | No | How sure you are: 'verified' (checked against a primary source — put it in source_reference), 'reported' (someone said so / second-hand / another assistant's memory), 'inferred' (your own inference). ALWAYS set it for `profile` entries and for anything stated about a person. Omit only when it genuinely does not apply. Readers keep reported/inferred claims out of text addressed to third parties. | |
| memory_key | No | Stable canonical key for a piece of CURRENT STATE this entry is about, e.g. 'accounthub/reddit/RD-E2E-1' or 'socialgist/slack-monitoring-policy'. Use the SAME memory_key every time you update that same topic's state, so a later reader can find 'the current state of X' instead of picking an old row. Required when replace_previous is true; omit for an ordinary one-off entry. | |
| supersedes | No | ids of entries THIS entry corrects, confirms or retracts — take them from the `id` field of search_memory / get_memory_digest results. Each is flagged superseded (never deleted; history keeps it, with superseded_by pointing here) and stops appearing as current. Use it whenever you read an entry that is now outdated or wrong: a correction (「実はマージ済みだった」), a decision that overrides an earlier one, or a retraction (content 「取り消し: … 理由: …」). No stable key needed. Only this user's CURRENT entries: if an id was already superseded by someone else, nothing is written and the error names the current successor — read it and supersede THAT id if it is still wrong. Retrying the exact same write is safe (it returns the existing entry with replayed: true). | |
| visibility | No | Who may ever read this: 'private_self' (default — only the owner), 'shared_1on1' (the other party sees it too), 'company' (team-wide), 'hr_private' (evaluation/compensation/contracts — stored, never auto-sent). When in doubt leave it out; the default is the safe one. | |
| observed_at | No | RFC 3339 source observation time for timestamped CURRENT STATE, including Z or an offset. Pass this with memory_key + replace_previous for snapshots. Older observations are rejected atomically even if their requests finish later. For legacy CURRENT_UNRESOLVED_SNAPSHOT content it is also derived from a strict ISO checked_at line. | |
| occurred_on | No | YYYY-MM-DD the entry is about. Omit for today. | |
| operational | No | Set true ONLY for bookkeeping a scheduled job has to persist (checkpoints, processed message ids, "nothing new", retry counts). Such entries are kept out of the journal reads. Do NOT use it for anything a human would want to recall. | |
| replace_previous | No | Set true when this entry REPLACES the current state of memory_key (e.g. a task moved from in-progress to done, or a decision superseded an earlier one). The previous current entry for that memory_key is flagged superseded — never deleted, still visible via include_superseded — and this new entry becomes the one normal reads return. Requires memory_key. Default false (ordinary append-only write, unchanged behavior). | |
| source_reference | No | Where this came from — Slack permalink, Otter URL, thread id. Keep full text in the source system and put the pointer here. | |
| expected_current_id | No | Compare-and-swap token: the current memory id you read before changing content without advancing observed_at (for example adding source/task references). Required for same-observation enrichment. On conflict, read the new current row, merge, and retry with its id. |