assafelovic/gpt-researcher · critical · Exception
Embedding not found.
Error message
Embedding not found.
What it means
Generic Exception("Embedding not found.") thrown from the embeddings factory's match statement when the configured embedding provider string matches none of the supported cases (OpenAI variants, Azure, Ollama, VertexAI, Nebius, etc.). It means the memory/embedding layer cannot be constructed for the chosen provider name.
Source
Thrown at gpt_researcher/memory/embeddings.py:225
from langchain_openai import OpenAIEmbeddings
_embeddings = OpenAIEmbeddings(
model=model,
openai_api_key=os.getenv("MINIMAX_API_KEY"),
openai_api_base="https://api.minimax.io/v1",
**embedding_kwargs,
)
case "nebius":
from langchain_openai import OpenAIEmbeddings
_embeddings = OpenAIEmbeddings(
model=model,
openai_api_key=os.getenv("NEBIUS_API_KEY"),
openai_api_base=os.getenv("NEBIUS_BASE_URL", "https://api.tokenfactory.nebius.com/v1"),
**embedding_kwargs,
)
case _:
raise Exception("Embedding not found.")
self._embeddings = _embeddings
def get_embeddings(self):
"""Get the configured embeddings instance.
Returns:
The LangChain embeddings instance configured for this Memory.
"""
return self._embeddings
View on GitHub (pinned to 6f998577d5)
Solutions
- Check your config's embedding provider value against the supported case branches in gpt_researcher/memory/embeddings.py.
- Fix typos/casing in the provider name (it must match a supported case exactly).
- Set a known-good fallback like "openai" (with OPENAI_API_KEY set) to confirm the rest of the pipeline works.
- If you need a custom provider, extend the match statement or file an issue for support.
Example fix
// before embedding_provider = "huggingface" # not handled -> Exception // after embedding_provider = "ollama" # or "openai", matching a supported case
Defensive patterns
Strategy: validation
Validate before calling
SUPPORTED = {"openai", "azure", "ollama", "vertexai", "nebius"} # mirror the match cases
if cfg.embedding_provider.lower() not in SUPPORTED:
raise ValueError(f"Unsupported embedding provider: {cfg.embedding_provider}") Type guard
null
Try / catch
try:
emb = Embeddings(cfg)
except Exception as e:
if "Embedding not found" in str(e):
cfg.embedding_provider = "openai"
emb = Embeddings(cfg)
else:
raise Prevention
- Assert the provider name against supported values at startup.
- Pin config values in tests for each provider you use.
- Check the match statement in embeddings.py after library upgrades.
When it happens
Trigger: Constructing the embeddings wrapper with an embedding provider value (e.g. from config embedding_provider) that falls into the `case _` branch of the match statement in __init__.
Common situations: Typos in the embedding provider config ("openaai", "huggingface" vs expected casing), new/renamed providers after an upgrade, or custom provider names the factory doesn't recognize.
Related errors
- Embedding provider not found.
- Set EMBEDDING = '<embedding_provider>:<embedding_model>' Eg
- Invalid retriever(s) found: {', '.join(invalid_retrievers)}.
- Set SMART_LLM or FAST_LLM = '<llm_provider>:<llm_model>' Eg
- Invalid reasoning effort: {reasoning_effort_str}. Valid opti
AI-assisted analysis of assafelovic/gpt-researcher@6f998577d5 (2026-08-28).
Data as JSON: /api/errors/21f7276b09b76aad.
Report an issue: GitHub.