Skip to content

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

@luoyufeihaha

Description

@luoyufeihaha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions