Bug Description
When topic_segment=False is set in the configuration, add_memory() returns early
before performing any LLM extraction, resulting in zero memory entries being stored
in the vector database. The vector store remains empty regardless of how many messages
are processed.
This makes it impossible to use LightMem without the LLMlingua-2 model, even though
the README and configuration documentation suggest that topic_segment is an optional
component (defaulting to False).
Affected File
src/lightmem/memory/lightmem.py, lines 298–307
Code
if not self.config.topic_segment:
# TODO:
self.logger.info(f"[{call_id}] Topic segmentation disabled, returning emitted messages")
return {
"triggered": True,
"cut_index": len(msgs),
"boundaries": [0, len(msgs)],
"emitted_messages": msgs,
"carryover_size": 0,
}
The # TODO comment confirms this is an incomplete code path. The early return
completely bypasses:
senmem_buffer_manager — topic-level segmentation
shortmem_buffer_manager — extraction trigger logic
manager.meta_text_extract() — LLM knowledge extraction
convert_extraction_results_to_memory_entries() — MemoryEntry creation
offline_update() / online_update() — storing entries into Qdrant
Bug Description
When
topic_segment=Falseis set in the configuration,add_memory()returns earlybefore performing any LLM extraction, resulting in zero memory entries being stored
in the vector database. The vector store remains empty regardless of how many messages
are processed.
This makes it impossible to use LightMem without the LLMlingua-2 model, even though
the README and configuration documentation suggest that
topic_segmentis an optionalcomponent (defaulting to
False).Affected File
src/lightmem/memory/lightmem.py, lines 298–307Code
if not self.config.topic_segment:
# TODO:
self.logger.info(f"[{call_id}] Topic segmentation disabled, returning emitted messages")
return {
"triggered": True,
"cut_index": len(msgs),
"boundaries": [0, len(msgs)],
"emitted_messages": msgs,
"carryover_size": 0,
}
The # TODO comment confirms this is an incomplete code path. The early return
completely bypasses:
senmem_buffer_manager — topic-level segmentation
shortmem_buffer_manager — extraction trigger logic
manager.meta_text_extract() — LLM knowledge extraction
convert_extraction_results_to_memory_entries() — MemoryEntry creation
offline_update() / online_update() — storing entries into Qdrant