bytedance/deer-flow · critical · RuntimeError

DeerMem memory update requested but no LLM is configured (se

Error message

DeerMem memory update requested but no LLM is configured (set memory.backend_config.model in config).

What it means

DeerMem's LLM-driven memory update (fact extraction from conversation) requires a model; if the updater was constructed without one (self._llm is None) it raises this RuntimeError naming the fix: set memory.backend_config.model in config.yaml. Everything up to prompt preparation succeeds, so the failure surfaces exactly at the LLM call boundary.

Source

Thrown at backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/updater.py:1482

            # reference only turns the LLM will actually see. The admission-time
            # ``signals`` (detected on the full conversation in DeerMem) already
            # served their purpose (backpressure admission at enqueue); the hint
            # is a soft nudge and must not point at turns the watermark excluded.
            feed_signals = detect_signals(feed_messages, patterns_dir=self._config.patterns_dir)
            prepared = self._prepare_update_prompt(
                messages=feed_messages,
                agent_name=agent_name,
                signals=feed_signals,
                user_id=user_id,
            )
            if prepared is None:
                return False

            current_memory, prompt = prepared
            model_name = self._config.model.model
            model = self._llm
            if model is None:
                raise RuntimeError("DeerMem memory update requested but no LLM is configured (set memory.backend_config.model in config).")
            invoke_config: dict[str, Any] = {"run_name": "memory_agent"}
            # Pre-LLM-call observability hook (e.g. langfuse): merge trace
            # metadata into invoke_config before the call so a tracer emits a
            # span at the LLM boundary. None = no tracing (langfuse not
            # hard-required). Subsumes the former backend_config.tracing_callback.
            if self._callbacks is not None:
                self._callbacks.on_memory_llm_call(
                    invoke_config,
                    thread_id=thread_id,
                    user_id=user_id,
                    trace_id=trace_id,
                    model_name=model_name,
                )
            logger.info("Invoking memory-update LLM (thread=%s trace_id=%s)", thread_id, trace_id)
            attempted = True
            started = time.monotonic()
            try:
                response = model.invoke(prompt, config=invoke_config)

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Add memory.backend_config.model to config.yaml, e.g. model: {model: gpt-4o-mini, ...} (copy the block from config.example.yaml)
  2. Restart the Gateway after editing config.yaml — config is read at startup
  3. Run `make doctor` to validate the config before starting

Example fix

# config.yaml — before
memory:
  backend: deermem
# after
memory:
  backend: deermem
  backend_config:
    model:
      model: gpt-4o-mini
      api_key: ${LLM_API_KEY}
Defensive patterns

Strategy: validation

Validate before calling

import yaml

cfg = yaml.safe_load(open("config.yaml"))
model_cfg = (cfg.get("memory", {}).get("backend_config", {}) or {}).get("model")
if cfg.get("memory", {}).get("backend") == "deermem" and not model_cfg:
    raise SystemExit("deermem requires memory.backend_config.model in config.yaml")

Try / catch

try:
    memory.update_thread_memory(...)
except RuntimeError as e:
    if "no LLM is configured" in str(e):
        logger.error("Config error: set memory.backend_config.model in config.yaml and restart")
    raise

Prevention

When it happens

Trigger: Enabling the deermem memory backend without a memory.backend_config.model entry in config.yaml, or a config where backend_config.model is present but empty/null so no LLM client is built.

Common situations: Fresh installs that copied config.example.yaml but skipped the memory section, switching memory backend from a non-LLM one (e.g. file-based) to deermem without adding model config, or environment-specific configs that diverge.

Related errors


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