Skip to main content
Glama

Store Memory

store_memory

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

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: "8f3a2c1e-5b7d-4e9a-a1c3-2d4f6b8e0a91", supersede_reason: "Correction from user" })

Input 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

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.6/5.0
Behavior5/5

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

Beyond the annotations, the description discloses key side effects: supersede marks the old memory invalid, merges metadata, and creates an INVALIDATED_BY or EVOLVED_INTO relation. It also documents batch limitations, content-size summarization/rejection thresholds, and mode-specific constraints.

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 justified by a 16-parameter tool with three storage modes. Headers, bullets, and examples are front-loaded around mode choice, and the length is proportionate to the tool's complexity.

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 the annotations, complete schema, nested objects, and output schema, the description covers the information needed to call the tool correctly: mode selection, supersede behavior, batch constraints, and size limits. No essential call-correctness detail appears missing.

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 substantial meaning: XOR-style mode selection, per-item batch restrictions, supersede side effects, content-size guidelines, and concrete examples. These details go materially beyond the schema field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource and clearly separates single, supersede, and batch storage modes. It does not explicitly name sibling tools such as recall_memory or update_memory, so sibling differentiation is left implicit.

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?

It provides concrete 'When to use' scenarios, including decisions, patterns, bug fixes, preferences, and bulk ingestion, and it explains when to choose batch versus single mode. It stops short of explicit when-not guidance or naming sibling alternatives for updates versus storage.

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