Skip to main content
Glama

Store Memory

store_memory

Store persistent memories individually or in batches, including corrections that supersede outdated entries, so AI assistants retain accurate context across conversations.

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" })

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "store_memory"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoe.g. ["bugfix", "auth", "<project-slug>"]
typeNo
contentNoSingle mode (XOR with `memories`). Include context, reasoning, and outcome.
t_validNoISO 8601 start of validity. Not in batch mode.
memoriesNoBatch mode (XOR with `content`). Other top-level fields apply to single mode only; items take no `embedding`, `t_valid` or `t_invalid`.
metadataNoStructured details, e.g. { files_modified: ["auth.ts"] }
embeddingNoAuto-generated if omitted. Not in batch mode.
t_invalidNoISO 8601 expiry. Not in batch mode.
timestampNoISO 8601; defaults to now.
confidenceNoType confidence; defaults to 0.9 when `type` is set.
importanceNo0.9+ critical decisions, 0.7-0.9 patterns/bugs, 0.5-0.7 minor notes
updated_atNoISO 8601
last_accessedNoISO 8601
supersede_reasonNoSupersede mode: reason stored on the old memory's metadata.
supersede_relationNoSupersede mode: relation from old to new.INVALIDATED_BY
supersedes_memory_idNoSupersede mode: ID of the memory this one replaces or corrects.

Output Schema

NameRequiredDescriptionDefault
qdrantNoBatch mode.
storedNoBatch mode.
messageYes
memory_idNoSingle mode: ID of the stored memory.
enrichmentNoBatch mode.
memory_idsNoBatch mode.
query_time_msNoBatch mode.
association_createdNoSupersede mode.
superseded_memory_idNoSupersede mode: the old memory, now invalid.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed25 schema fields changedv0.14.4
    • changedInput schema / properties / confidence / description
      Previous value: -"Single-memory mode. Classification confidence (0-1, default 0.9 when type provided)"New value: +"Type confidence; defaults to 0.9 when `type` is set."
    • changedInput schema / properties / content / description
      Previous value: -"Single-memory mode (XOR with `memories`). The memory content to store. Be specific: include context, reasoning, and outcome."New value: +"Single mode (XOR with `memories`). Include context, reasoning, and outcome."
    • changedInput schema / properties / embedding / description
      Previous value: -"Single-memory mode only. Optional embedding vector for semantic search (auto-generated if omitted). Not supported in batch mode."New value: +"Auto-generated if omitted. Not in batch mode."
    • changedInput schema / properties / importance / description
      Previous value: -"Single-memory mode. Importance: 0.9+ critical decisions, 0.7-0.9 patterns/bugs, 0.5-0.7 minor notes"New value: +"0.9+ critical decisions, 0.7-0.9 patterns/bugs, 0.5-0.7 minor notes"
    • changedInput schema / properties / last_accessed / description
      Previous value: -"Single-memory mode. ISO 8601 last-accessed timestamp"New value: +"ISO 8601"
    • 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 `embedding`, `t_valid`, or `t_invalid` per-item — use single-memory mode for those."New value: +"Batch mode (XOR with `content`). Other top-level fields apply to single mode only; items take no `embedding`, `t_valid` or `t_invalid`."
    • changedInput schema / properties / metadata / description
      Previous value: -"Single-memory mode. Optional structured metadata (e.g., { files_modified: [\"auth.ts\"], error_type: \"timeout\" })"New value: +"Structured details, e.g. { files_modified: [\"auth.ts\"] }"
    • changedInput schema / properties / supersede_reason / description
      Previous value: -"Single-memory supersede mode. Optional reason stored on the old memory's metadata."New value: +"Supersede mode: reason stored on the old memory's metadata."
    • changedInput schema / properties / supersede_relation / description
      Previous value: -"Single-memory supersede mode. Relationship to create from old memory to new memory."New value: +"Supersede mode: relation from old to new."
    • changedInput schema / properties / supersedes_memory_id / description
      Previous value: -"Single-memory supersede mode. Existing memory ID that this new memory replaces or corrects."New value: +"Supersede mode: ID of the memory this one replaces or corrects."
    • changedInput schema / properties / t_invalid / description
      Previous value: -"Single-memory mode only. ISO 8601 timestamp when the memory expires. Not supported in batch mode."New value: +"ISO 8601 expiry. Not in batch mode."
    • changedInput schema / properties / t_valid / description
      Previous value: -"Single-memory mode only. ISO 8601 timestamp when the memory becomes valid. Not supported in batch mode."New value: +"ISO 8601 start of validity. Not in batch mode."
    • changedInput schema / properties / tags / description
      Previous value: -"Single-memory mode. Tags to categorize the memory (e.g., [\"project-name\", \"bug-fix\", \"auth\"])"New value: +"e.g. [\"bugfix\", \"auth\", \"<project-slug>\"]"
    • changedInput schema / properties / timestamp / description
      Previous value: -"Single-memory mode. Optional ISO timestamp (defaults to now)"New value: +"ISO 8601; defaults to now."
    • removedInput schema / properties / type / description
      Removed value: -"Single-memory mode. Memory type for classification"
    • changedInput schema / properties / updated_at / description
      Previous value: -"Single-memory mode. ISO 8601 last-updated timestamp"New value: +"ISO 8601"
    • changedOutput schema / properties / association_created / description
      Previous value: -"Supersede-mode result: whether old → new association was created."New value: +"Supersede mode."
    • changedOutput schema / properties / enrichment / description
      Previous value: -"Batch-mode result: enrichment status from the server."New value: +"Batch mode."
    • changedOutput schema / properties / memory_id / description
      Previous value: -"Single-mode result: unique ID of the stored memory (use for associations)"New value: +"Single mode: ID of the stored memory."
    • changedOutput schema / properties / memory_ids / description
      Previous value: -"Batch-mode result: IDs of the stored memories."New value: +"Batch mode."
    • removedOutput schema / properties / message / description
      Removed value: -"Confirmation message"
    • changedOutput schema / properties / qdrant / description
      Previous value: -"Batch-mode result: Qdrant indexing summary from the server."New value: +"Batch mode."
    • changedOutput schema / properties / query_time_ms / description
      Previous value: -"Batch-mode result: server-reported execution time in milliseconds."New value: +"Batch mode."
    • changedOutput schema / properties / stored / description
      Previous value: -"Batch-mode result: number of memories stored."New value: +"Batch mode."
    • changedOutput schema / properties / superseded_memory_id / description
      Previous value: -"Supersede-mode result: ID of the old memory marked invalid."New value: +"Supersede mode: the old memory, now invalid."
  2. 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."
  3. 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"
      +}
  4. First observedv0.14.0

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only declare the mutation/safety profile; the description goes well beyond them by disclosing content-size thresholds (target 150-300, auto-summarize above 500, hard reject at 2000), batch ceiling of 500 items, and — critically — the server-side side effects of supersede mode (old memory marked invalid with t_invalid=now, metadata merged, INVALIDATED_BY/EVOLVED_INTO edge created). Supersede invalidating another record is exactly the kind of consequence an agent needs before calling, and the description surfaces it.

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?

Well front-loaded with mode definitions first, then size rules, then usage triggers, then worked examples — the ordering matches how an agent would need the information. It is long, and the batch-mode field exclusions are stated twice (once in the mode 2 paragraph, once in the schema description), which is minor redundancy rather than noise.

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 16-parameter tool with nested batch objects, the description covers modes, limits, defaults, and mutation side effects thoroughly, and the existing output schema relieves it of explaining return values. The remaining gap is failure semantics: nothing says whether an oversized or invalid item in a 500-item batch rejects the whole request or only that item.

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 already 94%, so the baseline is 3, but the description adds genuine meaning on top: which fields are XOR-exclusive (content vs memories), which fields are unavailable in batch mode (embedding, t_valid, t_invalid), and a content-formatting convention with a title/context/impact structure. It doesn't explain the ambiguity created by zero required parameters — what happens if neither content nor memories is supplied.

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?

States a specific verb and resource (store memory) and enumerates three distinct modes — single, supersede, batch — so an agent can tell what the tool does and which calling shape applies. It falls short of a 5 because it never differentiates itself from siblings like update_memory or associate_memories, even though supersede mode clearly overlaps with both.

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 "When to use" block gives five concrete triggers (after a decision, on discovering a pattern, after a bugfix, on learning preferences, bulk ingestion) and routes bulk work explicitly to batch mode. What's missing is the negative case: no guidance on when to use update_memory instead of storing a superseding memory, or when not to store at all.

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