From d23a0754c1b615ad062e18f68e5059fc8fb8f657 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Wed, 20 May 2026 11:04:54 +0800 Subject: [PATCH] feat(memory): exclude dream diaries from vector index --- agent/memory/manager.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/agent/memory/manager.py b/agent/memory/manager.py index 7053592a..6aaac767 100644 --- a/agent/memory/manager.py +++ b/agent/memory/manager.py @@ -264,9 +264,15 @@ class MemoryManager: if memory_dir.exists(): for file_path in memory_dir.rglob("*.md"): - if any(part.startswith('.') for part in file_path.relative_to(workspace_dir).parts): - continue rel_parts = file_path.relative_to(workspace_dir).parts + if any(part.startswith('.') for part in rel_parts): + continue + # Dream diaries are narrative reflections produced by Deep + # Dream; their factual content has already been distilled + # into MEMORY.md. Indexing them adds noisy near-duplicates + # that crowd out the authoritative entry in retrieval. + if "dreams" in rel_parts: + continue if "daily" in rel_parts: if "users" in rel_parts or len(rel_parts) > 3: user_idx = rel_parts.index("daily") + 1