Skip to main content
Glama

Store a memory

memory_store

Persist facts, decisions, roles, and history outside the AI context window to prevent loss during resets, enabling retrieval when needed.

Instructions

Persist a fact, decision, role or history entry so it survives context window resets. Use type 'fact' for stable knowledge, 'decision' for choices already made, 'role' for standing instructions/roles, 'history' for condensed chronology of past work.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metaNoV4.4/V4.5: security, lifecycle, and compression metadata
tagsNoKeywords that boost retrieval
typeYesfact | preference | decision | constraint | instruction | role | entity | relationship | event | history | observation
ownerNoV4.7: user | agent | project | organization | global
scopeNo'global' for always-relevant memories, or a project path/id for project-scoped onesglobal
trustNoTrust classification; default derived from provenance (direct store → trusted, conversation digest → unverified)
accessNoV4.7: private | shared | global
sourceNoOriginating session or client
contentYesThe memory itself, written as a standalone statement
retentionNoDecay protection: decaying (default) | pinned (never decays + rank boost) | persistent (archivable, never auto-deleted) | neverExpire (fully exempt) | ephemeral (accelerated clock lands with 4.5.0; today behaves as decaying)
validFromNoISO timestamp when this claim becomes valid
confidenceNoCertainty of this claim 0..1, independent of importance (default 1.0 direct, 0.7 digests)
importanceNo1=minor, 5=critical (default 3)
observedAtNoISO timestamp of the original observation (for backfills)
provenanceNoProvenance (plan §4.3); defaults to { sourceType: manual }
validUntilNoISO timestamp when this claim ceases to be valid
supersededByNoID of the memory that supersedes this one

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changedv4.8.0
    • addedInput schema / properties / access
      Added value: +{
      +  "description": "V4.7: private | shared | global",
      +  "enum": [
      +    "private",
      +    "shared",
      +    "global"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / confidence
      Added value: +{
      +  "description": "Certainty of this claim 0..1, independent of importance (default 1.0 direct, 0.7 digests)",
      +  "maximum": 1,
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / content / minLength
      Added value: +1
    • addedInput schema / properties / importance / default
      Added value: +3
    • addedInput schema / properties / meta
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "V4.4/V4.5: security, lifecycle, and compression metadata",
      +  "properties": {
      +    "compressedFrom": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "compressionAt": {
      +      "type": "string"
      +    },
      +    "contradicted": {
      +      "type": "boolean"
      +    },
      +    "injected": {
      +      "type": "boolean"
      +    },
      +    "quarantined": {
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / observedAt
      Added value: +{
      +  "description": "ISO timestamp of the original observation (for backfills)",
      +  "type": "string"
      +}
    • addedInput schema / properties / owner
      Added value: +{
      +  "description": "V4.7: user | agent | project | organization | global",
      +  "enum": [
      +    "user",
      +    "agent",
      +    "project",
      +    "organization",
      +    "global"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / provenance
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Provenance (plan §4.3); defaults to { sourceType: manual }",
      +  "properties": {
      +    "agentId": {
      +      "description": "Agent that produced the memory",
      +      "type": "string"
      +    },
      +    "agentType": {
      +      "description": "Agent role, e.g. researcher or coder",
      +      "type": "string"
      +    },
      +    "agentVersion": {
      +      "description": "Version of the agent that produced the memory",
      +      "type": "string"
      +    },
      +    "conversationId": {
      +      "description": "Conversation this memory belongs to",
      +      "type": "string"
      +    },
      +    "messageId": {
      +      "description": "Message within that session",
      +      "type": "string"
      +    },
      +    "provider": {
      +      "description": "Provider/model (e.g. the digest LLM)",
      +      "type": "string"
      +    },
      +    "runId": {
      +      "description": "Execution run this memory belongs to",
      +      "type": "string"
      +    },
      +    "sessionId": {
      +      "description": "Session that produced the memory",
      +      "type": "string"
      +    },
      +    "sourceType": {
      +      "description": "manual (default) | conversation | agent | import | system",
      +      "enum": [
      +        "manual",
      +        "conversation",
      +        "agent",
      +        "import",
      +        "system"
      +      ],
      +      "type": "string"
      +    },
      +    "taskId": {
      +      "description": "Task this memory belongs to",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / retention
      Added value: +{
      +  "description": "Decay protection: decaying (default) | pinned (never decays + rank boost) | persistent (archivable, never auto-deleted) | neverExpire (fully exempt) | ephemeral (accelerated clock lands with 4.5.0; today behaves as decaying)",
      +  "enum": [
      +    "pinned",
      +    "persistent",
      +    "ephemeral",
      +    "decaying",
      +    "neverExpire"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / scope / default
      Added value: +"global"
    • addedInput schema / properties / supersededBy
      Added value: +{
      +  "description": "ID of the memory that supersedes this one",
      +  "type": "string"
      +}
    • addedInput schema / properties / tags / default
      Added value: +[]
    • addedInput schema / properties / tags / description
      Added value: +"Keywords that boost retrieval"
    • addedInput schema / properties / trust
      Added value: +{
      +  "description": "Trust classification; default derived from provenance (direct store → trusted, conversation digest → unverified)",
      +  "enum": [
      +    "unverified",
      +    "trusted",
      +    "verified",
      +    "system"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / type / description
      Added value: +"fact | preference | decision | constraint | instruction | role | entity | relationship | event | history | observation"
    • changedInput schema / properties / type / enum
      Previous value: -[
      -  "fact",
      -  "decision",
      -  "role",
      -  "history"
      -]New value: +[
      +  "fact",
      +  "preference",
      +  "decision",
      +  "constraint",
      +  "instruction",
      +  "role",
      +  "entity",
      +  "relationship",
      +  "event",
      +  "history",
      +  "observation"
      +]
    • addedInput schema / properties / validFrom
      Added value: +{
      +  "description": "ISO timestamp when this claim becomes valid",
      +  "type": "string"
      +}
    • addedInput schema / properties / validUntil
      Added value: +{
      +  "description": "ISO timestamp when this claim ceases to be valid",
      +  "type": "string"
      +}
  2. First observedv0.4.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It states persistence across resets, which implies a write operation, but does not mention side effects, overwrite/deduplication behavior, permission requirements, or what happens on success. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 description is concise: a single sentence stating purpose followed by one sentence of type guidance. It front-loads the core action and avoids redundancy. However, it could be slightly more structured by grouping related parameters, but for its length it is efficient with no wasted words.

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

Completeness2/5

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

Given the tool has 17 parameters including nested objects, the description is minimal. It does not explain the other type enums (preference, constraint, instruction, entity, relationship, event, observation), nor does it clarify owner/scope/trust/access semantics or the provenance object. There is no output schema, so return value is unaddressed. The description is inadequate for the tool's complexity.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents all 17 parameters. The description adds semantic guidance for the 'type' parameter by mapping specific types to use cases, which adds value beyond the schema's enum listing. However, it does not add meaning to other parameters like owner, scope, trust, or retention, which remain schema-only. Baseline 3 is appropriate.

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 clearly states the tool persists a memory entry to survive context resets, and gives specific examples of memory types (fact, decision, role, history). This distinguishes it from read-oriented tools like memory_search or memory_list, but it does not explicitly compare to other write tools like memory_batch or memory_update. The verb 'persist' and resource are clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on selecting the 'type' field (fact, decision, role, history) with conditions for each. However, it does not say when to use this tool vs. memory_batch (for storing multiple) or memory_update (for modifying existing entries). No exclusion or alternative tool names are mentioned. Usage guidance is partial.

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