assafelovic/gpt-researcher · error · ValueError

Invalid retriever(s) found: {', '.join(invalid_retrievers)}.

Error message

Invalid retriever(s) found: {', '.join(invalid_retrievers)}. Valid options are: {', '.join(valid_retrievers)}.

What it means

Config.parse_retrievers splits the RETRIEVERS setting on commas and validates each name against the registry of installed retriever providers (get_all_retriever_names). Any name not in the registry raises a ValueError listing the invalid names and the valid ones.

Source

Thrown at gpt_researcher/config/config.py:198

    @classmethod
    def list_available_configs(cls) -> List[str]:
        """List all available configuration names."""
        configs = ["default"]
        for file in os.listdir(cls.CONFIG_DIR):
            if file.endswith(".json"):
                configs.append(file[:-5])  # Remove .json extension
        return configs

    def parse_retrievers(self, retriever_str: str) -> List[str]:
        """Parse the retriever string into a list of retrievers and validate them."""
        from ..retrievers.utils import get_all_retriever_names
        
        retrievers = [retriever.strip()
                      for retriever in retriever_str.split(",")]
        valid_retrievers = get_all_retriever_names() or []
        invalid_retrievers = [r for r in retrievers if r not in valid_retrievers]
        if invalid_retrievers:
            raise ValueError(
                f"Invalid retriever(s) found: {', '.join(invalid_retrievers)}. "
                f"Valid options are: {', '.join(valid_retrievers)}."
            )
        return retrievers

    @staticmethod
    def parse_llm(llm_str: str | None) -> tuple[str | None, str | None]:
        """Parse llm string into (llm_provider, llm_model)."""
        from gpt_researcher.llm_provider.generic.base import _SUPPORTED_PROVIDERS

        if llm_str is None:
            return None, None
        try:
            llm_provider, llm_model = llm_str.split(":", 1)
            assert llm_provider in _SUPPORTED_PROVIDERS, (
                f"Unsupported {llm_provider}.\nSupported llm providers are: "
                + ", ".join(_SUPPORTED_PROVIDERS)
            )

View on GitHub (pinned to 6f998577d5)

Solutions

  1. Check the error's valid-options list and correct the spelling
  2. Install the optional dependency that registers the retriever you want (see docs/optional-dependencies)
  3. Pin/upgrade gpt-researcher to the version whose retriever names you're using

Example fix

# before
RETRIEVERS=tavily,googl
# after
RETRIEVERS=tavily,google
Defensive patterns

Strategy: validation

Validate before calling

from gpt_researcher.skills.retriever.retriever_automator import get_all_retriever_names
wanted = [r.strip() for r in os.getenv("RETRIEVERS","tavily").split(",")]
valid = get_all_retriever_names() or []
bad = [r for r in wanted if r and r not in valid]
assert not bad, f"Invalid retrievers: {bad}. Valid: {valid}"

Try / catch

try:
    cfg = Config()
except ValueError as e:
    if "Invalid retriever" in str(e):
        print(e); exit(2)
    raise

Prevention

When it happens

Trigger: Setting RETRIEVERS='tavily,googl' (typo), naming a retriever whose optional dependency isn't installed so it isn't registered, or including empty/whitespace-only segments from a trailing comma in some versions.

Common situations: Typos in the RETRIEVERS env var; expecting a retriever (e.g. 'duckduckgo') that requires an extra pip install; copying a config from a newer/older version with different retriever names.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of assafelovic/gpt-researcher@6f998577d5 (2026-08-28). Data as JSON: /api/errors/59ceeaf237c03fad. Report an issue: GitHub.