Skip to main content
Glama

remember_user

Store user-specific memories like preferences and identity for persistence across sessions. Use for long-term facts.

Instructions

Store a user-scoped memory that persists across all sessions. Use for preferences, identity, long-term facts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesUser identifier
contentYesMemory content to store
roleNouser
metadataNoOptional key-value metadata

Implementation Reference

  • The handler for 'remember_user' — calls memory.rememberUser() and returns the result as JSON. This is the function that executes the tool logic when the tool is invoked.
    case 'remember_user': {
      const entry = await memory.rememberUser(
        args.userId as string,
        args.content as string,
        (args.role as 'user' | 'assistant' | 'system') || 'user',
        args.metadata as Record<string, unknown> | undefined
      );
      return { content: [{ type: 'text', text: JSON.stringify(entry, null, 2) }] };
    }
  • Input schema definition for 'remember_user' — defines userId (string, required), content (string, required), role (enum with default 'user'), and metadata (optional object). Registered in the ListToolsRequestSchema handler.
    // ── User-scoped (cross-session) memory ──────────────────────────────
    {
      name: 'remember_user',
      description: 'Store a user-scoped memory that persists across all sessions. Use for preferences, identity, long-term facts.',
      inputSchema: {
        type: 'object',
        properties: {
          userId:     { type: 'string', description: 'User identifier' },
          content:    { type: 'string', description: 'Memory content to store' },
          role:       { type: 'string', enum: ['user', 'assistant', 'system'], default: 'user' },
          metadata:   { type: 'object', description: 'Optional key-value metadata' },
        },
        required: ['userId', 'content'],
      },
  • src/index.ts:35-194 (registration)
    The tool is registered in the ListToolsRequestSchema handler within the tools array returned to the MCP client. The 'remember_user' entry is at lines 130-143 of that array (within the broader registration from line 35-256).
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        // ── Session memory ──────────────────────────────────────────────────
        {
          name: 'remember',
          description: 'Store a memory entry for a session. Embeddings and graph extraction happen automatically.',
          inputSchema: {
            type: 'object',
            properties: {
              sessionId:  { type: 'string', description: 'Session identifier' },
              content:    { type: 'string', description: 'Memory content to store' },
              role:       { type: 'string', enum: ['user', 'assistant', 'system'], default: 'user' },
              metadata:   { type: 'object', description: 'Optional key-value metadata' },
            },
            required: ['sessionId', 'content'],
          },
        },
        {
          name: 'recall',
          description: 'Retrieve relevant memories via semantic search (falls back to keyword). Searches working + long_term tiers. Pass userId to blend in cross-session user facts.',
          inputSchema: {
            type: 'object',
            properties: {
              sessionId:  { type: 'string', description: 'Session identifier' },
              query:      { type: 'string', description: 'Search query' },
              limit:      { type: 'number', description: 'Max results (default 10)', default: 10 },
              userId:     { type: 'string', description: 'Optional: also blend in this user\'s cross-session memories' },
              tiers:      { type: 'string', description: 'Comma-separated tiers to search: working,long_term,archived (default: working,long_term)' },
            },
            required: ['sessionId', 'query'],
          },
        },
        {
          name: 'history',
          description: 'Get recent conversation history for a session in chronological order.',
          inputSchema: {
            type: 'object',
            properties: {
              sessionId:  { type: 'string', description: 'Session identifier' },
              limit:      { type: 'number', description: 'Max entries (default 20)', default: 20 },
            },
            required: ['sessionId'],
          },
        },
        {
          name: 'forget',
          description: 'Delete session memories. Delete all, one by ID, or entries before a date.',
          inputSchema: {
            type: 'object',
            properties: {
              sessionId:  { type: 'string', description: 'Session identifier' },
              id:         { type: 'string', description: 'Specific memory ID to delete (optional)' },
              before:     { type: 'string', description: 'ISO date — delete entries before this date (optional)' },
            },
            required: ['sessionId'],
          },
        },
        {
          name: 'stats',
          description: 'Memory statistics for a session — total, by role, by tier (working/long_term/archived), graph counts.',
          inputSchema: {
            type: 'object',
            properties: {
              sessionId:  { type: 'string', description: 'Session identifier' },
            },
            required: ['sessionId'],
          },
        },
        {
          name: 'consolidate',
          description: 'Consolidate old working memories into dense long-term summaries via LLM. Archives originals.',
          inputSchema: {
            type: 'object',
            properties: {
              sessionId:  { type: 'string', description: 'Session identifier' },
              batch:      { type: 'number', description: 'Number of memories to consolidate (default 50)' },
              keep:       { type: 'number', description: 'Most recent N to leave untouched (default 20)' },
              dryRun:     { type: 'boolean', description: 'Preview summaries without writing (default false)' },
            },
            required: ['sessionId'],
          },
        },
        {
          name: 'graph',
          description: 'Query the knowledge graph for an entity — returns relationships and source memories. Requires ENGRAM_GRAPH=1.',
          inputSchema: {
            type: 'object',
            properties: {
              sessionId:  { type: 'string', description: 'Session identifier' },
              entity:     { type: 'string', description: 'Entity name to look up (case-insensitive)' },
            },
            required: ['sessionId', 'entity'],
          },
        },
        // ── User-scoped (cross-session) memory ──────────────────────────────
        {
          name: 'remember_user',
          description: 'Store a user-scoped memory that persists across all sessions. Use for preferences, identity, long-term facts.',
          inputSchema: {
            type: 'object',
            properties: {
              userId:     { type: 'string', description: 'User identifier' },
              content:    { type: 'string', description: 'Memory content to store' },
              role:       { type: 'string', enum: ['user', 'assistant', 'system'], default: 'user' },
              metadata:   { type: 'object', description: 'Optional key-value metadata' },
            },
            required: ['userId', 'content'],
          },
        },
        {
          name: 'recall_user',
          description: 'Recall user-scoped memories — works from any session context.',
          inputSchema: {
            type: 'object',
            properties: {
              userId:     { type: 'string', description: 'User identifier' },
              query:      { type: 'string', description: 'Search query (optional — returns all if omitted)' },
              limit:      { type: 'number', description: 'Max results (default 10)', default: 10 },
            },
            required: ['userId'],
          },
        },
        {
          name: 'forget_user',
          description: 'Delete user-scoped memories.',
          inputSchema: {
            type: 'object',
            properties: {
              userId:     { type: 'string', description: 'User identifier' },
              id:         { type: 'string', description: 'Specific memory ID (optional)' },
              before:     { type: 'string', description: 'ISO date — delete entries before this date (optional)' },
            },
            required: ['userId'],
          },
        },
        {
          name: 'consolidate_user',
          description: 'Consolidate user-scoped working memories into long-term summaries.',
          inputSchema: {
            type: 'object',
            properties: {
              userId:     { type: 'string', description: 'User identifier' },
              batch:      { type: 'number', description: 'Number of memories to consolidate (default 50)' },
              keep:       { type: 'number', description: 'Most recent N to leave untouched (default 20)' },
              dryRun:     { type: 'boolean', description: 'Preview without writing (default false)' },
            },
            required: ['userId'],
          },
        },
        {
          name: 'user_stats',
          description: 'Memory statistics for a user — total, by role, by tier.',
          inputSchema: {
            type: 'object',
            properties: {
              userId:     { type: 'string', description: 'User identifier' },
            },
            required: ['userId'],
          },
        },
Behavior3/5

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

The description discloses that the memory persists across sessions, which is a key behavioral trait. However, with no annotations provided, it fails to mention whether writes are idempotent, permissions required, or any side effects (e.g., overwriting existing memories). For a write tool, more transparency would be beneficial.

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 extremely concise with two sentences, no redundancy, and the most important information ('store', 'user-scoped', 'persists across sessions') is front-loaded. Every word earns its place.

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

Completeness3/5

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

Given the tool has 4 parameters (including a nested object) and no output schema, the description does not explain return values or error conditions. It covers purpose and persistence, but for a memory store tool, additional context on idempotency or update semantics would improve completeness.

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?

The input schema already covers 75% of parameters with descriptions. The description adds the concept of persistence and usage context but does not enhance parameter meaning beyond the schema. The 'role' parameter lacks a description in the schema, and the description does not compensate for this gap.

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 states a specific verb ('Store') and resource ('user-scoped memory'), and provides concrete use cases ('preferences, identity, long-term facts'). It clearly differentiates from sibling tools by emphasizing the user-scoped nature, which contrasts with a generic 'remember' tool.

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 description indicates the tool is for storing user-specific persistent memories, implying it should be used over the non-user-scoped sibling 'remember' for user-scoped data. However, it does not explicitly mention when not to use it or specify alternatives for other scenarios.

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/Cartisien/engram-mcp'

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