Skip to main content
Glama

Save Memory

save_memory
Destructive

Save key project knowledge (decisions, fixes, discoveries, preferences) as persistent memories for future sessions. Topic keys update existing entries instead of duplicating.

Instructions

Save a memory for future sessions. MUST be called after: (1) architecture decisions — record what was chosen, why, and what was rejected, (2) bug fixes with root cause — record symptom, root cause, fix, and prevention, (3) important discoveries — record finding and its implications, (4) user preferences — record preference and reasoning. Use topic_key for cross-session dedup (same project+topic_key updates existing memory). By default also writes a local markdown backup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostNoOptional host identifier, e.g. codex-cli or claude-code. Defaults to unknown when omitted.
textYesMemory text content
filesNoList of related file paths
scopeNoMemory scope: 'project' (default, only this project) or 'global' (visible in all projects). Use 'global' only for explicitly cross-project preferences or knowledge.
titleNoOptional title
branchNoGit branch label. If omitted, the server auto-detects from the MCP process current working directory. Pass an explicit value to override (e.g. when the calling agent is not running inside the project's git checkout).
projectNoProject name
topic_keyNoStable topic identifier for cross-session dedup. Same project+topic_key updates existing memory instead of creating new one. Format: kebab-case descriptive key, e.g. 'fts5-search-strategy', 'auth-middleware-design'.
local_pathNoOptional local markdown path for backup copy. Relative paths are resolved from current working directory. The resolved path must fall within the remem data directory (REMEM_DATA_DIR); paths outside that boundary are rejected.
session_idNoOptional host session id. When provided, Stop summary promotion can suppress exact duplicate candidates from the same session.
memory_typeNoMemory type: decision, discovery, bugfix, architecture, preference. Defaults to 'discovery'.
claim_sourceNoOptional claim source label. Defaults to manual_save for MCP calls.
claim_enabledNoOverride the session claim toggle. Defaults to true; set false to preserve legacy save behavior without claim rows.
idempotency_keyNoOptional retry identity. Repeating the same key and exact request is idempotent; reusing it with changed content, route, trust, or policy fails.
created_at_epochNoOptional override for the memory's creation timestamp (Unix epoch seconds). Use only for backfilling historical entries; defaults to now when omitted.
local_copy_enabledNoOverride the local markdown backup toggle. Default behavior (when omitted) is controlled by the server config.
reference_time_epochNoExplicit episode/source event time (Unix epoch seconds) used to resolve relative dates. Preferred for historical backfills; created_at_epoch is used only when this is omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
scopeYes
branchNo
statusYes
projectYes
claim_idNo
upsertedYes
next_stepYes
operationYes
topic_keyNo
local_copyYes
local_pathNo
claim_errorNo
memory_typeYes
claim_statusYes
local_statusYes
created_at_epochYes
updated_at_epochYes
reference_time_epochYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.90
    • changedInput schema / properties / host / description
      Previous value: -"Optional host identifier, e.g. codex-cli, claude-code, api, cli."New value: +"Optional host identifier, e.g. codex-cli or claude-code. Defaults to unknown when omitted."
  2. Changed3 schema fields changedv0.6.82
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / acknowledge_pattern
      Removed value: -{
      -  "description": "Explicitly acknowledge an instruction-pattern match in direct save text after human review. Must match the detected pattern id, e.g. override_previous_instructions.",
      -  "nullable": true,
      -  "type": "string"
      -}
    • addedInput schema / properties / idempotency_key
      Added value: +{
      +  "description": "Optional retry identity. Repeating the same key and exact request is idempotent; reusing it with changed content, route, trust, or policy fails.",
      +  "nullable": true,
      +  "type": "string"
      +}
  3. Changed1 schema field changedv0.6.45
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "LocalCopyOutput": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "path": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "reason": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "status": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "status"
      +      ],
      +      "type": "object"
      +    },
      +    "SaveMemoryNextStepOutput": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "ids": {
      +          "items": {
      +            "format": "int64",
      +            "type": "integer"
      +          },
      +          "type": "array"
      +        },
      +        "reason": {
      +          "type": "string"
      +        },
      +        "source": {
      +          "type": "string"
      +        },
      +        "tool": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "tool",
      +        "ids",
      +        "source",
      +        "reason"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "branch": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "claim_error": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "claim_id": {
      +      "format": "int64",
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "claim_status": {
      +      "type": "string"
      +    },
      +    "created_at_epoch": {
      +      "format": "int64",
      +      "type": "integer"
      +    },
      +    "id": {
      +      "format": "int64",
      +      "type": "integer"
      +    },
      +    "local_copy": {
      +      "$ref": "#/$defs/LocalCopyOutput"
      +    },
      +    "local_path": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "local_status": {
      +      "type": "string"
      +    },
      +    "memory_type": {
      +      "type": "string"
      +    },
      +    "next_step": {
      +      "$ref": "#/$defs/SaveMemoryNextStepOutput"
      +    },
      +    "operation": {
      +      "type": "string"
      +    },
      +    "project": {
      +      "type": "string"
      +    },
      +    "reference_time_epoch": {
      +      "format": "int64",
      +      "type": "integer"
      +    },
      +    "scope": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "topic_key": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "updated_at_epoch": {
      +      "format": "int64",
      +      "type": "integer"
      +    },
      +    "upserted": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "status",
      +    "memory_type",
      +    "project",
      +    "scope",
      +    "operation",
      +    "created_at_epoch",
      +    "reference_time_epoch",
      +    "updated_at_epoch",
      +    "upserted",
      +    "local_copy",
      +    "local_status",
      +    "claim_status",
      +    "next_step"
      +  ],
      +  "title": "SaveMemoryOutput",
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the annotations (destructiveHint=true, readOnlyHint=false), the description discloses two important side effects: same project+topic_key updates existing memory, and a local markdown backup is written by default. This gives the agent useful behavioral context without contradicting the annotations.

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

Conciseness5/5

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

The description is appropriately sized, front-loaded with the core purpose, and every sentence carries useful guidance. The conditional 'MUST' list is dense but directly actionable, and there is no filler.

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 tool, the description covers the key invocation contexts, dedup behavior, and default side effects. The output schema exists, so return values need no explanation. It could be strengthened by naming sibling alternatives, but the remaining context is adequately covered by the schema.

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 description coverage is 100%, so the schema already documents every parameter. The description adds meaningful reinforcement around topic_key dedup and the default local backup, but does not need to compensate for missing schema details.

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 resource: 'Save a memory for future sessions,' and then enumerates exact triggering scenarios (architecture decisions, bug fixes, discoveries, user preferences). This clearly distinguishes saving from the sibling search, governance, and timeline tools.

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 'MUST be called after' list provides explicit, actionable guidance on when to invoke this tool. It does not explicitly name alternatives or state when not to use it, but the conditions are concrete enough to route an agent correctly.

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