save_memory
Persist durable facts, rules, preferences, and lessons to version-controlled memory so assistants recall them across sessions. Update by slug or supersede stale entries.
Instructions
Persist a new fact, rule, preference, or lesson to the memory store for future sessions. CALL THIS: whenever you learn something the user would want you to remember next time — a preference they stated, a rule they corrected you on, a project decision, a lesson from a mistake, or a reference to an external system. Do NOT save ephemeral or task-specific details; save durable facts only. If a memory with the same slug already exists, this updates it — that is exactly how 'tr' trackers are meant to be updated when an entity's state changes. When this memory CORRECTS or replaces existing ones, pass their slugs in 'supersedes' instead of writing 'CORRECTED:' prefixes or leaving stale duplicates.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"slug": "<slug>",
"rule": "<rule>"
},
"name": "save_memory"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| why | No | Why this rule exists — the incident, reason, or motivation. Optional but strongly recommended. | |
| body | No | Full long-form detail behind the rule — state, decisions, code paths, context. Multi-line markdown welcome; this is stored losslessly and returned by get_memory. Use it instead of cramming detail into 'rule'. | |
| rule | Yes | The primary fact or rule to remember (max ~200 chars). Write as a declarative statement: 'always X', 'never Y', 'Z is located at ...' | |
| slug | Yes | Short kebab-case identifier, unique per memory. Examples: 'user-prefers-terse-responses', 'ig-pipeline-no-fallback', 'trading-confirm-only-orders'. Use existing slug to update. | |
| tags | No | Topic tags for filtering. Examples: ['instagram', 'trading', 'admin'] | |
| type | No | Alias for type_code (read tools return this field as 'type', so both spellings work here). | |
| when | No | When / where to apply this rule. Optional. | |
| project | No | Project this memory belongs to. Defaults to the current workspace — set explicitly only for global facts (pass empty string "" = applies everywhere) or another project. If omitted AND the workspace can't be detected, the memory is quarantined under '_unknown' instead of becoming global. | |
| related | No | Slugs of related memories (cross-references, not replacement). | |
| priority | No | 1=low (background context), 2=medium (default — apply when relevant), 3=critical (always loaded, applied in every session) | |
| triggers | No | The tool calls this rule governs, so it is enforced when the agent ACTS, not only when the user's words match it. Each item: command (regex on a Bash command) or path (glob on the file a Write/Edit touches), optionally tool (regex) and cwd (regex on where the action happens). A priority-3 fb/cn memory with a matching trigger REFUSES the call; others add the rule as context. Example: [{"command": "git (checkout|switch) -b |git worktree add", "cwd": "api"}, {"path": "api/scripts/*.sql"}]. Omit on an update to keep the existing triggers; [] clears them. | |
| type_code | No | fb=feedback (corrections, preferences, how the user likes to work), us=user (who the user is, their role, expertise, goals), pj=project (active projects, goals, decisions, deadlines), rf=reference (pointers to external systems, URLs, tools), cn=convention (code style, naming, architecture rules), lx=lesson (lessons learned, post-mortems, 'we got burned by X'), co=core (the per-project operating guide — which tools/skills/commands to reach for; always injected at session start, subordinate to the repo's own rules), tr=tracker (LIVE STATUS of exactly one entity — a deploy, draft, migration, campaign. One tracker per entity, slug '<entity>-status', tags naming the entity; UPDATE it by re-saving the same slug whenever the state changes. Trackers render as the status board at session start; memgit is the authority for this status, files are downstream) | fb |
| supersedes | No | Slugs of memories this one REPLACES (corrections, updated decisions, resolved incidents). Pass this instead of writing 'CORRECTED:' prefixes or leaving stale duplicates — superseded memories stop surfacing in search/recall/resume automatically (history is preserved; remove the superseder and they return). | |
| unverified | No | Mark this memory as a CANDIDATE (unconfirmed) — use for facts seeded from repo files, imported, or synced from another writer that you have not confirmed. Unverified memories are kept OUT of high-authority injection (core guide, critical rules, status board) and flagged in recall until promoted with verify_memory. Content that looks instruction-shaped is auto-marked unverified regardless of this flag. |