bytedance/deer-flow · error · ValueError

OpenViking api_key_env must not be empty

Error message

OpenViking api_key_env must not be empty

What it means

Error "OpenViking api_key_env must not be empty" thrown in bytedance/deer-flow.

Source

Thrown at backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py:68

    def from_backend_config(
        cls,
        backend_config: dict[str, Any] | None,
    ) -> OpenVikingConfig:
        cfg = dict(backend_config or {})
        if "auth_mode" in cfg or "account" in cfg:
            raise ValueError("OpenViking trusted mode is no longer supported by this backend; use a USER API key and configure owner_user_id")
        removed_fields = sorted(_REMOVED_CUSTOM_HTTP_FIELDS.intersection(cfg))
        if removed_fields:
            raise ValueError("OpenViking custom HTTP client fields are no longer supported: " + ", ".join(removed_fields))

        retrieval = _mapping(cfg.pop("retrieval", {}), "retrieval")
        failure_policy = _mapping(
            cfg.pop("failure_policy", {}),
            "failure_policy",
        )
        api_key_env = str(cfg.pop("api_key_env", "OPENVIKING_API_KEY")).strip()
        if not api_key_env:
            raise ValueError("OpenViking api_key_env must not be empty")

        result = cls(
            base_url=str(cfg.pop("base_url", "http://127.0.0.1:1933")).rstrip("/"),
            storage_path=str(cfg.pop("storage_path", "")),
            owner_user_id=str(cfg.pop("owner_user_id", "")).strip(),
            api_key=os.environ.get(api_key_env, "").strip(),
            api_key_env=api_key_env,
            default_peer_id=str(cfg.pop("default_peer_id", "deerflow")).strip(),
            timeout_seconds=float(cfg.pop("timeout_seconds", 30.0)),
            search_top_k=int(retrieval.pop("top_k", 8)),
            score_threshold=_optional_float(retrieval.pop("score_threshold", None)),
            max_injection_chars=int(retrieval.pop("max_injection_chars", 12_000)),
            content_mode=str(retrieval.pop("content_mode", "overview")).lower(),  # type: ignore[arg-type]
            injection_query=str(
                retrieval.pop(
                    "injection_query",
                    "user profile preferences important entities events ongoing goals constraints and prior decisions",
                )

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Set api_key_env to the name of the environment variable holding the OpenViking USER API key.
  2. Remove the field only if a default is documented; otherwise it is required.

When it happens

Trigger: Thrown at backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py:68 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14). Data as JSON: /api/errors/7d7e1bd2cf7cf011. Report an issue: GitHub.