bytedance/deer-flow · error · MemoryStorageCorruption
Journal {journal_path} contains facts without agentName
Error message
Journal {journal_path} contains facts without agentName What it means
Error "Journal {journal_path} contains facts without agentName" thrown in bytedance/deer-flow.
Source
Thrown at backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py:690
old_entries = journal.get("oldEntries", {})
agent_name = journal.get("agentName")
if agent_name is not None and not isinstance(agent_name, str):
raise TypeError("agentName must be a string or null")
except (OSError, json.JSONDecodeError, KeyError, TypeError) as exc:
raise MemoryStorageCorruption(f"Invalid memory operation journal {journal_path}: {exc}") from exc
recovery_dir = path.parent / ".recovery" / operation_id
if state == "prepared":
backup_manifest = recovery_dir / "memory.json"
if backup_manifest.exists():
_atomic_write(path, backup_manifest.read_bytes())
elif int(journal.get("expectedRevision") or 0) == 0:
path.unlink(missing_ok=True)
if isinstance(old_entries, dict):
old_ids = set(old_entries)
for fact_id in journal.get("factIds", []):
if fact_id not in old_ids:
if agent_name is None:
raise MemoryStorageCorruption(f"Journal {journal_path} contains facts without agentName")
fact_file_path(path, str(fact_id), agent_name=agent_name).unlink(missing_ok=True)
for fact_id, entry in old_entries.items():
if not isinstance(fact_id, str) or not fact_id or any(character not in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-" for character in fact_id):
raise MemoryStorageCorruption(f"Journal {journal_path} contains an invalid fact id")
if not isinstance(entry, dict) or not isinstance(entry.get("path"), str):
continue
backup = recovery_dir / f"{fact_id}.md"
if backup.exists():
_atomic_write(_safe_relative_path(path.parent, entry["path"], label="journal"), backup.read_bytes())
elif state != "committed":
raise MemoryStorageCorruption(f"Unknown journal state {state!r} in {journal_path}")
if recovery_dir.exists():
shutil.rmtree(recovery_dir)
journal_path.unlink(missing_ok=True)
def _commit_changes_locked(
self,
path: Path,View on GitHub (pinned to 1dd6ba1acb)
Solutions
- Remove the offending journal file; facts without agentName cannot be routed.
- Manually add agentName to the journal entries if the data must be preserved, then retry.
When it happens
Trigger: Thrown at backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py:690 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/46da9c99b9378194.
Report an issue: GitHub.