{"record":{"id":"4c6eb251695a285c","repo":"mastra-ai/mastra","slug":"the-workingmemory-use-option-has-been-removed-wor","errorCode":null,"errorMessage":"The workingMemory.use option has been removed. Working memory always uses tool-call mode.","messagePattern":"The workingMemory\\.use option has been removed\\. Working memory always uses tool-call mode\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/memory/memory.ts","lineNumber":384,"sourceCode":"    // Only PG vector store will use these parameters\n    if (indexConfig && (indexConfig.type || indexConfig.ivf || indexConfig.hnsw)) {\n      createParams.indexConfig = {};\n      if (indexConfig.type) createParams.indexConfig.type = indexConfig.type;\n      if (indexConfig.ivf) createParams.indexConfig.ivf = indexConfig.ivf;\n      if (indexConfig.hnsw) createParams.indexConfig.hnsw = indexConfig.hnsw;\n    }\n\n    // Request btree indexes on metadata fields used for filtering\n    // This avoids sequential scans on large tables when querying by thread_id or resource_id\n    createParams.metadataIndexes = ['thread_id', 'resource_id'];\n\n    await this.vector.createIndex(createParams);\n    return { indexName };\n  }\n\n  public getMergedThreadConfig(config?: MemoryConfigInternal): MemoryConfigInternal {\n    if (config?.workingMemory && typeof config.workingMemory === 'object' && 'use' in config.workingMemory) {\n      throw new Error('The workingMemory.use option has been removed. Working memory always uses tool-call mode.');\n    }\n\n    if (config?.threads?.generateTitle !== undefined) {\n      throw new Error(\n        'The threads.generateTitle option has been moved. Use the top-level generateTitle option instead.',\n      );\n    }\n\n    const mergedConfig = deepMerge(this.threadConfig, config || {});\n\n    if (\n      typeof config?.workingMemory === 'object' &&\n      config.workingMemory?.schema &&\n      typeof mergedConfig.workingMemory === 'object'\n    ) {\n      mergedConfig.workingMemory.schema = config.workingMemory.schema;\n    }\n","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/memory/memory.ts#L366-L402","documentation":"The workingMemory.use option ('tool-call' vs 'metadata' modes) was removed; working memory now always operates in tool-call mode. getMergedThreadConfig throws this Error whenever a MemoryConfig contains a workingMemory object with a `use` key, so stale configs fail loudly instead of being silently ignored.","triggerScenarios":"Passing options like { workingMemory: { use: 'tool-call', template: '...' } } into Memory options, thread config, or getMergedThreadConfig.","commonSituations":"Upgrading from an older Mastra version where workingMemory.use was valid; copy-pasting blog posts or old docs examples; generated config code still emitting the deprecated field.","solutions":["Delete the `use` property from the workingMemory object in your Memory options.","Keep other workingMemory settings (template, useStateSignals) that remain supported.","Search your codebase for 'use:' inside workingMemory config blocks after upgrading."],"exampleFix":"// before\noptions: { workingMemory: { use: 'tool-call', template: 'User name: {{name}}' } }\n\n// after\noptions: { workingMemory: { template: 'User name: {{name}}' } }","handlingStrategy":"validation","validationCode":"function assertNoWorkingMemoryUse(options) {\n  const wm = options?.workingMemory;\n  if (wm && typeof wm === 'object' && 'use' in wm) throw new Error('Remove workingMemory.use; tool-call mode is always used');\n}","typeGuard":"function isModernWorkingMemory(wm) {\n  return wm === undefined || typeof wm === 'string' || (typeof wm === 'object' && wm !== null && !('use' in wm));\n}","tryCatchPattern":null,"preventionTips":["After upgrading, grep for workingMemory blocks containing 'use:'.","Type Memory options with a type that omits `use` so TS catches it.","Keep memory options in a single typed constants file."],"tags":["memory","working-memory","deprecation","breaking-change"],"backgroundTag":"removed-option","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}