Skip to content

Commit da74cb7

Browse files
authored
Fix: Populate source_doc_id in memory metadata for scheduler logging (#625)
Co-authored-by: [email protected] <>
1 parent 8984d2e commit da74cb7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/memos/multi_mem_cube/single_cube.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,13 @@ def _process_text_mem(
662662
mode=extract_mode,
663663
)
664664
flattened_local = [mm for m in memories_local for mm in m]
665+
666+
# Explicitly set source_doc_id to metadata if present in info
667+
source_doc_id = (add_req.info or {}).get("source_doc_id")
668+
if source_doc_id:
669+
for memory in flattened_local:
670+
memory.metadata.source_doc_id = source_doc_id
671+
665672
self.logger.info(f"Memory extraction completed for user {add_req.user_id}")
666673

667674
# Add memories to text_mem

0 commit comments

Comments
 (0)