Skip to main content
Glama

remember

Store user memories with automatic duplicate detection and category-based decay rates to maintain relevant information over time.

Instructions

Store a memory about the user. Automatically detects duplicates and reinforces existing memories instead. Categories: one-time, question, interest, preference, correction, fact, context. Each category decays at a different rate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesWhat to remember
categoryNoMemory type. "one-time" decays in 7 days. "preference" lasts 6 months. Default: question (14 days)
tagsNoComma-separated tags for better recall matching

Implementation Reference

  • The `handleRemember` function processes the "remember" tool call, creating or updating memories based on existing content.
    function handleRemember(args) {
      const { content, category = 'question', tags = '' } = args;
      if (!content) return { error: 'Missing "content"' };
    
      const validCats = Object.keys(CATEGORY_CONFIG);
      const cat = validCats.includes(category) ? category : 'question';
    
      const memories = loadMemories();
    
      // Check for duplicate/similar content — reinforce instead of duplicate
      const existing = memories.find(m =>
        m.content.toLowerCase().includes(content.toLowerCase().slice(0, 50)) ||
        content.toLowerCase().includes(m.content.toLowerCase().slice(0, 50))
      );
    
      if (existing) {
        existing.mention_count += 1;
        existing.last_reinforced = Date.now();
        // Upgrade category if mentioned enough
        if (existing.mention_count >= 5 && existing.category === 'question') {
          existing.category = 'interest';
          existing.base_weight = CATEGORY_CONFIG['interest'].base_weight;
          existing.decay_halflife_days = CATEGORY_CONFIG['interest'].decay_halflife_days;
        }
        saveMemories(memories);
        const rel = computeRelevance(existing);
        return {
          action: 'reinforced_existing',
          id: existing.id,
          mention_count: existing.mention_count,
          category: existing.category,
          relevance: rel.relevance,
          status: rel.status,
          message: `Memory reinforced (mention #${existing.mention_count}). ${existing.mention_count >= 5 ? 'Upgraded to "interest".' : ''}`
        };
      }
    
      const memory = createMemory(content, cat, tags);
      memories.push(memory);
      saveMemories(memories);
    
      const rel = computeRelevance(memory);
      return {
        action: 'created',
        id: memory.id,
        category: memory.category,
        relevance: rel.relevance,
        decay_halflife: `${memory.decay_halflife_days} days`,
        message: `Stored as "${cat}". Will fade to 50% relevance in ${memory.decay_halflife_days} days unless reinforced.`
      };
    }
  • index.js:371-384 (registration)
    Definition of the "remember" tool within the `getToolDefinitions` method of `MCPMemoryServer`.
    return [
      {
        name: 'remember',
        description: 'Store a memory about the user. Automatically detects duplicates and reinforces existing memories instead. Categories: one-time, question, interest, preference, correction, fact, context. Each category decays at a different rate.',
        inputSchema: {
          type: 'object',
          properties: {
            content: { type: 'string', description: 'What to remember' },
            category: { type: 'string', enum: Object.keys(CATEGORY_CONFIG), description: 'Memory type. "one-time" decays in 7 days. "preference" lasts 6 months. Default: question (14 days)' },
            tags: { type: 'string', description: 'Comma-separated tags for better recall matching' }
          },
          required: ['content']
        }
      },
  • index.js:461-461 (registration)
    Tool call handling logic in `handleRequest` which routes the "remember" tool call to `handleRemember`.
    case 'remember': result = handleRemember(args); break;
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively explains the duplicate detection logic, the reinforcement fallback behavior, and the decay system (noting categories have different lifespans). Could be improved by explaining what 'reinforcement' entails (e.g., timestamp update, counter increment) or error conditions.

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?

Three sentences with zero waste: first establishes purpose, second discloses critical duplicate-handling behavior, third explains category semantics. Information is front-loaded and appropriately dense for a 3-parameter tool with 100% schema coverage.

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 the schema richness (100% coverage) and lack of output schema, the description is highly complete. It covers the core functionality, behavioral nuances (decay, duplicates), and parameter context. Minor gap in not describing the return value or success confirmation, but this is less critical given the storage-oriented nature of the tool.

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%, establishing a baseline of 3. The description adds value by explaining the duplicate detection logic relevant to the 'content' parameter and clarifying that the category system involves temporal decay. It reinforces the enum values by listing them, though specific decay timelines reside in the schema.

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 the specific verb 'Store' and resource 'memory about the user', clearly defining the operation. It distinguishes itself from the 'reinforce' sibling by explicitly stating that it 'reinforces existing memories instead' when duplicates are detected, clarifying its relationship to the broader memory management suite.

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?

Provides clear context on when to use specific categories (noting they decay at different rates) and explains the automatic duplicate detection behavior, which guides the agent to call this tool without pre-checking for existing memories. Lacks explicit comparison to siblings like 'reinforce' or 'recall' regarding when to prefer those alternatives.

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

Install Server

Other Tools

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/ShipItAndPray/mcp-memory'

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