LightRAG/lightrag
BukeLy 18a4870229 fix: Add default workspace support for backward compatibility
Fixes two compatibility issues in workspace isolation:

1. Problem: lightrag_server.py calls initialize_pipeline_status()
   without workspace parameter, causing pipeline to initialize in
   global namespace instead of rag's workspace.

   Solution: Add set_default_workspace() mechanism in shared_storage.
   LightRAG.initialize_storages() now sets default workspace, which
   initialize_pipeline_status() uses when called without parameters.

2. Problem: /health endpoint hardcoded to use "pipeline_status",
   cannot return workspace-specific status or support frontend
   workspace selection.

   Solution: Add LIGHTRAG-WORKSPACE header support. Endpoint now
   extracts workspace from header or falls back to server default,
   returning correct workspace-specific pipeline status.

Changes:
- lightrag/kg/shared_storage.py: Add set/get_default_workspace()
- lightrag/lightrag.py: Call set_default_workspace() in initialize_storages()
- lightrag/api/lightrag_server.py: Add get_workspace_from_request() helper,
  update /health endpoint to support LIGHTRAG-WORKSPACE header

Testing:
- Backward compatibility: Old code works without modification
- Multi-instance safety: Explicit workspace passing preserved
- /health endpoint: Supports both default and header-specified workspaces

Related: #2353
2025-11-17 12:54:20 +08:00
..
api fix: Add default workspace support for backward compatibility 2025-11-17 12:54:20 +08:00
evaluation Update LLM cache migration docs and improve UX prompts 2025-11-08 23:48:19 +08:00
kg fix: Add default workspace support for backward compatibility 2025-11-17 12:54:20 +08:00
llm Refactor keyword_extraction from kwargs to explicit parameter 2025-11-09 12:02:17 +08:00
tools Add concurrency warning for JsonKVStorage in cleanup tool 2025-11-09 23:04:04 +08:00
__init__.py Bump core version to 1.4.9.9 and API to 0252 2025-11-08 11:27:26 +08:00
base.py Remove unused chunk-based node/edge retrieval methods 2025-11-06 18:17:10 +08:00
constants.py Refactor entity merging with unified attribute merge function 2025-10-27 00:04:17 +08:00
exceptions.py Add Qdrant legacy collection migration with workspace support 2025-10-30 19:16:33 +08:00
lightrag.py fix: Add default workspace support for backward compatibility 2025-11-17 12:54:20 +08:00
namespace.py Add entity/relation chunk tracking with configurable source ID limits 2025-10-20 15:24:15 +08:00
operate.py Prohibit direct access to internal functions of EmbeddingFunc. 2025-11-08 01:43:36 +08:00
prompt.py Fix typo in 'equipment' in prompt.py 2025-10-22 11:13:22 +08:00
rerank.py fix: Resolve default rerank config problem when env var missing 2025-08-23 01:07:59 +08:00
types.py Add is_truncated to graph query for NetworkX graph db 2025-04-02 22:12:20 +08:00
utils.py Add mandatory dimension parameter handling for Jina API compliance 2025-11-07 21:08:34 +08:00
utils_graph.py Improve entity merge logging by removing redundant message and fixing typo 2025-10-31 17:16:59 +08:00