Skip to main content
Glama

mem_save

Save project conventions, decisions, and gotchas as persistent memories that survive across AI sessions.

Instructions

Save a piece of knowledge as a persistent memory that survives across AI sessions.

USE THIS WHEN you discover something worth remembering for future sessions:

  • A project convention (how things are done here)

  • An architectural decision and its rationale

  • A gotcha or non-obvious behavior that surprised you

  • A domain term and what it means in this codebase

DO NOT USE for failed approaches → use mem_tried instead (better structure). For reactive code discoveries during exploration, prefer a compact gotcha via mem_save.

PARAMETERS: type — convention | decision | gotcha | architecture | glossary | attempt slug — short kebab-case id (e.g. 'flyway-no-modify-existing') body — Markdown content with the full knowledge scope — team (shared with all devs) | personal (private) | module (component-scoped) paths — anchor to source files for staleness detection (STRONGLY recommended) topic — stable key for upsert: if a memory with same topic+scope exists, update it in-place

RETURNS: { id, scope, file_path, action: 'created'|'updated', warning?, invalid_paths? } WARNING: if paths point to non-existent files, they will be immediately stale after hivelore sync. DEDUP: identical body content within the same scope is rejected — use mem_update to modify.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesMarkdown body of the memory
slugYesShort human-readable identifier — becomes part of the filename
tagsNoTags for filtering
typeYesKind of memory being saved. Use 'skill' for reusable procedures/playbooks agents should follow for recurring tasks (feedforward harness guide). Use 'attempt' for failed approaches (auto-validated). Use 'session_recap' via mem_session_end instead.
pathsNoAnchor paths (file paths this memory references)
scopeNoVisibility scope: personal | team | module. When omitted, falls back to defaultScope in haive.config.json (default: personal).
topicNoStable key for this memory. If a memory with the same topic already exists in this scope, it is updated in-place (revision_count++). Use for knowledge that evolves over time.
authorNoAuthor handle or email
checksNo
commitNoAnchor commit SHA (for staleness detection later)
domainNoDomain (e.g. transactions, billing)
moduleNoModule name (required when scope=module)
symbolsNoAnchor symbols (function/class names this memory references)
evidenceNo
lifecycleNoDoes this describe code that EXISTS now, or a decision not yet built? 'applied' (default) = reflected in the code; 'planned' = decided but NOT yet implemented (surfaced distinctly so agents don't write code against it as if it were real); 'abandoned' = rejected, kept so it isn't re-tried.
activationNoOnly for type='skill'. Progressive-disclosure triggers: the skill is surfaced ONLY when a keyword matches the task or a glob matches the edited files (or always=true). Omit to keep the skill always-eligible.
supersedesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.65.0
    • addedInput schema / properties / checks
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "contains": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "excludes": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "path": {
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "path"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / evidence
      Added value: +{
      +  "enum": [
      +    "hypothesis",
      +    "observed",
      +    "reproduced",
      +    "tested"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / supersedes
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changedv0.57.7
    • addedInput schema / properties / lifecycle
      Added value: +{
      +  "description": "Does this describe code that EXISTS now, or a decision not yet built? 'applied' (default) = reflected in the code; 'planned' = decided but NOT yet implemented (surfaced distinctly so agents don't write code against it as if it were real); 'abandoned' = rejected, kept so it isn't re-tried.",
      +  "enum": [
      +    "applied",
      +    "planned",
      +    "abandoned"
      +  ],
      +  "type": "string"
      +}
  3. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does substantial work: it documents the return shape (created|updated, warning, invalid_paths), the dedup rejection rule and the correct recovery (use mem_update), and the staleness trap for non-existent paths. It still omits permission/auth requirements and any rate or size limits, so it falls just short of full coverage.

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 purpose is front-loaded, followed by usage, then params, then returns/warnings — a sensible ordering with each block earning its place. The line 'For reactive code discoveries during exploration, prefer a compact gotcha via mem_save' is slightly confusing (it recommends mem_save while appearing to recommend an alternative), a minor blemish.

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 with nested objects and no output schema, the description usefully compensates by spelling out the RETURNS shape and the two failure modes (staleness warning, dedup rejection). Remaining optional parameters are left to the high-coverage schema, so the gap is small but real.

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 description coverage is already 82% (baseline 3), and the description adds meaning beyond it: it flags paths as 'STRONGLY recommended' for staleness detection and explains the topic upsert semantics ('update it in-place'). It does not explain the many optional fields (checks, activation, lifecycle, evidence, supersedes), leaving those entirely to the schema.

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?

States a specific verb+resource ('Save a piece of knowledge as a persistent memory') with the key scope qualifier ('survives across AI sessions'). It explicitly distinguishes itself from siblings mem_tried and mem_update by name, so an agent can route correctly without opening schemas.

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?

Contains an explicit 'USE THIS WHEN' list of four concrete triggers and a 'DO NOT USE for failed approaches → use mem_tried instead' exclusion naming the alternative. This is exactly the when/when-not/alternative structure the dimension rewards.

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