mastra-ai/mastra · error

Observational memory is enabled but the installed version of

Error message

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.

What it means

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.

Source

Thrown at packages/memory/src/index.ts:1921

    const memoryStore = await this.getMemoryStore();
    await memoryStore.saveMessages({ messages: persistableMessages });
  }

  /**
   * One-time initialization of the shared ObservationalMemory engine.
   * Called lazily by the `omEngine` getter on first access.
   */
  private async _initOMEngine(): Promise<ObservationalMemory | null> {
    const omConfig = normalizeObservationalMemoryConfig(this.threadConfig.observationalMemory);
    if (!omConfig) return null;

    const memoryStore = await this.storage.getStore('memory');
    if (!memoryStore || !memoryStore.supportsObservationalMemory) return null;

    const coreSupportsOM = coreFeatures.has('observationalMemory');
    if (!coreSupportsOM) {
      throw new Error(
        '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.',
      );
    }

    if (omConfig.observation?.bufferTokens !== false && !coreFeatures.has('asyncBuffering')) {
      throw new Error(
        '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.',
      );
    }

    if (!coreFeatures.has('request-response-id-rotation')) {
      throw new Error(
        'Observational memory requires @mastra/core support for request-response-id-rotation. Please bump @mastra/core to a newer version.',
      );
    }

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Upgrade @mastra/core to the latest version: pnpm update @mastra/core (and aligned workspace deps).
  2. If you cannot upgrade core, disable observationalMemory in the Memory config.
  3. Align all @mastra/* packages to the same release line so feature sets match.

Example fix

// before
const memory = new Memory({ storage, options: { observationalMemory: { enabled: true } } }); // with old @mastra/core
// after
// pnpm update @mastra/core @mastra/memory
const memory = new Memory({ storage, options: { observationalMemory: { enabled: true } } });
Defensive patterns

Strategy: validation

Validate before calling

import { features } from '@mastra/core';
if (memoryConfig.observationalMemory?.enabled && !features.has('observationalMemory')) {
  throw new Error('Upgrade @mastra/core before enabling observationalMemory');
}

Type guard

function coreSupportsObservationalMemory(coreFeatures: Set<string>): boolean {
  return coreFeatures.has('observationalMemory');
}

Try / catch

try {
  await initMemory();
} catch (e) {
  if (e instanceof Error && e.message.includes('does not support it. Please upgrade @mastra/core')) {
    logger.error('Pin @mastra/core and @mastra/memory to matching latest versions.');
  }
  throw e;
}

Prevention

When it happens

Trigger: Enabling observationalMemory in Memory config while @mastra/core is pinned to an older version that predates the 'observationalMemory' feature flag.

Common situations: 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.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/918c696cd8aaa9e6. Report an issue: GitHub.