bytedance/deer-flow · error · AgentsApiDisabledError

agents_api.enabled

agents_api.enabled

Error message

err.detail

What it means

Wrapped MemoryManagerError raised by Mem0Manager._read_or_fallback when a memory read raises Mem0APIError and the configured read_policy is not fail_open. The underlying cause (network failure, timeout, 4xx/5xx from the mem0 service) is chained via 'from e' and its text is embedded in the message.

Source

Thrown at frontend/src/core/agents/api.ts:61

  return data.agents;
}

export async function getAgent(name: string): Promise<Agent> {
  const res = await fetch(`${getBackendBaseURL()}/api/agents/${name}`);
  if (!res.ok) throw new Error(`Agent '${name}' not found`);
  return res.json() as Promise<Agent>;
}

export async function createAgent(request: CreateAgentRequest): Promise<Agent> {
  const res = await fetch(`${getBackendBaseURL()}/api/agents`, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(request),
  });
  if (!res.ok) {
    const err = (await res.json().catch(() => ({}))) as { detail?: string };
    if (isAgentsApiDisabledDetail(err.detail)) {
      throw new AgentsApiDisabledError(err.detail!);
    }
    throw new Error(err.detail ?? `Failed to create agent: ${res.statusText}`);
  }
  return res.json() as Promise<Agent>;
}

export async function updateAgent(
  name: string,
  request: UpdateAgentRequest,
): Promise<Agent> {
  const res = await fetch(`${getBackendBaseURL()}/api/agents/${name}`, {
    method: "PUT",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(request),
  });
  if (!res.ok) {
    const err = (await res.json().catch(() => ({}))) as { detail?: string };
    throw new Error(err.detail ?? `Failed to update agent: ${res.statusText}`);

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Inspect the chained Mem0APIError text and fix the underlying cause (reachability, API key, service health).
  2. If the agent should keep answering without memory during outages, set read_policy: fail_open so reads degrade to a logged fallback.
  3. Increase timeout_seconds if the chained error indicates a timeout.

Example fix

# before
backend_config:
  read_policy: raise

# after
backend_config:
  read_policy: fail_open  # log warning, continue without memory
Defensive patterns

Strategy: fallback

Try / catch

from deerflow.agents.memory.backends.mem0.mem0_manager import MemoryManagerError

try:
    memories = manager.search(thread_id, query)
except MemoryManagerError as e:
    if 'mem0 read failed' in str(e):
        logger.warning('memory unavailable, proceeding without it: %s', e)
        memories = []
    else:
        raise

Prevention

When it happens

Trigger: Any memory read path (searching memories for the current thread) while the mem0 service is unreachable, returns an error status, or times out, combined with read_policy: raise. With read_policy: fail_open the same failure only logs a warning and returns the fallback value instead.

Common situations: mem0 cloud incident or expired API key surfacing as 401; local mem0 container restarting mid-conversation; timeout_seconds too small for slow searches; operator chose read_policy: raise to make memory mandatory and then the network blips.

Related errors


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