Skip to main content
Glama
vbcherepanov

total-agent-memory

memory_save

Persist knowledge for future recall by saving decisions, solutions, lessons, facts, and conventions with context and importance.

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.

Input Schema

TableJSON 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
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.
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
source_formatNoConversation preserves dialogue structure and bypasses automatic CLI filters.auto
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. 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"
      +}
  2. 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"
      +}
  3. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

The description discloses several non-obvious behaviors: identical saves replace the existing record, changed text creates a new record, a quality gate can reject saves with a specific response, importance affects recall ranking, and MEMORY_MODE=fast routes to a hot path. This goes far beyond the sparse annotations and gives the agent a realistic model of side effects.

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?

The description is dense and front-loaded with the core action and types, then adds behavioral details in a logical progression. The version labels (v10, v11.0) add a little noise, but each sentence contributes useful information for an agent deciding whether and how to call the tool.

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 tool with 13 parameters and no output schema, the description covers the most decision-critical behaviors: required types, context requirements, replacement semantics, quality-gate rejection, and routing. It does not describe the normal success return shape, but the schema and the detailed parameter descriptions cover most of what an agent needs to invoke it correctly.

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 77%, so the schema already explains most parameters. The description adds valuable semantics by tying the decision type to the context parameter ('decision MUST include WHY in context'), explaining the recall-time effect of importance, and mentioning the quality-gate override environment variable.

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?

The description opens with a specific action and object ('Save knowledge explicitly'), then enumerates the supported content types, making it immediately clear what the tool does. It also distinguishes itself from the sibling memory_save_fast by noting that tool is for explicit fast routing, helping an agent tell them apart.

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?

The description gives clear context for when to save knowledge and names memory_save_fast as the alternative for explicit fast routing. It does not discuss when to prefer memory_update or memory_observe, so the guidance is clear but not exhaustive.

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