Skip to main content
Glama

Store Memory

store_memory

Store important information, decisions, patterns, and user preferences in persistent memory. Supports single entries, batch import up to 500, and superseding outdated memories with corrections.

Instructions

Store memory in one of two modes — single-memory (set top-level content) or batch (set memories: [...] for up to 500).

Mode 1 — Single (default): pass top-level content plus any optional fields (tags, importance, metadata, type, confidence, embedding, t_valid, t_invalid, etc.).

Mode 1b — Supersede/correct: pass top-level content plus supersedes_memory_id. The server stores the replacement, marks the old memory invalid with t_invalid=now, merges supersede metadata, and associates old → new with INVALIDATED_BY (default) or EVOLVED_INTO.

Mode 2 — Batch: pass memories: [{ content, tags?, importance?, metadata?, timestamp?, type?, confidence? }, ...] to store up to 500 memories in one request. Faster for bulk ingestion (imports, benchmark seeding). Batch mode does NOT accept embedding, t_valid, or t_invalid per-item — use single mode for those.

Content size guidelines (per item):

  • Target: 150-300 characters (one meaningful paragraph)

  • Maximum: 500 characters (auto-summarized if exceeded)

  • Hard limit: 2000 characters (rejected)

  • Format: "Brief title. Context and details. Impact/outcome."

When to use:

  • After making a decision: store the reasoning and outcome

  • When discovering a pattern: store the pattern and where it applies

  • After fixing a bug: store the root cause and solution

  • When learning user preferences: store what they prefer and why

  • For bulk ingestion (imports, seeding): use batch mode

Examples:

  • store_memory({ content: "Chose PostgreSQL over MongoDB for user service. Need ACID for transactions.", tags: ["architecture", "database"], importance: 0.9 })

  • store_memory({ content: "User prefers early returns over nested conditionals.", tags: ["code-style"], importance: 0.7 })

  • store_memory({ content: "User now prefers SQLite for small local tools.", supersedes_memory_id: "old-id", supersede_reason: "Correction from user" })

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNoSingle-memory mode. Tags to categorize the memory (e.g., ["project-name", "bug-fix", "auth"])
typeNoSingle-memory mode. Memory type for classification
contentNoSingle-memory mode (XOR with `memories`). The memory content to store. Be specific: include context, reasoning, and outcome.
t_validNoSingle-memory mode only. ISO 8601 timestamp when the memory becomes valid. Not supported in batch mode.
memoriesNoBatch mode (XOR with `content`). Up to 500 memory objects to store in one call. Each item supports content (required), tags, importance, timestamp, type, confidence, metadata. Batch mode does NOT support `embedding`, `t_valid`, or `t_invalid` per-item — use single-memory mode for those.
metadataNoSingle-memory mode. Optional structured metadata (e.g., { files_modified: ["auth.ts"], error_type: "timeout" })
embeddingNoSingle-memory mode only. Optional embedding vector for semantic search (auto-generated if omitted). Not supported in batch mode.
t_invalidNoSingle-memory mode only. ISO 8601 timestamp when the memory expires. Not supported in batch mode.
timestampNoSingle-memory mode. Optional ISO timestamp (defaults to now)
confidenceNoSingle-memory mode. Classification confidence (0-1, default 0.9 when type provided)
importanceNoSingle-memory mode. Importance: 0.9+ critical decisions, 0.7-0.9 patterns/bugs, 0.5-0.7 minor notes
updated_atNoSingle-memory mode. ISO 8601 last-updated timestamp
last_accessedNoSingle-memory mode. ISO 8601 last-accessed timestamp
supersede_reasonNoSingle-memory supersede mode. Optional reason stored on the old memory's metadata.
supersede_relationNoSingle-memory supersede mode. Relationship to create from old memory to new memory.INVALIDATED_BY
supersedes_memory_idNoSingle-memory supersede mode. Existing memory ID that this new memory replaces or corrects.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
qdrantNoBatch-mode result: Qdrant indexing summary from the server.
storedNoBatch-mode result: number of memories stored.
messageYesConfirmation message
memory_idNoSingle-mode result: unique ID of the stored memory (use for associations)
enrichmentNoBatch-mode result: enrichment status from the server.
memory_idsNoBatch-mode result: IDs of the stored memories.
query_time_msNoBatch-mode result: server-reported execution time in milliseconds.
association_createdNoSupersede-mode result: whether old → new association was created.
superseded_memory_idNoSupersede-mode result: ID of the old memory marked invalid.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.14.2
    • removedInput schema / properties / id
      Removed value: -{
      -  "description": "Single-memory mode only. Custom memory ID (auto-generated if omitted). Not supported in batch mode.",
      -  "type": "string"
      -}
    • changedInput schema / properties / memories / description
      Previous value: -"Batch mode (XOR with `content`). Up to 500 memory objects to store in one call. Each item supports content (required), tags, importance, timestamp, type, confidence, metadata. Batch mode does NOT support `id`, `embedding`, `t_valid`, or `t_invalid` per-item — use single-memory mode for those."New value: +"Batch mode (XOR with `content`). Up to 500 memory objects to store in one call. Each item supports content (required), tags, importance, timestamp, type, confidence, metadata. Batch mode does NOT support `embedding`, `t_valid`, or `t_invalid` per-item — use single-memory mode for those."
  2. Changed5 schema fields changedv0.14.1
    • addedInput schema / properties / supersede_reason
      Added value: +{
      +  "description": "Single-memory supersede mode. Optional reason stored on the old memory's metadata.",
      +  "type": "string"
      +}
    • addedInput schema / properties / supersede_relation
      Added value: +{
      +  "default": "INVALIDATED_BY",
      +  "description": "Single-memory supersede mode. Relationship to create from old memory to new memory.",
      +  "enum": [
      +    "INVALIDATED_BY",
      +    "EVOLVED_INTO"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / supersedes_memory_id
      Added value: +{
      +  "description": "Single-memory supersede mode. Existing memory ID that this new memory replaces or corrects.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / association_created
      Added value: +{
      +  "description": "Supersede-mode result: whether old → new association was created.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / superseded_memory_id
      Added value: +{
      +  "description": "Supersede-mode result: ID of the old memory marked invalid.",
      +  "type": "string"
      +}
  3. First observedv0.14.0

TDQS

A4.8/5.0
Behavior5/5

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

The description reveals substantial non-obvious behavior: supersede invalidates the old memory, sets t_invalid=now, merges metadata, and links old-to-new via INVALIDATED_BY/EVOLVED_INTO. It also discloses size limits, auto-summarization over 500 characters, rejection over 2000, and batch-mode field exclusions—all beyond what annotations provide.

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 long but earned: it is organized into modes, size guidelines, when-to-use, and examples, making it scannable despite its length. The most important distinction (single vs batch) is front-loaded, and every section adds reusable decision value.

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

Completeness5/5

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

Given a 16-parameter tool with nested objects, three behavioral modes, and multiple constraints, the description is remarkably complete. It covers entry points, per-parameter limitations, workflow patterns, content quality guidance, and representative examples. The presence of an output schema reduces the need to document return values.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds meaning the schema alone does not convey: mutual exclusivity of content vs memories is explained with mode-based grouping, content size targets are given, supersede parameter behavior is clarified, and three realistic examples show how parameters combine.

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 verb 'store' plus 'memory' and the explicit description of two operating modes (single and batch) make the purpose unmistakable. The supersede/correct mode is also described with concrete behavior, distinguishing it from a plain append operation even without naming siblings.

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?

A dedicated 'When to use' section lists concrete scenarios, and batch mode is specifically recommended for bulk ingestion. However, it never explicitly contrasts this tool with update_memory or delete_memory, so the guidance is clear but lacks exclusions/alternatives.

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