diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index 03699e08..55731d7a 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -1506,12 +1506,12 @@ class LightRAG: # Prevent memory growth: keep only latest 5000 messages when exceeding 10000 if len(pipeline_status["history_messages"]) > 10000: - pipeline_status["history_messages"] = ( - pipeline_status["history_messages"][-5000:] - ) logger.info( f"Trimming pipeline history from {len(pipeline_status['history_messages'])} to 5000 messages" ) + pipeline_status["history_messages"] = ( + pipeline_status["history_messages"][-5000:] + ) # Get document content from full_docs content_data = await self.full_docs.get_by_id(doc_id)