LightMem icon indicating copy to clipboard operation
LightMem copied to clipboard

Bug: `topic_segment=False` causes `add_memory()` to skip the entire extraction pipeline, resulting in empty Qdrant storage

Open luoyufeihaha opened this issue 8 months ago • 2 comments

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

luoyufeihaha avatar Mar 30 '26 05:03 luoyufeihaha

Hello, thank you for your interest in LightMem. This part has been a low-priority item in our update schedule, as setting topic_segment=False prevents the use of key functionalities of LightMem. However, we will arrange for it to be updated as soon as possible. Thank you for pointing out this issue.

JizhanFang avatar Mar 30 '26 12:03 JizhanFang

The issue has been solved as PR #64 .

JizhanFang avatar Aug 03 '26 03:08 JizhanFang