{"record":{"id":"e0742a7bfef88994","repo":"mem0ai/mem0","slug":"unsupported-embedder-provider-provider","errorCode":null,"errorMessage":"Unsupported embedder provider: ${provider}","messagePattern":"Unsupported embedder provider: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/utils/factory.ts","lineNumber":103,"sourceCode":"      case \"lmstudio\":\n        return new LMStudioEmbedder(config);\n      case \"together\":\n        return new TogetherEmbedder(config);\n      case \"google\":\n      case \"gemini\":\n        return new GoogleEmbedder(config);\n      case \"azure_openai\":\n        return new AzureOpenAIEmbedder(config);\n      case \"fastembed\":\n        return new FastEmbedEmbedder(config);\n      case \"langchain\":\n        return new LangchainEmbedder(config);\n      case \"vertexai\":\n        return new VertexAIEmbedder(config);\n      case \"huggingface\":\n        return new HuggingFaceEmbedder(config);\n      default:\n        throw new Error(`Unsupported embedder provider: ${provider}`);\n    }\n  }\n}\n\nexport class LLMFactory {\n  static create(provider: string, config: LLMConfig): LLM {\n    switch (provider.toLowerCase()) {\n      case \"openai\":\n        return new OpenAILLM(config);\n      case \"openai_structured\":\n        return new OpenAIStructuredLLM(config);\n      case \"anthropic\":\n        return new AnthropicLLM(config);\n      case \"groq\":\n        return new GroqLLM(config);\n      case \"ollama\":\n        return new OllamaLLM(config);\n      case \"lmstudio\":","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/utils/factory.ts#L85-L121","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the supported list in mem0-ts/src/oss/src/utils/factory.ts EmbedderFactory.create and use one of those exact strings (case-insensitive).","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.","Fix typos: 'opanai' -> 'openai', 'azure' -> 'azure_openai', 'hugging-face' -> 'huggingface'."],"exampleFix":"// before\nconst memory = new Memory({ embedder: { provider: 'azure', config: {...} } });\n// after\nconst memory = new Memory({ embedder: { provider: 'azure_openai', config: {...} } });","handlingStrategy":"validation","validationCode":"import { EmbedderFactory } from 'mem0ai/oss/dist/utils/factory' // or local copy\nconst SUPPORTED_EMBEDDERS = ['openai','azure_openai','fastembed','langchain','vertexai','huggingface','google'];\nfunction assertEmbedder(provider: string) {\n  if (!SUPPORTED_EMBEDDERS.includes(provider.toLowerCase()))\n    throw new Error(`Unsupported embedder '${provider}'. Supported: ${SUPPORTED_EMBEDDERS.join(', ')}`);\n}","typeGuard":"const isKnownEmbedder = (p: string): boolean =>\n  ['openai','azure_openai','fastembed','langchain','vertexai','huggingface','google'].includes(p.toLowerCase());","tryCatchPattern":"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; }","preventionTips":["Validate the provider string against the factory's switch before constructing Memory.","Keep provider identifiers in a shared constant instead of retyping them per call site.","Add a startup smoke test that constructs Memory with your config in CI."],"tags":["configuration","embedder","typescript","factory"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}