diff --git a/lightrag/kg/faiss_impl.py b/lightrag/kg/faiss_impl.py index 6de640b7..adb0058b 100644 --- a/lightrag/kg/faiss_impl.py +++ b/lightrag/kg/faiss_impl.py @@ -42,11 +42,9 @@ class FaissVectorDBStorage(BaseVectorStorage): if self.workspace: # Include workspace in the file path for data isolation workspace_dir = os.path.join(working_dir, self.workspace) - self.final_namespace = f"{self.workspace}_{self.namespace}" else: # Default behavior when workspace is empty - self.final_namespace = self.namespace workspace_dir = working_dir self.workspace = "" @@ -74,11 +72,11 @@ class FaissVectorDBStorage(BaseVectorStorage): """Initialize storage data""" # Get the update flag for cross-process update notification self.storage_updated = await get_update_flag( - self.final_namespace, workspace=self.workspace + self.namespace, workspace=self.workspace ) # Get the storage lock for use in other methods self._storage_lock = get_namespace_lock( - self.final_namespace, workspace=self.workspace + self.namespace, workspace=self.workspace ) async def _get_index(self): @@ -404,9 +402,7 @@ class FaissVectorDBStorage(BaseVectorStorage): # Save data to disk self._save_faiss_index() # Notify other processes that data has been updated - await set_all_update_flags( - self.final_namespace, workspace=self.workspace - ) + await set_all_update_flags(self.namespace, workspace=self.workspace) # Reset own update flag to avoid self-reloading self.storage_updated.value = False except Exception as e: @@ -533,9 +529,7 @@ class FaissVectorDBStorage(BaseVectorStorage): self._load_faiss_index() # Notify other processes - await set_all_update_flags( - self.final_namespace, workspace=self.workspace - ) + await set_all_update_flags(self.namespace, workspace=self.workspace) self.storage_updated.value = False logger.info( diff --git a/lightrag/kg/json_doc_status_impl.py b/lightrag/kg/json_doc_status_impl.py index a4ac792b..df6502ee 100644 --- a/lightrag/kg/json_doc_status_impl.py +++ b/lightrag/kg/json_doc_status_impl.py @@ -35,11 +35,9 @@ class JsonDocStatusStorage(DocStatusStorage): if self.workspace: # Include workspace in the file path for data isolation workspace_dir = os.path.join(working_dir, self.workspace) - self.final_namespace = f"{self.workspace}_{self.namespace}" else: # Default behavior when workspace is empty workspace_dir = working_dir - self.final_namespace = self.namespace self.workspace = "" os.makedirs(workspace_dir, exist_ok=True) diff --git a/lightrag/kg/json_kv_impl.py b/lightrag/kg/json_kv_impl.py index b1151e73..8435c989 100644 --- a/lightrag/kg/json_kv_impl.py +++ b/lightrag/kg/json_kv_impl.py @@ -30,11 +30,9 @@ class JsonKVStorage(BaseKVStorage): if self.workspace: # Include workspace in the file path for data isolation workspace_dir = os.path.join(working_dir, self.workspace) - self.final_namespace = f"{self.workspace}_{self.namespace}" else: # Default behavior when workspace is empty workspace_dir = working_dir - self.final_namespace = self.namespace self.workspace = "" os.makedirs(workspace_dir, exist_ok=True) diff --git a/lightrag/kg/networkx_impl.py b/lightrag/kg/networkx_impl.py index 512d4456..145b9c01 100644 --- a/lightrag/kg/networkx_impl.py +++ b/lightrag/kg/networkx_impl.py @@ -41,10 +41,8 @@ class NetworkXStorage(BaseGraphStorage): if self.workspace: # Include workspace in the file path for data isolation workspace_dir = os.path.join(working_dir, self.workspace) - self.final_namespace = f"{self.workspace}_{self.namespace}" else: # Default behavior when workspace is empty - self.final_namespace = self.namespace workspace_dir = working_dir self.workspace = "" diff --git a/lightrag/tools/clean_llm_query_cache.py b/lightrag/tools/clean_llm_query_cache.py index 573bbb37..dbe2e455 100644 --- a/lightrag/tools/clean_llm_query_cache.py +++ b/lightrag/tools/clean_llm_query_cache.py @@ -463,7 +463,9 @@ class CleanupTool: # CRITICAL: Set update flag so changes persist to disk # Without this, deletions remain in-memory only and are lost on exit - await set_all_update_flags(storage.final_namespace, storage.workspace) + await set_all_update_flags( + storage.namespace, workspace=storage.workspace + ) # Success stats.successful_batches += 1