Skip to main content
Glama

mem_save

Persist key project knowledge—conventions, decisions, gotchas, and architecture—across AI sessions, ensuring future work builds on prior discoveries instead of re-discovering them.

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
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)
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.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 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"
      +}
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries full burden, and it delivers: it discloses that memories persist across sessions, that topic+scope causes in-place update with revision_count++, that identical body is rejected, and warns about paths staleness. It also gives the return shape and action values, so agents understand side effects and outcomes.

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 structured into clear sections (purpose, when to use, parameters, returns, warning, dedup) with front-loaded purpose and no filler. Each line adds decision-relevant information, and the formatting makes it scannable for an agent.

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?

Given 14 params, nested objects, and no output schema, the description covers the operation's purpose, usage, key parameters, return shape, and a warning about staleness. It leaves some optional parameters (tags, author, lifecycle, activation) to the schema, which is acceptable since schema descriptions are complete; the description could mention type='skill' handling to be fully complete.

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%, giving baseline 3, but the description adds real meaning for key parameters: slug format example, scope semantics (team/personal/module), paths as strongly recommended anchors, topic as upsert key. It omits some schema-described params like tags/author/lifecycle and lists type incompletely (missing skill and session_recap), so it's valuable but not flawless.

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 verb+resource: 'Save a piece of knowledge as a persistent memory that survives across AI sessions.' It also distinguishes itself from siblings by explicitly naming mem_tried for failed attempts and mem_update for modifications, making the tool's unique role clear.

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?

Provides explicit when-to-use scenarios (project convention, architectural decision, gotcha, domain term), an explicit exclusion (failed approaches → mem_tried), and an explicit alternative for modification (mem_update). This is model guidance for tool selection.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Doucs91/hivelore'

If you have feedback or need assistance with the MCP directory API, please join our Discord server