Skip to main content
Glama

add_episodic_memory

Store user experiences and events with context, sentiment, and outcomes to build searchable memory for personalized AI interactions.

Instructions

Add a new episodic memory (past experience or event)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextYesContext surrounding the event
eventYesDescription of the event
outcomeNoOutcome or resolution of the event
sentimentNoSentiment of the experience
sessionIdNoOptional session identifier
tagsNoTags for categorizing the memory
userIdYesUser identifier

Implementation Reference

  • MCP tool handler case for 'add_episodic_memory': validates input parameters and delegates to MemoryStore.addEpisodicMemory, returning the generated memory ID.
    case "add_episodic_memory": {
      const memoryData = request.params.arguments as any;
      
      // Validate inputs
      ValidationUtils.validateUserId(memoryData.userId);
      ValidationUtils.validateEpisodicEvent(memoryData.event);
      ValidationUtils.validateEpisodicContext(memoryData.context);
      
      if (memoryData.sessionId !== undefined) {
        ValidationUtils.validateSessionId(memoryData.sessionId);
      }
      
      if (memoryData.outcome !== undefined) {
        ValidationUtils.validateEpisodicOutcome(memoryData.outcome);
      }
      
      ValidationUtils.validateSentiment(memoryData.sentiment);
      ValidationUtils.validateTags(memoryData.tags);
      
      const id = memoryStore.addEpisodicMemory(memoryData);
      return {
        content: [{
          type: "text",
          text: `Added episodic memory with ID: ${id}`
        }]
      };
    }
  • Input schema definition for the 'add_episodic_memory' tool, specifying parameters, types, descriptions, and required fields.
    {
      name: "add_episodic_memory",
      description: "Add a new episodic memory (past experience or event)",
      inputSchema: {
        type: "object",
        properties: {
          userId: {
            type: "string",
            description: "User identifier"
          },
          sessionId: {
            type: "string",
            description: "Optional session identifier"
          },
          event: {
            type: "string",
            description: "Description of the event"
          },
          context: {
            type: "string",
            description: "Context surrounding the event"
          },
          outcome: {
            type: "string",
            description: "Outcome or resolution of the event"
          },
          sentiment: {
            type: "string",
            enum: ["positive", "negative", "neutral"],
            description: "Sentiment of the experience"
          },
          tags: {
            type: "array",
            items: { type: "string" },
            description: "Tags for categorizing the memory"
          }
        },
        required: ["userId", "event", "context"]
      }
    },
  • Core implementation of adding episodic memory: generates unique ID, adds timestamp, stores in map, persists to JSON file, and returns ID.
    addEpisodicMemory(memory: Omit<EpisodicMemory, 'id' | 'timestamp'>): string {
      const id = `episodic_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
      const episodicMemory: EpisodicMemory = {
        ...memory,
        id,
        timestamp: Date.now()
      };
      
      this.episodicMemory.set(id, episodicMemory);
      this.persistEpisodicMemory();
      return id;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool adds a memory but doesn't disclose behavioral traits like whether this is a write operation (implied but not explicit), what permissions are needed, how duplicates are handled, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is a significant gap.

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 a single, efficient sentence with zero waste. It's front-loaded with the core purpose and includes clarifying parentheses that add value without verbosity. Every word earns its place.

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 complexity (7 parameters, 3 required), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, error conditions, or behavioral nuances. For a mutation tool with rich parameters, more context is needed to guide effective use.

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 7 parameters. The description adds no parameter-specific information beyond what's in the schema, such as examples or usage notes. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't need to.

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 action ('Add') and resource ('episodic memory'), with additional clarifying context ('past experience or event'). It distinguishes from siblings like 'get_episodic_memory' by specifying creation rather than retrieval. However, it doesn't explicitly differentiate from other memory-setting tools like 'set_long_term_memory' beyond the memory type.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'set_long_term_memory', 'set_short_term_memory', and 'search_episodic_memory', there's no indication of appropriate contexts, prerequisites, or exclusions for this specific tool.

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

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