LightMem icon indicating copy to clipboard operation
LightMem copied to clipboard

Error when run LightMem with Ollama (examples/run_lightmem_ollama.py)

Open connieKing511 opened this issue 8 months ago • 3 comments

When I run LightMem with the following command: cd examples/ python run_lightmem_ollama.py the following error occurs

`2026-03-18 09:13:44 - LightMemory - INFO - [add_memory_20260318_083623_732078] Starting metadata generation 0%| | 0/10 [37:55<?, ?it/s]

Traceback (most recent call last): File "/xxx/LightMem/examples/run_lightmem_ollama.py", line 281, in main() File "/xxx/LightMem/examples/run_lightmem_ollama.py", line 230, in main result = lightmem.add_memory( ^^^^^^^^^^^^^^^^^^^^ File "/xxx/LightMem/src/lightmem/memory/lightmem.py", line 346, in add_memory extracted_results = self.manager.meta_text_extract( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: OllamaManager.meta_text_extract() got an unexpected keyword argument 'topic_id_mapping'`

It seems that only the meta_text_extract function in OpenaiManager supports the following parameter input (extract_list, messages_use,topic_id_mapping,extraction_mode,custom_prompts), while OllamaManager (and VllmManager) have only three parameters: (system_prompt, extract_list, messages_use). How should OllamaManager be correctly used?

connieKing511 avatar Mar 18 '26 01:03 connieKing511

Thanks for reporting this.

This has been fixed in our latest update: OllamaManager (and other non-OpenAI managers) are now aligned with the OpenAI-style extraction interface.

Xubqpanda avatar Mar 19 '26 05:03 Xubqpanda

hi do you have any further questions?

zxlzr avatar Mar 19 '26 11:03 zxlzr

Thank you for the quick reply! I don't have any other questions for now.

hi do you have any further questions?

connieKing511 avatar Mar 20 '26 01:03 connieKing511