mem0ai/mem0 · error

The decay parameter is not supported by the OSS Memory SDK.

Error message

The decay parameter is not supported by the OSS Memory SDK.

What it means

updateProject(options) in the OSS TypeScript SDK always throws because project-level updates are a hosted-platform feature; when options.decay === true it additionally fetches a telemetry/notice id and throws a decay-specific feature message explaining that decay is platform-only. The type is Promise<never>, signaling the method intentionally never succeeds.

Source

Thrown at mem0-ts/src/oss/src/memory/index.ts:714

      this.telemetryId = "anonymous";
      return this.telemetryId;
    }
  }

  static fromConfig(configDict: Record<string, any>): Memory {
    try {
      const config = MemoryConfigSchema.parse(configDict);
      return new Memory(config);
    } catch (e) {
      console.error("Configuration validation error:", e);
      throw e;
    }
  }

  async updateProject(options: UpdateProjectOptions = {}): Promise<never> {
    if (options?.decay === true) {
      await this._getNoticeTelemetryId();
      throw new Error(await getDecayFeatureErrorMessage(this));
    }

    throw new Error("Project updates are not supported by the OSS Memory SDK.");
  }

  async add(
    messages: string | Message[],
    config: AddMemoryOptions,
  ): Promise<SearchResult> {
    if (config?.timestamp !== undefined) {
      await this._getNoticeTelemetryId();
      throw new Error(
        await getTemporalFeatureErrorMessage(this, {
          triggerFunction: "add",
          triggerParameter: "timestamp",
        }),
      );
    }

View on GitHub (pinned to 001c235229)

Solutions

  1. Use the hosted MemoryClient with a MEM0_API_KEY if you need project updates/decay.
  2. Remove the updateProject({ decay: true }) call from OSS code paths; decay is not available self-hosted.
  3. Branch by client type if code is shared: only call updateProject on MemoryClient instances.
  4. For self-hosted decay-like behavior, implement your own recency weighting when ranking retrieved memories.

Example fix

// before (OSS Memory)
await memory.updateProject({ decay: true }); // throws: decay not supported

// after
import { MemoryClient } from 'mem0ai';
const client = new MemoryClient({ apiKey: process.env.MEM0_API_KEY });
await client.updateProject({ projectId, decay: true }); // supported on hosted platform
Defensive patterns

Strategy: type-guard

Validate before calling

function assertPlatformClient(client: unknown, method: string): void {
  if (!(client instanceof MemoryClient)) {
    throw new TypeError(`${method}() is hosted-platform only; use MemoryClient, not OSS Memory`);
  }
}

Type guard

function supportsProjectUpdates(client: Memory | MemoryClient): client is MemoryClient {
  return 'projectId' in (client as MemoryClient) || client instanceof MemoryClient;
}

Try / catch

try {
  await memory.updateProject({ decay: true });
} catch (err) {
  if (err instanceof Error && /decay .*not supported/i.test(err.message)) {
    // feature gate: skip decay in OSS mode, or route to hosted client
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling memory.updateProject({ decay: true }) (or any truthy decay) on an OSS Memory instance — code ported from the hosted MemoryClient API where updateProject({ decay: true }) is valid.

Common situations: Sharing code between the hosted client (mem0ai MemoryClient) and the OSS SDK (mem0ai/oss Memory) and calling the platform method on the wrong instance; following platform docs while self-hosting; trying to apply memory decay/aging to a self-hosted deployment.

Related errors


AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15). Data as JSON: /api/errors/4d60a08fb5dddb46. Report an issue: GitHub.