{"record":{"id":"c918c2875e8f8153","repo":"mastra-ai/mastra","slug":"observational-memory-async-buffering-is-enabled-by","errorCode":null,"errorMessage":"Observational memory async buffering is enabled by default but the installed version of @mastra/core does not support it. Either upgrade @mastra/core, @mastra/memory, and your storage adapter (@mastra/libsql, @mastra/pg, @mastra/mongodb, or @mastra/convex) to the latest version, or explicitly disable async buffering by setting `observation: { bufferTokens: false }` in your observationalMemory config.","messagePattern":"Observational memory async buffering is enabled by default but the installed version of @mastra/core does not support it\\. Either upgrade @mastra/core, @mastra/memory, and your storage adapter \\(@mastra/libsql, @mastra/pg, @mastra/mongodb, or @mastra/convex\\) to the latest version, or explicitly disable async buffering by setting `observation: (.+?)` in your observationalMemory config\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/memory/src/index.ts","lineNumber":1928,"sourceCode":"   * 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    }\n\n    if (omConfig.experimental_subconscious) {\n      await this.getKnowledgeStore();\n    }\n\n    const { ObservationalMemory: OMClass } = await import('./processors/observational-memory');\n","sourceCodeStart":1910,"sourceCodeEnd":1946,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/memory/src/index.ts#L1910-L1946","documentation":"Observational memory's async token buffering is on by default (unless observation.bufferTokens is explicitly false), and it requires the 'asyncBuffering' capability in @mastra/core. When core lacks that feature, Memory throws, telling you either to upgrade core/memory/storage adapter or to explicitly opt out of buffering.","triggerScenarios":"Enabling observationalMemory with an @mastra/core version that has 'observationalMemory' but not 'asyncBuffering', and not setting observation.bufferTokens: false.","commonSituations":"Partially upgraded stacks where core is new enough for OM but storage adapters (libsql/pg/mongodb/convex) or core lag behind the asyncBuffering feature; following docs on newer versions while running older installed packages.","solutions":["Upgrade @mastra/core, @mastra/memory, and your storage adapter (@mastra/libsql, @mastra/pg, @mastra/mongodb, or @mastra/convex) to the latest versions.","Or disable buffering explicitly: observation: { bufferTokens: false } inside the observationalMemory config.","Verify installed versions with pnpm list @mastra/core @mastra/memory to catch lockfile drift."],"exampleFix":"// before\nobservationalMemory: { enabled: true }\n// after (if not upgrading)\nobservationalMemory: { enabled: true, observation: { bufferTokens: false } }","handlingStrategy":"validation","validationCode":"import { features } from '@mastra/core';\nconst om = memoryConfig.observationalMemory;\nif (om?.enabled && om.observation?.bufferTokens !== false && !features.has('asyncBuffering')) {\n  throw new Error('Upgrade the mastra stack or set observation.bufferTokens: false');\n}","typeGuard":"function asyncBufferingCompatible(omConfig: { observation?: { bufferTokens?: number | false } }, coreFeatures: Set<string>): boolean {\n  return omConfig.observation?.bufferTokens === false || coreFeatures.has('asyncBuffering');\n}","tryCatchPattern":"try {\n  await initMemory();\n} catch (e) {\n  if (e instanceof Error && e.message.includes('async buffering')) {\n    logger.error('Either upgrade @mastra/core/@mastra/memory/storage adapter or set observation.bufferTokens: false.');\n  }\n  throw e;\n}","preventionTips":["Upgrade core, memory, and the storage adapter (libsql/pg/mongodb/convex) together.","Set observation.bufferTokens: false explicitly when running a mixed-version stack.","Add a dependency version assertion test to your CI pipeline."],"tags":["memory","observational-memory","async-buffering","version-compatibility"],"backgroundTag":"peer-dependency-version-mismatch","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}