{"record":{"id":"918c696cd8aaa9e6","repo":"mastra-ai/mastra","slug":"observational-memory-is-enabled-but-the-installed","errorCode":null,"errorMessage":"Observational memory is enabled but the installed version of @mastra/core does not support it. Please upgrade @mastra/core to a version that includes observational memory support.","messagePattern":"Observational memory is enabled but the installed version of @mastra/core does not support it\\. Please upgrade @mastra/core to a version that includes observational memory support\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/memory/src/index.ts","lineNumber":1921,"sourceCode":"\n    const memoryStore = await this.getMemoryStore();\n    await memoryStore.saveMessages({ messages: persistableMessages });\n  }\n\n  /**\n   * One-time initialization of the shared ObservationalMemory engine.\n   * Called lazily by the `omEngine` getter on first access.\n   */\n  private async _initOMEngine(): Promise<ObservationalMemory | null> {\n    const omConfig = normalizeObservationalMemoryConfig(this.threadConfig.observationalMemory);\n    if (!omConfig) return null;\n\n    const memoryStore = await this.storage.getStore('memory');\n    if (!memoryStore || !memoryStore.supportsObservationalMemory) return null;\n\n    const coreSupportsOM = coreFeatures.has('observationalMemory');\n    if (!coreSupportsOM) {\n      throw new Error(\n        'Observational memory is enabled but the installed version of @mastra/core does not support it. ' +\n          'Please upgrade @mastra/core to a version that includes observational memory support.',\n      );\n    }\n\n    if (omConfig.observation?.bufferTokens !== false && !coreFeatures.has('asyncBuffering')) {\n      throw new Error(\n        'Observational memory async buffering is enabled by default but the installed version of @mastra/core does not support it. ' +\n          'Either upgrade @mastra/core, @mastra/memory, and your storage adapter (@mastra/libsql, @mastra/pg, @mastra/mongodb, or @mastra/convex) to the latest version, ' +\n          'or explicitly disable async buffering by setting `observation: { bufferTokens: false }` in your observationalMemory config.',\n      );\n    }\n\n    if (!coreFeatures.has('request-response-id-rotation')) {\n      throw new Error(\n        'Observational memory requires @mastra/core support for request-response-id-rotation. Please bump @mastra/core to a newer version.',\n      );\n    }","sourceCodeStart":1903,"sourceCodeEnd":1939,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/memory/src/index.ts#L1903-L1939","documentation":"Observational memory requires runtime feature support in @mastra/core (checked via a coreFeatures capability set). The storage layer advertises observational memory support, but the installed @mastra/core version lacks the 'observationalMemory' feature, so Memory throws and instructs an upgrade. This is a version-compatibility gate between @mastra/memory and @mastra/core.","triggerScenarios":"Enabling observationalMemory in Memory config while @mastra/core is pinned to an older version that predates the 'observationalMemory' feature flag.","commonSituations":"Upgrading @mastra/memory (or using a prerelease) without upgrading @mastra/core; lockfile resolving an older core than package.json suggests; monorepos with mismatched core versions across packages.","solutions":["Upgrade @mastra/core to the latest version: pnpm update @mastra/core (and aligned workspace deps).","If you cannot upgrade core, disable observationalMemory in the Memory config.","Align all @mastra/* packages to the same release line so feature sets match."],"exampleFix":"// before\nconst memory = new Memory({ storage, options: { observationalMemory: { enabled: true } } }); // with old @mastra/core\n// after\n// pnpm update @mastra/core @mastra/memory\nconst memory = new Memory({ storage, options: { observationalMemory: { enabled: true } } });","handlingStrategy":"validation","validationCode":"import { features } from '@mastra/core';\nif (memoryConfig.observationalMemory?.enabled && !features.has('observationalMemory')) {\n  throw new Error('Upgrade @mastra/core before enabling observationalMemory');\n}","typeGuard":"function coreSupportsObservationalMemory(coreFeatures: Set<string>): boolean {\n  return coreFeatures.has('observationalMemory');\n}","tryCatchPattern":"try {\n  await initMemory();\n} catch (e) {\n  if (e instanceof Error && e.message.includes('does not support it. Please upgrade @mastra/core')) {\n    logger.error('Pin @mastra/core and @mastra/memory to matching latest versions.');\n  }\n  throw e;\n}","preventionTips":["Keep @mastra/core and @mastra/memory on the same release line; upgrade them together.","Check installed versions at startup in CI to catch lockfile drift.","Gate observationalMemory config behind a version check when supporting older deployments."],"tags":["memory","observational-memory","version-compatibility","upgrade"],"backgroundTag":"peer-dependency-version-mismatch","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}