mem0ai/mem0 · error · Error

Unsupported history store provider: ${provider}

Error message

Unsupported history store provider: ${provider}

What it means

Thrown by the history store factory when historyDbPath config specifies a provider other than sqlite, supabase, or memory. The history store persists memory update history; the switch only resolves these three provider names, so anything else falls to default and throws.

Source

Thrown at mem0-ts/src/oss/src/utils/factory.ts:294

    return LLMFactory.create(llmProvider, llmConfig);
  }
}

export class HistoryManagerFactory {
  static create(provider: string, config: HistoryStoreConfig): HistoryManager {
    switch (provider.toLowerCase()) {
      case "sqlite":
        return new SQLiteManager(config.config.historyDbPath || ":memory:");
      case "supabase":
        return new SupabaseHistoryManager({
          supabaseUrl: config.config.supabaseUrl || "",
          supabaseKey: config.config.supabaseKey || "",
          tableName: config.config.tableName || "memory_history",
        });
      case "memory":
        return new MemoryHistoryManager();
      default:
        throw new Error(`Unsupported history store provider: ${provider}`);
    }
  }
}

View on GitHub (pinned to 001c235229)

Solutions

  1. Use 'sqlite', 'supabase', or 'memory' exactly as cased in the factory switch.
  2. For a file-backed history use provider 'sqlite' with config.historyDbPath set to a writable path.
  3. If you need another backend, disable/keep the default history manager or contribute support upstream.

Example fix

// before
historyStore: { provider: 'sqlite3', config: { historyDbPath: './hist.db' } }
// after
historyStore: { provider: 'sqlite', config: { historyDbPath: './hist.db' } }
Defensive patterns

Strategy: validation

Validate before calling

const HISTORY_PROVIDERS = ['sqlite','supabase','memory'];
function assertHistoryProvider(provider: string) {
  if (!HISTORY_PROVIDERS.includes(provider.toLowerCase()))
    throw new Error(`historyStore.provider must be one of ${HISTORY_PROVIDERS.join(', ')}`);
}

Type guard

const isKnownHistoryProvider = (p: string): boolean => HISTORY_PROVIDERS.includes(p.toLowerCase());

Prevention

When it happens

Trigger: historyStore: { provider: 'postgres', config: {...} }, or provider: 'sqlite3' instead of 'sqlite', or omitting quotes/types so the value arrives as an unexpected string.

Common situations: Wanting history in Postgres/MySQL when only sqlite (file or :memory:), supabase, and in-memory are supported in TS; migrating from Python where history backends differ; typo in provider id.

Related errors


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