Skip to main content
Glama
total-agent-memory

total-agent-memory

memory_save

Save decisions, solutions, lessons, and facts with context so AI agents retain project knowledge, recall prior work, and avoid repeating mistakes.

Instructions

Save knowledge explicitly. Types: decision (MUST include WHY in context), solution, lesson, fact, convention. Saving the same words again (case and punctuation aside) replaces the stored record, so it carries the latest date; any other text, including a changed value, is stored as a new record. v10: a quality gate scores the record before save; below-threshold records are rejected with a rejected_by_quality_gate: true response (override with MEMORY_QUALITY_GATE_ENABLED=false). Use importance to surface critical decisions at recall time (boosts the final RRF score). v11.0: routes to fast hot path when MEMORY_MODE=fast (default). Use memory_save_fast for explicit fast routing.

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>",
      "type": "<type>"
    },
    "name": "memory_save"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNo
typeYes
corefNoOpt into v10 coreference rewrite — expand pronouns ('after this it broke') into self-contained text using recent session history. Costs ~1s LLM round-trip; default off.
branchNoGit branch this knowledge relates to
filterNoOptional content filter (pytest|cargo|git_status|docker_ps|generic_logs). Trims noisy CLI output while preserving URLs/paths/code.
contentYesThe knowledge to save
contextNoAdditional context, WHY for decisions
projectNogeneral
affectedNo
agent_idNoOptional Claude Code subagent ID (x-claude-code-agent-id header / OTEL agent_id attribute, v2.1.139+). Lets recall trace which subagent produced this knowledge.
detectionNo
supersedeNoRetire active records of the same project and type that this one gives a new value for: same opening words, different trailing value ("X's citizenship is Argentina" -> "... is Armenia"). Use for single-valued facts only; "likes jazz" would retire "likes rock". The retired ids are returned as `superseded`.
importanceNoRecall-time boost: critical x1.5, high x1.2, medium x1.0, low x0.8. Reserve `critical` for migration-blocking decisions and security incidents.medium
resolutionNo
source_formatNoConversation preserves dialogue structure and bypasses automatic CLI filters.auto
incident_statusNoopen
parent_agent_idNoOptional parent agent ID (the dispatching Agent tool / parent span). Together with agent_id forms the subagent lineage tree.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv15.0.0
    • addedInput schema / properties / affected
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "from": {
      +        "title": "From",
      +        "type": "string"
      +      },
      +      "scope": {
      +        "minLength": 1,
      +        "title": "Scope",
      +        "type": "string"
      +      },
      +      "to": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "To"
      +      }
      +    },
      +    "required": [
      +      "scope",
      +      "from"
      +    ],
      +    "title": "AffectedWindow",
      +    "type": "object"
      +  },
      +  "title": "Affected",
      +  "type": "array"
      +}
    • addedInput schema / properties / detection
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "check": {
      +          "minLength": 1,
      +          "title": "Check",
      +          "type": "string"
      +        },
      +        "healthy_result": {
      +          "minLength": 1,
      +          "title": "Healthy Result",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "check",
      +        "healthy_result"
      +      ],
      +      "title": "Detection",
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / incident_status
      Added value: +{
      +  "default": "open",
      +  "enum": [
      +    "open",
      +    "closed"
      +  ],
      +  "title": "Incident Status",
      +  "type": "string"
      +}
    • addedInput schema / properties / resolution
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Resolution"
      +}
    • changedInput schema / properties / type / enum
      Previous value: -[
      -  "decision",
      -  "fact",
      -  "solution",
      -  "lesson",
      -  "convention"
      -]New value: +[
      +  "decision",
      +  "fact",
      +  "solution",
      +  "lesson",
      +  "convention",
      +  "incident"
      +]
  2. Changed1 schema field changedv14.5.0
    • addedInput schema / properties / supersede
      Added value: +{
      +  "default": false,
      +  "description": "Retire active records of the same project and type that this one gives a new value for: same opening words, different trailing value (\"X's citizenship is Argentina\" -> \"... is Armenia\"). Use for single-valued facts only; \"likes jazz\" would retire \"likes rock\". The retired ids are returned as `superseded`.",
      +  "type": "boolean"
      +}
  3. Changed1 schema field changedv14.0.0
    • addedInput schema / properties / source_format
      Added value: +{
      +  "default": "auto",
      +  "description": "Conversation preserves dialogue structure and bypasses automatic CLI filters.",
      +  "enum": [
      +    "auto",
      +    "conversation"
      +  ],
      +  "type": "string"
      +}
  4. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing dedup/replace semantics (identical text replaces the record and takes the latest date, changed text creates a new record), a failure mode (v10 quality gate rejection with `rejected_by_quality_gate: true` and the env override), and mode-dependent routing. These are behaviors an agent could not infer from readOnlyHint=false / destructiveHint=false alone.

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?

Dense but front-loaded: the save behavior and type rules come first, followed by dedup semantics, the quality gate, importance, and routing. Version stamps ('v10:', 'v11.0:') are marginal noise, but nearly every sentence carries operational information.

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

Completeness4/5

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

For a 17-parameter mutation tool with no output schema, the description covers the critical non-obvious behaviors: replacement vs. new record, rejection responses, and importance boosting. It does not describe the response shape beyond the rejected case (e.g. the `superseded` ids it mentions only obliquely), which is the main remaining gap.

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

Parameters3/5

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

Schema coverage is 59%, so the schema already documents most parameters. The description adds real meaning for two of them: `importance` as an RRF score booster with the critical reservation, and `context` as the mandatory WHY for decisions. The other 15 parameters (tags, project, supersede, detection, affected, etc.) get no additional explanation in the description.

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+resource ('Save knowledge explicitly') and enumerates the knowledge types, so the agent knows exactly what gets persisted. It also distinguishes itself from the sibling memory_save_fast by naming the routing condition, which is the main ambiguity an agent would face.

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

Usage Guidelines4/5

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

Gives concrete when-to guidance: it names an alternative (memory_save_fast) and the condition selecting it, and it reserves `importance: critical` for migration-blocking decisions and security incidents. It stops short of saying when NOT to save here versus siblings like memory_episode_save or save_decision, so the guidance is clear but not complete.

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