{"record":{"id":"f007d700ed909831","repo":"mastra-ai/mastra","slug":"the-processors-option-in-memory-is-deprecated-an","errorCode":null,"errorMessage":"The 'processors' option in Memory is deprecated and has been removed.\n      \nPlease use the new Input/Output processor system instead:\n\nOLD (deprecated):\n  new Memory({\n    processors: [new TokenLimiter(100000)]\n  })\n\nNEW (use this):\n  new Agent({\n    memory,\n    outputProcessors: [\n      new TokenLimiterProcessor(100000)\n    ]\n  })\n\nOr pass memory directly to processor arrays:\n  new Agent({\n    inputProcessors: [memory],\n    outputProcessors: [memory]\n  })\n\nSee: https://mastra.ai/en/docs/memory/processors","messagePattern":"The 'processors' option in Memory is deprecated and has been removed\\.\n      \nPlease use the new Input/Output processor system instead:\n\nOLD \\(deprecated\\):\n  new Memory\\((.+?)\\)\n\nNEW \\(use this\\):\n  new Agent\\((.+?)\\)\n\nOr pass memory directly to processor arrays:\n  new Agent\\((.+?)\\)\n\nSee: https://mastra\\.ai/en/docs/memory/processors","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/memory/memory.ts","lineNumber":138,"sourceCode":"\n  MAX_CONTEXT_TOKENS?: number;\n\n  protected _storage?: MastraCompositeStore;\n  vector?: MastraVector;\n  embedder?: MastraEmbeddingModel<string>;\n  embedderOptions?: MastraEmbeddingOptions;\n  protected threadConfig: MemoryConfigInternal = { ...memoryDefaultOptions };\n  #mastra?: Mastra;\n\n  constructor(config: { id?: string; name: string } & SharedMemoryConfig) {\n    super({ component: 'MEMORY', name: config.name });\n    this.id = config.id ?? config.name ?? 'default-memory';\n\n    if (config.options) this.threadConfig = this.getMergedThreadConfig(config.options);\n\n    // DEPRECATION: Block old processors config\n    if (config.processors) {\n      throw new Error(\n        `The 'processors' option in Memory is deprecated and has been removed.\n      \nPlease use the new Input/Output processor system instead:\n\nOLD (deprecated):\n  new Memory({\n    processors: [new TokenLimiter(100000)]\n  })\n\nNEW (use this):\n  new Agent({\n    memory,\n    outputProcessors: [\n      new TokenLimiterProcessor(100000)\n    ]\n  })\n\nOr pass memory directly to processor arrays:","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/memory/memory.ts#L120-L156","documentation":"The old Memory constructor option `processors` (e.g. TokenLimiter) has been removed. Passing it now throws immediately with a migration guide instead of silently ignoring the option, because memory-level processors were replaced by the Agent-level Input/Output processor system.","triggerScenarios":"Constructing new Memory({ ..., processors: [tokenLimiter] }) with any truthy processors value in the config.","commonSituations":"Upgrading from a pre-processor-system Mastra version where Memory accepted processors; following an old tutorial or copied code snippet; type errors previously masked (or using JS) so the stale option survives until runtime.","solutions":["Remove processors from the Memory config and move them to the Agent as outputProcessors/inputProcessors.","Replace memory memory-processors with their processor-system equivalents (e.g. TokenLimiter -> TokenLimiterProcessor).","Alternatively pass the memory instance itself into the agent's inputProcessors/outputProcessors arrays where supported.","Follow the docs link in the message (mastra.ai/en/docs/memory/processors) for the full migration."],"exampleFix":"// before\nnew Memory({ storage, processors: [new TokenLimiter(100000)] });\n// after\nnew Agent({\n  memory: new Memory({ storage }),\n  outputProcessors: [new TokenLimiterProcessor(100000)],\n});","handlingStrategy":"type-guard","validationCode":"function assertNoLegacyMemoryProcessors(config) {\n  if ('processors' in config && config.processors != null) {\n    throw new Error(\"'processors' was removed from Memory; use Agent inputProcessors/outputProcessors\");\n  }\n}","typeGuard":"type LegacyMemoryConfig = { processors?: unknown };\nfunction usesLegacyProcessors(config: object): config is LegacyMemoryConfig {\n  return 'processors' in config && (config as LegacyMemoryConfig).processors != null;\n}","tryCatchPattern":"try {\n  const memory = new Memory(config);\n} catch (e) {\n  if (e instanceof Error && e.message.includes(\"'processors' option in Memory is deprecated\")) {\n    throw new Error('Migrate memory processors to Agent outputProcessors; see mastra.ai/en/docs/memory/processors');\n  } throw e;\n}","preventionTips":["After upgrading, grep for `new Memory(` calls containing `processors:`.","Use the @mastra/core Memory TypeScript types — the removed option should fail typecheck.","Map old memory processors to their processor-system equivalents in one migration commit."],"tags":["deprecation","memory","migration","breaking-change"],"backgroundTag":"removed-api-migration","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}