mem0ai/mem0 · error · Error

Unsupported embedder provider: ${provider}

Error message

Unsupported embedder provider: ${provider}

What it means

Thrown by EmbedderFactory.create when the configured embedder provider string does not match any case in its switch (e.g. openai, azure_openai, fastembed, langchain, vertexai, huggingface). The factory is the single place where an embedder provider name is resolved to a concrete class, so an unknown or misspelled name fails here. The check is a lowercase comparison against a fixed set of supported providers.

Source

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

      case "lmstudio":
        return new LMStudioEmbedder(config);
      case "together":
        return new TogetherEmbedder(config);
      case "google":
      case "gemini":
        return new GoogleEmbedder(config);
      case "azure_openai":
        return new AzureOpenAIEmbedder(config);
      case "fastembed":
        return new FastEmbedEmbedder(config);
      case "langchain":
        return new LangchainEmbedder(config);
      case "vertexai":
        return new VertexAIEmbedder(config);
      case "huggingface":
        return new HuggingFaceEmbedder(config);
      default:
        throw new Error(`Unsupported embedder provider: ${provider}`);
    }
  }
}

export class LLMFactory {
  static create(provider: string, config: LLMConfig): LLM {
    switch (provider.toLowerCase()) {
      case "openai":
        return new OpenAILLM(config);
      case "openai_structured":
        return new OpenAIStructuredLLM(config);
      case "anthropic":
        return new AnthropicLLM(config);
      case "groq":
        return new GroqLLM(config);
      case "ollama":
        return new OllamaLLM(config);
      case "lmstudio":

View on GitHub (pinned to 001c235229)

Solutions

  1. Check the supported list in mem0-ts/src/oss/src/utils/factory.ts EmbedderFactory.create and use one of those exact strings (case-insensitive).
  2. If the provider is genuinely missing in TS, switch to a supported one (e.g. 'openai') or implement a custom embedder and pass an instance if the API allows.
  3. Fix typos: 'opanai' -> 'openai', 'azure' -> 'azure_openai', 'hugging-face' -> 'huggingface'.

Example fix

// before
const memory = new Memory({ embedder: { provider: 'azure', config: {...} } });
// after
const memory = new Memory({ embedder: { provider: 'azure_openai', config: {...} } });
Defensive patterns

Strategy: validation

Validate before calling

import { EmbedderFactory } from 'mem0ai/oss/dist/utils/factory' // or local copy
const SUPPORTED_EMBEDDERS = ['openai','azure_openai','fastembed','langchain','vertexai','huggingface','google'];
function assertEmbedder(provider: string) {
  if (!SUPPORTED_EMBEDDERS.includes(provider.toLowerCase()))
    throw new Error(`Unsupported embedder '${provider}'. Supported: ${SUPPORTED_EMBEDDERS.join(', ')}`);
}

Type guard

const isKnownEmbedder = (p: string): boolean =>
  ['openai','azure_openai','fastembed','langchain','vertexai','huggingface','google'].includes(p.toLowerCase());

Try / catch

try { new Memory(config) } catch (e) { if (e instanceof Error && e.message.startsWith('Unsupported embedder provider')) { /* fix config and rethrow user-facing message */ } throw e; }

Prevention

When it happens

Trigger: Calling new Memory({ embedder: { provider: 'opanai', config: {...} } }) (typo), or passing a provider that exists in the Python SDK but has no TypeScript implementation (e.g. 'ollama' if unlisted), or passing provider: '' / undefined and hitting the default branch.

Common situations: Porting a Python mem0 config to mem0-ts and assuming provider parity; upgrading mem0-ts where a provider was renamed; empty embedder config falling through the switch.

Related errors


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