mem0ai/mem0 · error

The referenceDate parameter is not supported by the OSS Memo

Error message

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

What it means

Thrown by Memory.search() when the config object includes referenceDate. The OSS TypeScript SDK does not implement temporal (time-travel) search; that parameter belongs to the hosted Mem0 platform API. The SDK detects the parameter, emits telemetry, and fails fast with a message built by getTemporalFeatureErrorMessage instead of silently ignoring the date.

Source

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

    const result = {
      ...memoryItem,
      ...filters,
      ...(memory.payload.attributedTo && {
        attributedTo: memory.payload.attributedTo,
      }),
    };
    await this._displayFirstRunNotice("get");
    return result;
  }

  async search(
    query: string,
    config: SearchMemoryOptions,
  ): Promise<SearchResult> {
    if (config?.referenceDate !== undefined) {
      await this._getNoticeTelemetryId();
      throw new Error(
        await getTemporalFeatureErrorMessage(this, {
          triggerFunction: "search",
          triggerParameter: "referenceDate",
        }),
      );
    }

    const temporalUsageNotice = detectTemporalUsageFromSearch(
      query,
      config?.filters,
    );

    // Reject top-level entity params - must use filters instead
    rejectTopLevelEntityParams(config as Record<string, any>, "search");

    // Validate search parameters (before applying defaults)
    validateSearchParams(config.threshold, config.topK);

View on GitHub (pinned to 001c235229)

Solutions

  1. Remove referenceDate from the search config when using the OSS SDK
  2. If time-travel search is required, use the hosted platform client (mem0ai npm client package) instead of the OSS Memory class
  3. Approximate with custom metadata: store dated memories and filter with metadata conditions instead

Example fix

// before (platform API style)
await memory.search('trips', { filters: { user_id: 'u1' }, referenceDate: '2024-01-01' });

// after (OSS SDK)
await memory.search('trips', { filters: { user_id: 'u1' } });
Defensive patterns

Strategy: validation

Validate before calling

const { referenceDate, ...ossConfig } = config ?? {};
if (referenceDate !== undefined) {
  // temporal search not supported by the OSS SDK — strip it or switch clients
}

Prevention

When it happens

Trigger: Calling memory.search('query', { filters: { user_id: 'u1' }, referenceDate: '2024-01-01' }) on an instance of the OSS Memory class from mem0-ts/src/oss — referenceDate !== undefined triggers it even if the value is null-ish, as long as the key is present with a non-undefined value.

Common situations: Porting code from the hosted platform (MemoryClient) to the self-hosted OSS SDK and keeping the temporal parameter; copying examples from platform docs into an OSS deployment.

Related errors


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