Skip to main content
Glama

forget_user

Delete user-scoped memories from persistent semantic storage by specifying user ID, optional memory ID, or date range.

Instructions

Delete user-scoped memories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesUser identifier
idNoSpecific memory ID (optional)
beforeNoISO date — delete entries before this date (optional)

Implementation Reference

  • Handler for 'forget_user' tool that processes the request, builds options object with optional id and before parameters, calls memory.forgetUser(), and returns a formatted response with the count of deleted memories
    case 'forget_user': {
      const opts: Parameters<typeof memory.forgetUser>[1] = {};
      if (args.id) opts.id = args.id as string;
      if (args.before) opts.before = new Date(args.before as string);
      const deleted = await memory.forgetUser(args.userId as string, opts);
      return { content: [{ type: 'text', text: `Deleted ${deleted} user memor${deleted === 1 ? 'y' : 'ies'}.` }] };
    }
  • Tool registration with name 'forget_user', description, and input schema defining userId (required), id (optional), and before (optional ISO date) parameters
    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'],
    },
  • Initialization of the Engram memory instance from @cartisien/engram package, which provides the forgetUser() method used by the handler
    const memory = new Engram({
      dbPath: DB_PATH,
      embeddingUrl: EMBEDDING_URL,
      semanticSearch: true,
      graphMemory: process.env.ENGRAM_GRAPH === '1',
      graphModel: GRAPH_MODEL,
      consolidateModel: CONSOLIDATE_MODEL,
    });

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