Skip to main content
Glama

memory_add

Save facts, preferences, decisions, and notes to persistent local memory so they persist across sessions. Store project conventions, tool choices, and user preferences proactively for later recall.

Instructions

Save a fact, preference, decision, or note to persistent local memory. Call this PROACTIVELY whenever the user shares something worth remembering across sessions — project conventions, tool choices, personal preferences, decisions made, error fixes and their causes. Worth saving: decisions and their reasons, preferences, conventions, gotchas, approaches tried and abandoned. Not worth saving: one-off task details or anything re-derivable from the code. Do not wait to be asked. For facts you infer yourself rather than the user stating, propose them first and save only on approval. Keep each memory to one self-contained statement; attach aliases when the parameter is available. If a note tells you the user's own wording was already stored verbatim this turn, that statement is already saved: do not retry it in a rewording — save only what that text does not contain, or use memory_supersede on the given id. Default scope is the current project; use the personal scope for facts about the user that apply across all projects. Returns the new memory's id; an identical fact already stored returns that id instead of duplicating. A body that is a structured semantic-edge verdict is refused — edge verdicts go through open-memex graph verdict, not memory_add.

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": {
      "content": "<content>"
    },
    "name": "memory_add"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoOptional tags for filtering.
typeNoCategory of memory. Default: fact.
aliasNoD81: nickname this memory defines (e.g. 香蕉计划). Pairs with `target`: the alias memory expands queries in its scope at search time, both directions, no reindex. Explicit vocabulary — always stored, not gated by capture aliases.
scopeNoMemory scope. `project` = tied to this repo. `personal` = global across all your projects. Default: project.
sourceNoWhere this memory came from. Default: tool. Pass 'inference' for agent-proposed captures (V2-DESIGN §3.5).
targetNoD81: what `alias` refers to (e.g. 支付系统重构项目). Only meaningful with `alias`.
aliasesNoOptional: alternate phrasings of this fact — synonyms, another way a question might be worded, equivalents in the user's other language (e.g. 节假日 for 'public holidays'). They are indexed with the memory so differently-worded questions still match. Always on. Send at most 4; extras and blanks are dropped silently, never an error.
contentYesThe fact to remember. One idea per memory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.8.2
    • addedInput schema / properties / alias
      Added value: +{
      +  "description": "D81: nickname this memory defines (e.g. 香蕉计划). Pairs with `target`: the alias memory expands queries in its scope at search time, both directions, no reindex. Explicit vocabulary — always stored, not gated by capture aliases.",
      +  "type": "string"
      +}
    • changedInput schema / properties / aliases / description
      Previous value: -"Optional: alternate phrasings of this fact — synonyms, another way a question might be worded, equivalents in the user's other language (e.g. 节假日 for 'public holidays'). They are indexed with the memory so differently-worded questions still match. Only used when the install has capture aliases enabled (init default). Send at most 4; extras and blanks are dropped silently, never an error."New value: +"Optional: alternate phrasings of this fact — synonyms, another way a question might be worded, equivalents in the user's other language (e.g. 节假日 for 'public holidays'). They are indexed with the memory so differently-worded questions still match. Always on. Send at most 4; extras and blanks are dropped silently, never an error."
    • addedInput schema / properties / target
      Added value: +{
      +  "description": "D81: what `alias` refers to (e.g. 支付系统重构项目). Only meaningful with `alias`.",
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv0.7.3
    • changedInput schema / properties / scope / description
      Previous value: -"Memory scope. `project` = tied to this repo. `personal` = global across all your projects. `user` is a deprecated alias of `personal`. Default: project."New value: +"Memory scope. `project` = tied to this repo. `personal` = global across all your projects. Default: project."
    • changedInput schema / properties / scope / enum
      Previous value: -[
      -  "project",
      -  "personal",
      -  "user"
      -]New value: +[
      +  "project",
      +  "personal"
      +]
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only say it is a non-destructive write to a closed world; the description adds substantial behavior beyond that — returns the new memory id, dedupes identical facts by returning the existing id, drops extra/blank aliases silently rather than erroring, and refuses structured semantic-edge verdicts. It does not describe failure modes for other rejection causes, but the added context is well above the annotation bar.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads purpose and the proactive trigger before edge cases, and almost every sentence carries operational information (what to save, dedupe behavior, refusal case). It runs long and the trailing semantic-edge clause is niche enough to feel appended rather than integrated.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter write tool with no output schema, the description still covers the essentials an agent needs: entry types worth saving, scope selection, idempotent return behavior, alias limits, and the one class of payload that will be rejected.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description still adds usable meaning with the "one self-contained statement per memory" content rule and the default-project vs personal-scope decision rule. The phrase "attach aliases when the parameter is available" is slightly at odds with the schema's "Always on" and the repeated scope guidance overlaps the schema, so it sits just above baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource ("Save a fact, preference, decision, or note to persistent local memory") and enumerates content types, which cleanly separates it from sibling write/mutate tools like memory_supersede and memory_forget.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use (proactively, on user-shared conventions, preferences, decisions, error fixes), an explicit when-not (one-off task details, anything re-derivable from code), and named alternatives (memory_supersede for already-stored statements, a propose-then-approve path for inferred facts).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.