File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
mem_reader/read_multi_modal Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ def parse_fast(
324324 # For file content parts, default to LongTermMemory
325325 # (since we don't have role information at this level)
326326 memory_type = "LongTermMemory"
327-
327+ file_ids = [ file_id ] if file_id else []
328328 # Create memory items for each chunk
329329 memory_items = []
330330 for chunk_idx , chunk_text in enumerate (content_chunks ):
@@ -351,6 +351,7 @@ def parse_fast(
351351 confidence = 0.99 ,
352352 type = "fact" ,
353353 info = info_ ,
354+ file_ids = file_ids ,
354355 ),
355356 )
356357 memory_items .append (memory_item )
@@ -373,6 +374,7 @@ def parse_fast(
373374 confidence = 0.99 ,
374375 type = "fact" ,
375376 info = info_ ,
377+ file_ids = file_ids ,
376378 ),
377379 )
378380 memory_items .append (memory_item )
@@ -499,7 +501,7 @@ def parse_fine(
499501 session_id = info_ .pop ("session_id" , "" )
500502 if file_id :
501503 info_ ["file_id" ] = file_id
502-
504+ file_ids = [ file_id ] if file_id else []
503505 # For file content parts, default to LongTermMemory
504506 memory_type = "LongTermMemory"
505507
@@ -536,6 +538,7 @@ def _make_memory_item(
536538 confidence = 0.99 ,
537539 type = "fact" ,
538540 info = info_ ,
541+ file_ids = file_ids ,
539542 ),
540543 )
541544
Original file line number Diff line number Diff line change @@ -133,6 +133,11 @@ class TreeNodeTextualMemoryMetadata(TextualMemoryMetadata):
133133 description = "background of this node" ,
134134 )
135135
136+ file_ids : list [str ] | None = Field (
137+ default_factory = list ,
138+ description = "The ids of the files associated with the memory." ,
139+ )
140+
136141 @field_validator ("sources" , mode = "before" )
137142 @classmethod
138143 def coerce_sources (cls , v ):
You can’t perform that action at this time.
0 commit comments