diff --git a/README-zh.md b/README-zh.md index d0b3ec70541b23234a4ca1779f3cb281e28da49a..bb530a19dcae08689d6557efa9ac6dbf4692672b 100644 --- a/README-zh.md +++ b/README-zh.md @@ -295,15 +295,10 @@ class QueryParam: """Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode.""" chunk_top_k: int = int(os.getenv("CHUNK_TOP_K", "5")) - """Number of text chunks to retrieve initially from vector search. + """Number of text chunks to retrieve initially from vector search and keep after reranking. If None, defaults to top_k value. """ - chunk_rerank_top_k: int = int(os.getenv("CHUNK_RERANK_TOP_K", "5")) - """Number of text chunks to keep after reranking. - If None, keeps all chunks returned from initial retrieval. - """ - max_entity_tokens: int = int(os.getenv("MAX_ENTITY_TOKENS", "10000")) """Maximum number of tokens allocated for entity context in unified token control system.""" @@ -340,6 +335,11 @@ class QueryParam: """User-provided prompt for the query. If proivded, this will be use instead of the default vaulue from prompt template. """ + + enable_rerank: bool = True + """Enable reranking for retrieved text chunks. If True but no rerank model is configured, a warning will be issued. + Default is True to enable reranking when rerank model is available. + """ ``` > top_k的默认值可以通过环境变量TOP_K更改。 diff --git a/README.md b/README.md index 5be7389d82ab758ab49c4a2c2b0ada53a138abc7..67f042df388de3e68032bc9fd4e7d55d37dd255f 100644 --- a/README.md +++ b/README.md @@ -302,15 +302,10 @@ class QueryParam: """Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode.""" chunk_top_k: int = int(os.getenv("CHUNK_TOP_K", "5")) - """Number of text chunks to retrieve initially from vector search. + """Number of text chunks to retrieve initially from vector search and keep after reranking. If None, defaults to top_k value. """ - chunk_rerank_top_k: int = int(os.getenv("CHUNK_RERANK_TOP_K", "5")) - """Number of text chunks to keep after reranking. - If None, keeps all chunks returned from initial retrieval. - """ - max_entity_tokens: int = int(os.getenv("MAX_ENTITY_TOKENS", "10000")) """Maximum number of tokens allocated for entity context in unified token control system.""" @@ -341,6 +336,11 @@ class QueryParam: """User-provided prompt for the query. If proivded, this will be use instead of the default vaulue from prompt template. """ + + enable_rerank: bool = True + """Enable reranking for retrieved text chunks. If True but no rerank model is configured, a warning will be issued. + Default is True to enable reranking when rerank model is available. + """ ``` > default value of Top_k can be change by environment variables TOP_K. diff --git a/env.example b/env.example index 50b68c1fd1dae98ccd42f0bba9d92466a77af514..7f431fec008233742489fda4f653e4bbcada6946 100644 --- a/env.example +++ b/env.example @@ -58,14 +58,13 @@ OLLAMA_EMULATING_MODEL_TAG=latest # COSINE_THRESHOLD=0.2 ### Number of entities or relations to retrieve from KG # TOP_K=60 -### Number of text chunks to retrieve initially from vector search +### Number of text chunks to retrieve initially from vector search and keep after reranking # CHUNK_TOP_K=5 ### Rerank Configuration -# ENABLE_RERANK=False -### Number of text chunks to keep after reranking (should be <= CHUNK_TOP_K) -# CHUNK_RERANK_TOP_K=5 -### Rerank model configuration (required when ENABLE_RERANK=True) +### Note: Reranking is now controlled per query via the 'enable_rerank' parameter (default: true) +### The following configuration is only needed when you want to use reranking +### Rerank model configuration (required when enable_rerank=true in query parameters) # RERANK_MODEL=BAAI/bge-reranker-v2-m3 # RERANK_BINDING_HOST=https://api.your-rerank-provider.com/v1/rerank # RERANK_BINDING_API_KEY=your_rerank_api_key_here diff --git a/lightrag/api/config.py b/lightrag/api/config.py index e8a9cea38945a34c8894b999e1dc7aa4f6a2e3ce..14168598d859db97f7226a7b09e6f426cc31f851 100644 --- a/lightrag/api/config.py +++ b/lightrag/api/config.py @@ -168,20 +168,8 @@ def parse_args() -> argparse.Namespace: parser.add_argument( "--chunk-top-k", type=int, - default=get_env_value("CHUNK_TOP_K", 15, int), - help="Number of text chunks to retrieve initially from vector search (default: from env or 15)", - ) - parser.add_argument( - "--chunk-rerank-top-k", - type=int, - default=get_env_value("CHUNK_RERANK_TOP_K", 5, int), - help="Number of text chunks to keep after reranking (default: from env or 5)", - ) - parser.add_argument( - "--enable-rerank", - action="store_true", - default=get_env_value("ENABLE_RERANK", False, bool), - help="Enable rerank functionality (default: from env or False)", + default=get_env_value("CHUNK_TOP_K", 5, int), + help="Number of text chunks to retrieve initially from vector search and keep after reranking (default: from env or 5)", ) parser.add_argument( "--cosine-threshold", diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index bd0154c90fdd8957f99671b214ebd313fa6ac0cc..573455e5560f26fdd38d08c37d2eff530680b6ca 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -292,9 +292,9 @@ def create_app(args): ), ) - # Configure rerank function if enabled + # Configure rerank function if model and API are configured rerank_model_func = None - if args.enable_rerank and args.rerank_binding_api_key and args.rerank_binding_host: + if args.rerank_binding_api_key and args.rerank_binding_host: from lightrag.rerank import custom_rerank async def server_rerank_func( @@ -312,10 +312,12 @@ def create_app(args): ) rerank_model_func = server_rerank_func - logger.info(f"Rerank enabled with model: {args.rerank_model}") - elif args.enable_rerank: - logger.warning( - "Rerank enabled but RERANK_BINDING_API_KEY or RERANK_BINDING_HOST not configured. Rerank will be disabled." + logger.info( + f"Rerank model configured: {args.rerank_model} (can be enabled per query)" + ) + else: + logger.info( + "Rerank model not configured. Set RERANK_BINDING_API_KEY and RERANK_BINDING_HOST to enable reranking." ) # Initialize RAG @@ -351,7 +353,6 @@ def create_app(args): }, enable_llm_cache_for_entity_extract=args.enable_llm_cache_for_extract, enable_llm_cache=args.enable_llm_cache, - enable_rerank=args.enable_rerank, rerank_model_func=rerank_model_func, auto_manage_storages_states=False, max_parallel_insert=args.max_parallel_insert, @@ -381,7 +382,6 @@ def create_app(args): }, enable_llm_cache_for_entity_extract=args.enable_llm_cache_for_extract, enable_llm_cache=args.enable_llm_cache, - enable_rerank=args.enable_rerank, rerank_model_func=rerank_model_func, auto_manage_storages_states=False, max_parallel_insert=args.max_parallel_insert, @@ -512,11 +512,13 @@ def create_app(args): "enable_llm_cache": args.enable_llm_cache, "workspace": args.workspace, "max_graph_nodes": args.max_graph_nodes, - # Rerank configuration - "enable_rerank": args.enable_rerank, - "rerank_model": args.rerank_model if args.enable_rerank else None, + # Rerank configuration (based on whether rerank model is configured) + "enable_rerank": rerank_model_func is not None, + "rerank_model": args.rerank_model + if rerank_model_func is not None + else None, "rerank_binding_host": args.rerank_binding_host - if args.enable_rerank + if rerank_model_func is not None else None, }, "auth_mode": auth_mode, diff --git a/lightrag/api/routers/query_routes.py b/lightrag/api/routers/query_routes.py index 4005b599c511088fbf683806282ec739a011d834..4d97f151f028a9b4d8240d3977a2c2a377bacb86 100644 --- a/lightrag/api/routers/query_routes.py +++ b/lightrag/api/routers/query_routes.py @@ -52,13 +52,7 @@ class QueryRequest(BaseModel): chunk_top_k: Optional[int] = Field( ge=1, default=None, - description="Number of text chunks to retrieve initially from vector search.", - ) - - chunk_rerank_top_k: Optional[int] = Field( - ge=1, - default=None, - description="Number of text chunks to keep after reranking.", + description="Number of text chunks to retrieve initially from vector search and keep after reranking.", ) max_entity_tokens: Optional[int] = Field( @@ -99,6 +93,11 @@ class QueryRequest(BaseModel): description="User-provided prompt for the query. If provided, this will be used instead of the default value from prompt template.", ) + enable_rerank: Optional[bool] = Field( + default=None, + description="Enable reranking for retrieved text chunks. If True but no rerank model is configured, a warning will be issued. Default is True.", + ) + @field_validator("query", mode="after") @classmethod def query_strip_after(cls, query: str) -> str: diff --git a/lightrag/api/webui/assets/_basePickBy-DR8u580m.js b/lightrag/api/webui/assets/_basePickBy-DR8u580m.js new file mode 100644 index 0000000000000000000000000000000000000000..57f7d82df4aadf14048df086481cb781f0f0a7d4 Binary files /dev/null and b/lightrag/api/webui/assets/_basePickBy-DR8u580m.js differ diff --git a/lightrag/api/webui/assets/_basePickBy-DdjSt9r0.js b/lightrag/api/webui/assets/_basePickBy-DdjSt9r0.js deleted file mode 100644 index 3a371f8c500be6be6356bf87bda3ac40e1528949..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/_basePickBy-DdjSt9r0.js and /dev/null differ diff --git a/lightrag/api/webui/assets/_baseUniq-DdWiKhjG.js b/lightrag/api/webui/assets/_baseUniq-CKkyFsDq.js similarity index 82% rename from lightrag/api/webui/assets/_baseUniq-DdWiKhjG.js rename to lightrag/api/webui/assets/_baseUniq-CKkyFsDq.js index e899858d0d50493d903c2e0c851cd657b348a32d..e2450071efa11a76de921b63e8bec664f46e0bcb 100644 Binary files a/lightrag/api/webui/assets/_baseUniq-DdWiKhjG.js and b/lightrag/api/webui/assets/_baseUniq-CKkyFsDq.js differ diff --git a/lightrag/api/webui/assets/architectureDiagram-IEHRJDOE-Cf-8Q4BY.js b/lightrag/api/webui/assets/architectureDiagram-IEHRJDOE-Cf-8Q4BY.js deleted file mode 100644 index be58b9ec03dd8761fa45b9a55ae671f6c46a8114..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/architectureDiagram-IEHRJDOE-Cf-8Q4BY.js and /dev/null differ diff --git a/lightrag/api/webui/assets/architectureDiagram-NQ2NVSRB-w6nCd0Ti.js b/lightrag/api/webui/assets/architectureDiagram-NQ2NVSRB-w6nCd0Ti.js new file mode 100644 index 0000000000000000000000000000000000000000..696ce18c23199f3b519872e9395b9b4139811d5d Binary files /dev/null and b/lightrag/api/webui/assets/architectureDiagram-NQ2NVSRB-w6nCd0Ti.js differ diff --git a/lightrag/api/webui/assets/blockDiagram-JOT3LUYC-ClZ0ftTx.js b/lightrag/api/webui/assets/blockDiagram-JOT3LUYC-ClZ0ftTx.js deleted file mode 100644 index 590359202872bf0050376b469ea7af65360076f3..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/blockDiagram-JOT3LUYC-ClZ0ftTx.js and /dev/null differ diff --git a/lightrag/api/webui/assets/blockDiagram-PHRCVELO-B3UgnL3C.js b/lightrag/api/webui/assets/blockDiagram-PHRCVELO-B3UgnL3C.js new file mode 100644 index 0000000000000000000000000000000000000000..f6b3fb7ba8a0c0a9b06bef6f66d02c78aef257a3 Binary files /dev/null and b/lightrag/api/webui/assets/blockDiagram-PHRCVELO-B3UgnL3C.js differ diff --git a/lightrag/api/webui/assets/c4Diagram-VJAJSXHY-B5jFCOvG.js b/lightrag/api/webui/assets/c4Diagram-6F6E4RAY-rq2o5gxe.js similarity index 76% rename from lightrag/api/webui/assets/c4Diagram-VJAJSXHY-B5jFCOvG.js rename to lightrag/api/webui/assets/c4Diagram-6F6E4RAY-rq2o5gxe.js index 45e50cd81121e104237f37b543d3cb79e2da29b9..1f8e495143107450914db7daa8ddc751d091a67f 100644 Binary files a/lightrag/api/webui/assets/c4Diagram-VJAJSXHY-B5jFCOvG.js and b/lightrag/api/webui/assets/c4Diagram-6F6E4RAY-rq2o5gxe.js differ diff --git a/lightrag/api/webui/assets/chunk-4BMEZGHF-B5GU8YSo.js b/lightrag/api/webui/assets/chunk-353BL4L5-DBAQDRRL.js similarity index 78% rename from lightrag/api/webui/assets/chunk-4BMEZGHF-B5GU8YSo.js rename to lightrag/api/webui/assets/chunk-353BL4L5-DBAQDRRL.js index 7171ff6a3586e56875b96d64f3a0beb3776fe41e..1c429e1152fcd8a2b126948f6e53f760a1097992 100644 Binary files a/lightrag/api/webui/assets/chunk-4BMEZGHF-B5GU8YSo.js and b/lightrag/api/webui/assets/chunk-353BL4L5-DBAQDRRL.js differ diff --git a/lightrag/api/webui/assets/chunk-D6G4REZN-CVOf5ZRJ.js b/lightrag/api/webui/assets/chunk-67H74DCK-CWSxjWVJ.js similarity index 80% rename from lightrag/api/webui/assets/chunk-D6G4REZN-CVOf5ZRJ.js rename to lightrag/api/webui/assets/chunk-67H74DCK-CWSxjWVJ.js index a644fe8f886f77c1c9d7c5a2ebe6f78a8b72009d..f14e3e9447a8039a205fd2ecabc696075725e5fd 100644 Binary files a/lightrag/api/webui/assets/chunk-D6G4REZN-CVOf5ZRJ.js and b/lightrag/api/webui/assets/chunk-67H74DCK-CWSxjWVJ.js differ diff --git a/lightrag/api/webui/assets/chunk-6OLS64BW-DprZxoQ9.js b/lightrag/api/webui/assets/chunk-6OLS64BW-DprZxoQ9.js new file mode 100644 index 0000000000000000000000000000000000000000..7e261f22cd2e062228d3e6423debff69432eac6a Binary files /dev/null and b/lightrag/api/webui/assets/chunk-6OLS64BW-DprZxoQ9.js differ diff --git a/lightrag/api/webui/assets/chunk-XZIHB7SX-BNwgeCsm.js b/lightrag/api/webui/assets/chunk-AACKK3MU-A-tEx853.js similarity index 67% rename from lightrag/api/webui/assets/chunk-XZIHB7SX-BNwgeCsm.js rename to lightrag/api/webui/assets/chunk-AACKK3MU-A-tEx853.js index b8a4ccd9b227f126614df24452d41072a59cbaa8..80051f59faf55a40536ebc0f2d84fba5bde13ebe 100644 Binary files a/lightrag/api/webui/assets/chunk-XZIHB7SX-BNwgeCsm.js and b/lightrag/api/webui/assets/chunk-AACKK3MU-A-tEx853.js differ diff --git a/lightrag/api/webui/assets/chunk-AEK57VVT-D9reeTsn.js b/lightrag/api/webui/assets/chunk-AEK57VVT-D9reeTsn.js deleted file mode 100644 index d94107f293a42cf80da22c6db974c86b9e10ce32..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/chunk-AEK57VVT-D9reeTsn.js and /dev/null differ diff --git a/lightrag/api/webui/assets/chunk-BFAMUDN2-BhkXHAMT.js b/lightrag/api/webui/assets/chunk-BFAMUDN2-BhkXHAMT.js new file mode 100644 index 0000000000000000000000000000000000000000..23da384b32d2bd7fc22aee5e27ed1bd5b3b6b812 Binary files /dev/null and b/lightrag/api/webui/assets/chunk-BFAMUDN2-BhkXHAMT.js differ diff --git a/lightrag/api/webui/assets/chunk-E2GYISFI-CqnVcYld.js b/lightrag/api/webui/assets/chunk-E2GYISFI-CqnVcYld.js new file mode 100644 index 0000000000000000000000000000000000000000..10a0c1f848d3c95b373cdac68150874d2ee7ee59 Binary files /dev/null and b/lightrag/api/webui/assets/chunk-E2GYISFI-CqnVcYld.js differ diff --git a/lightrag/api/webui/assets/chunk-A2AXSNBT-Nn-DDv3A.js b/lightrag/api/webui/assets/chunk-QEP2MXWD-Bk9mYvop.js similarity index 67% rename from lightrag/api/webui/assets/chunk-A2AXSNBT-Nn-DDv3A.js rename to lightrag/api/webui/assets/chunk-QEP2MXWD-Bk9mYvop.js index c5c703a702e0a2f9c5393dc4891135bc3a4a5e1b..7cd13bc0e413d98317a48369ad95858f85e97124 100644 Binary files a/lightrag/api/webui/assets/chunk-A2AXSNBT-Nn-DDv3A.js and b/lightrag/api/webui/assets/chunk-QEP2MXWD-Bk9mYvop.js differ diff --git a/lightrag/api/webui/assets/chunk-RZ5BOZE2-DQT2Xkjs.js b/lightrag/api/webui/assets/chunk-RZ5BOZE2-DQT2Xkjs.js deleted file mode 100644 index 2ef3dbbf365378a5f94e5c5e654450e627df2d71..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/chunk-RZ5BOZE2-DQT2Xkjs.js and /dev/null differ diff --git a/lightrag/api/webui/assets/chunk-SKB7J2MH-BblaHGx6.js b/lightrag/api/webui/assets/chunk-SKB7J2MH-BblaHGx6.js new file mode 100644 index 0000000000000000000000000000000000000000..9c22ec51fca9903e44c4a9cc5c44578be08d66ea Binary files /dev/null and b/lightrag/api/webui/assets/chunk-SKB7J2MH-BblaHGx6.js differ diff --git a/lightrag/api/webui/assets/classDiagram-BGRH5UQR-B9E8imAB.js b/lightrag/api/webui/assets/classDiagram-BGRH5UQR-B9E8imAB.js new file mode 100644 index 0000000000000000000000000000000000000000..bb6d3f518171ce4d45399ea18bc7f5d37fd42bea Binary files /dev/null and b/lightrag/api/webui/assets/classDiagram-BGRH5UQR-B9E8imAB.js differ diff --git a/lightrag/api/webui/assets/classDiagram-GIVACNV2-BUUuyKzR.js b/lightrag/api/webui/assets/classDiagram-GIVACNV2-BUUuyKzR.js deleted file mode 100644 index 8534f2c05621c201c695f175b9a92fecad874760..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/classDiagram-GIVACNV2-BUUuyKzR.js and /dev/null differ diff --git a/lightrag/api/webui/assets/classDiagram-v2-COTLJTTW-BUUuyKzR.js b/lightrag/api/webui/assets/classDiagram-v2-COTLJTTW-BUUuyKzR.js deleted file mode 100644 index 8534f2c05621c201c695f175b9a92fecad874760..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/classDiagram-v2-COTLJTTW-BUUuyKzR.js and /dev/null differ diff --git a/lightrag/api/webui/assets/classDiagram-v2-O24JOBDK-B9E8imAB.js b/lightrag/api/webui/assets/classDiagram-v2-O24JOBDK-B9E8imAB.js new file mode 100644 index 0000000000000000000000000000000000000000..bb6d3f518171ce4d45399ea18bc7f5d37fd42bea Binary files /dev/null and b/lightrag/api/webui/assets/classDiagram-v2-O24JOBDK-B9E8imAB.js differ diff --git a/lightrag/api/webui/assets/clone-CMIdR30B.js b/lightrag/api/webui/assets/clone-CMIdR30B.js new file mode 100644 index 0000000000000000000000000000000000000000..f7a14515c454de073c81c2d69d399c2f7d518fae Binary files /dev/null and b/lightrag/api/webui/assets/clone-CMIdR30B.js differ diff --git a/lightrag/api/webui/assets/clone-Cy0pbWCc.js b/lightrag/api/webui/assets/clone-Cy0pbWCc.js deleted file mode 100644 index a3d9b01369cd3c74ac726aeafbc187daf7b19679..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/clone-Cy0pbWCc.js and /dev/null differ diff --git a/lightrag/api/webui/assets/cytoscape.esm-CfBqOv7Q.js b/lightrag/api/webui/assets/cytoscape.esm-CfBqOv7Q.js deleted file mode 100644 index dc213bc677c52da97277281e19464f31e8e2f27c..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/cytoscape.esm-CfBqOv7Q.js and /dev/null differ diff --git a/lightrag/api/webui/assets/cytoscape.esm-DjuLyO2d.js b/lightrag/api/webui/assets/cytoscape.esm-DjuLyO2d.js new file mode 100644 index 0000000000000000000000000000000000000000..cd6f531e0f8bb6253603585f7707b1f5425f8d00 Binary files /dev/null and b/lightrag/api/webui/assets/cytoscape.esm-DjuLyO2d.js differ diff --git a/lightrag/api/webui/assets/dagre-OKDRZEBW-0Fmtrx_J.js b/lightrag/api/webui/assets/dagre-FFZHY6LT-D8qIVl3H.js similarity index 82% rename from lightrag/api/webui/assets/dagre-OKDRZEBW-0Fmtrx_J.js rename to lightrag/api/webui/assets/dagre-FFZHY6LT-D8qIVl3H.js index 58c5a3ca3063b4502a5b1fba5cea9ef17a63cab9..0f76fb03dbc82900cdba0d272273a9de099e79e2 100644 Binary files a/lightrag/api/webui/assets/dagre-OKDRZEBW-0Fmtrx_J.js and b/lightrag/api/webui/assets/dagre-FFZHY6LT-D8qIVl3H.js differ diff --git a/lightrag/api/webui/assets/diagram-3EMPZRKU-C3dfJoE4.js b/lightrag/api/webui/assets/diagram-3EMPZRKU-C3dfJoE4.js new file mode 100644 index 0000000000000000000000000000000000000000..0d70720ab217ae3b08415371a715d58580a5dec9 Binary files /dev/null and b/lightrag/api/webui/assets/diagram-3EMPZRKU-C3dfJoE4.js differ diff --git a/lightrag/api/webui/assets/diagram-5UYTHUR4-C4ExlZGh.js b/lightrag/api/webui/assets/diagram-5UYTHUR4-C4ExlZGh.js new file mode 100644 index 0000000000000000000000000000000000000000..d56efac8e65d9b942cacebf8515237948a221cab Binary files /dev/null and b/lightrag/api/webui/assets/diagram-5UYTHUR4-C4ExlZGh.js differ diff --git a/lightrag/api/webui/assets/diagram-SSKATNLV-D60YVbmk.js b/lightrag/api/webui/assets/diagram-SSKATNLV-D60YVbmk.js deleted file mode 100644 index 35a5b70fc87c090a8bc4e0e135785bbc747b2157..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/diagram-SSKATNLV-D60YVbmk.js and /dev/null differ diff --git a/lightrag/api/webui/assets/diagram-VNBRO52H-BUFG-mOp.js b/lightrag/api/webui/assets/diagram-VNBRO52H-BUFG-mOp.js deleted file mode 100644 index 09e25a9c6e3c522f5ffbe58793f5f43fc42f08f9..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/diagram-VNBRO52H-BUFG-mOp.js and /dev/null differ diff --git a/lightrag/api/webui/assets/diagram-ZTM2IBQH-Dhuhv0oL.js b/lightrag/api/webui/assets/diagram-ZTM2IBQH-Dhuhv0oL.js new file mode 100644 index 0000000000000000000000000000000000000000..1ea05d8e6f6b833a668d06e32e75c48ca6eb5d2c Binary files /dev/null and b/lightrag/api/webui/assets/diagram-ZTM2IBQH-Dhuhv0oL.js differ diff --git a/lightrag/api/webui/assets/erDiagram-Q7BY3M3F-Cafo7nZ2.js b/lightrag/api/webui/assets/erDiagram-R3QVA2FD-XJFq5Gdn.js similarity index 59% rename from lightrag/api/webui/assets/erDiagram-Q7BY3M3F-Cafo7nZ2.js rename to lightrag/api/webui/assets/erDiagram-R3QVA2FD-XJFq5Gdn.js index 46ee1c29942d9670807f222de6fea4700af5921b..d3a1993b366e6a1ff01ae0cfeb669d01ba2a87e2 100644 Binary files a/lightrag/api/webui/assets/erDiagram-Q7BY3M3F-Cafo7nZ2.js and b/lightrag/api/webui/assets/erDiagram-R3QVA2FD-XJFq5Gdn.js differ diff --git a/lightrag/api/webui/assets/feature-documents--uHlw_9L.js b/lightrag/api/webui/assets/feature-documents-DNEZp_nA.js similarity index 99% rename from lightrag/api/webui/assets/feature-documents--uHlw_9L.js rename to lightrag/api/webui/assets/feature-documents-DNEZp_nA.js index c8b3020b3941282e2d4f757a64d4715112169588..404d06b83aee7dfc2ba968d403c3078c7583d0fc 100644 Binary files a/lightrag/api/webui/assets/feature-documents--uHlw_9L.js and b/lightrag/api/webui/assets/feature-documents-DNEZp_nA.js differ diff --git a/lightrag/api/webui/assets/feature-graph-CTyfN-T7.js b/lightrag/api/webui/assets/feature-graph-CTyfN-T7.js new file mode 100644 index 0000000000000000000000000000000000000000..b8d461da15dacfddf417ab2ad7b7b197c7966d8f Binary files /dev/null and b/lightrag/api/webui/assets/feature-graph-CTyfN-T7.js differ diff --git a/lightrag/api/webui/assets/feature-graph-ajMjCROw.js b/lightrag/api/webui/assets/feature-graph-ajMjCROw.js deleted file mode 100644 index 87e290e6b4c317ff069d0877f2368fb08ad95eae..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/feature-graph-ajMjCROw.js and /dev/null differ diff --git a/lightrag/api/webui/assets/feature-retrieval-C4OgyLZ6.js b/lightrag/api/webui/assets/feature-retrieval-C4OgyLZ6.js new file mode 100644 index 0000000000000000000000000000000000000000..4b4c70d408daebb6f8160801107e7c4d64e76dfc Binary files /dev/null and b/lightrag/api/webui/assets/feature-retrieval-C4OgyLZ6.js differ diff --git a/lightrag/api/webui/assets/feature-retrieval-DVIGk-ao.js b/lightrag/api/webui/assets/feature-retrieval-DVIGk-ao.js deleted file mode 100644 index 0a69817d629b8031052fd631dd46542fd31ea9d6..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/feature-retrieval-DVIGk-ao.js and /dev/null differ diff --git a/lightrag/api/webui/assets/flowDiagram-4HSFHLVR-xQbIgqay.js b/lightrag/api/webui/assets/flowDiagram-4HSFHLVR-xQbIgqay.js deleted file mode 100644 index f6ce3e80d16820ecd285e10fba9d73ff19bce7ac..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/flowDiagram-4HSFHLVR-xQbIgqay.js and /dev/null differ diff --git a/lightrag/api/webui/assets/flowDiagram-PKI6S5ZS-BEqKRCbS.js b/lightrag/api/webui/assets/flowDiagram-PKI6S5ZS-BEqKRCbS.js new file mode 100644 index 0000000000000000000000000000000000000000..ffff409d51e82ac63a0c7943c1be5c018c742c45 Binary files /dev/null and b/lightrag/api/webui/assets/flowDiagram-PKI6S5ZS-BEqKRCbS.js differ diff --git a/lightrag/api/webui/assets/ganttDiagram-APWFNJXF-CTlZdusL.js b/lightrag/api/webui/assets/ganttDiagram-APWFNJXF-CTlZdusL.js deleted file mode 100644 index 1b2e0533bb78379fe4baebac083323ba2d83e71a..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/ganttDiagram-APWFNJXF-CTlZdusL.js and /dev/null differ diff --git a/lightrag/api/webui/assets/ganttDiagram-EK5VF46D-CUMAN_qk.js b/lightrag/api/webui/assets/ganttDiagram-EK5VF46D-CUMAN_qk.js new file mode 100644 index 0000000000000000000000000000000000000000..7b69a357890ac460e6b82fc8b808157691c9e1d6 Binary files /dev/null and b/lightrag/api/webui/assets/ganttDiagram-EK5VF46D-CUMAN_qk.js differ diff --git a/lightrag/api/webui/assets/gitGraphDiagram-7IBYFJ6S-QQ7jy358.js b/lightrag/api/webui/assets/gitGraphDiagram-7IBYFJ6S-QQ7jy358.js deleted file mode 100644 index be4b0ac0ca81ccd7675c6840064f2dae7abf51f1..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/gitGraphDiagram-7IBYFJ6S-QQ7jy358.js and /dev/null differ diff --git a/lightrag/api/webui/assets/gitGraphDiagram-GW3U2K7C-CM_W77RX.js b/lightrag/api/webui/assets/gitGraphDiagram-GW3U2K7C-CM_W77RX.js new file mode 100644 index 0000000000000000000000000000000000000000..98d090cc125f5534be7edfc2a3fffa7d591a6734 Binary files /dev/null and b/lightrag/api/webui/assets/gitGraphDiagram-GW3U2K7C-CM_W77RX.js differ diff --git a/lightrag/api/webui/assets/graph-BYsfK8Zf.js b/lightrag/api/webui/assets/graph-CHXHXhyD.js similarity index 94% rename from lightrag/api/webui/assets/graph-BYsfK8Zf.js rename to lightrag/api/webui/assets/graph-CHXHXhyD.js index 6eb0a96622add0c947e87832e0e3a8f3685bbf04..42740b06e1ddbb123d33e9a6ab3c202e7950c522 100644 Binary files a/lightrag/api/webui/assets/graph-BYsfK8Zf.js and b/lightrag/api/webui/assets/graph-CHXHXhyD.js differ diff --git a/lightrag/api/webui/assets/graph-vendor-B-X5JegA.js b/lightrag/api/webui/assets/graph-vendor-BC3frDkq.js similarity index 66% rename from lightrag/api/webui/assets/graph-vendor-B-X5JegA.js rename to lightrag/api/webui/assets/graph-vendor-BC3frDkq.js index 284d52eda5606e5cffafc519c7b45ebc72968f70..6db35aa6f6e138cb07b5ed3d3abeea5cd69a7ad7 100644 Binary files a/lightrag/api/webui/assets/graph-vendor-B-X5JegA.js and b/lightrag/api/webui/assets/graph-vendor-BC3frDkq.js differ diff --git a/lightrag/api/webui/assets/index-BXW7ZC7b.css b/lightrag/api/webui/assets/index-BXW7ZC7b.css new file mode 100644 index 0000000000000000000000000000000000000000..e0db3beab9e0a4487b7e38b91edf56fac32b6e67 Binary files /dev/null and b/lightrag/api/webui/assets/index-BXW7ZC7b.css differ diff --git a/lightrag/api/webui/assets/index-BZ-Qnuxe.js b/lightrag/api/webui/assets/index-BZ-Qnuxe.js deleted file mode 100644 index 3330e7835a269928e4b3179b6c4cad8fce8daf47..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/index-BZ-Qnuxe.js and /dev/null differ diff --git a/lightrag/api/webui/assets/index-C1kPL13a.js b/lightrag/api/webui/assets/index-C1kPL13a.js new file mode 100644 index 0000000000000000000000000000000000000000..91dd05320447789e7904ab5281eda14eb6417bec Binary files /dev/null and b/lightrag/api/webui/assets/index-C1kPL13a.js differ diff --git a/lightrag/api/webui/assets/index-Cdh43tIs.js b/lightrag/api/webui/assets/index-Cdh43tIs.js deleted file mode 100644 index 6074fe9b108011147be0dca14f7bb780a6674909..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/index-Cdh43tIs.js and /dev/null differ diff --git a/lightrag/api/webui/assets/index-DwO2XWaU.css b/lightrag/api/webui/assets/index-DwO2XWaU.css deleted file mode 100644 index f200d64cafa27a37b4b477d3733a7bbda2a1b75b..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/index-DwO2XWaU.css and /dev/null differ diff --git a/lightrag/api/webui/assets/index-P-DdP8A0.js b/lightrag/api/webui/assets/index-P-DdP8A0.js new file mode 100644 index 0000000000000000000000000000000000000000..1e7549764eb7221ef9456c8beb964504f48331bd Binary files /dev/null and b/lightrag/api/webui/assets/index-P-DdP8A0.js differ diff --git a/lightrag/api/webui/assets/infoDiagram-PH2N3AL5-e4bVi5oy.js b/lightrag/api/webui/assets/infoDiagram-PH2N3AL5-e4bVi5oy.js deleted file mode 100644 index 5368ccc43ad595ca577850f1b8adb715384aabe0..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/infoDiagram-PH2N3AL5-e4bVi5oy.js and /dev/null differ diff --git a/lightrag/api/webui/assets/infoDiagram-XT3IWWJI-CO_psN6Q.js b/lightrag/api/webui/assets/infoDiagram-XT3IWWJI-CO_psN6Q.js new file mode 100644 index 0000000000000000000000000000000000000000..2ba06cd19a9ea46193bf8cd68b556ecdd1ef3f08 Binary files /dev/null and b/lightrag/api/webui/assets/infoDiagram-XT3IWWJI-CO_psN6Q.js differ diff --git a/lightrag/api/webui/assets/journeyDiagram-EWQZEKCU-DhazTBPj.js b/lightrag/api/webui/assets/journeyDiagram-EWQZEKCU-DhazTBPj.js new file mode 100644 index 0000000000000000000000000000000000000000..19452442dcddd100245f3ab1f4ac02ef85da2ad2 Binary files /dev/null and b/lightrag/api/webui/assets/journeyDiagram-EWQZEKCU-DhazTBPj.js differ diff --git a/lightrag/api/webui/assets/journeyDiagram-U35MCT3I-DnRvERqM.js b/lightrag/api/webui/assets/journeyDiagram-U35MCT3I-DnRvERqM.js deleted file mode 100644 index 08738f4b15a286aac228dc9022e68a16a6f9203b..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/journeyDiagram-U35MCT3I-DnRvERqM.js and /dev/null differ diff --git a/lightrag/api/webui/assets/kanban-definition-NDS4AKOZ-ByzL6qlG.js b/lightrag/api/webui/assets/kanban-definition-ILFWEQ3N-DN1OyKMK.js similarity index 58% rename from lightrag/api/webui/assets/kanban-definition-NDS4AKOZ-ByzL6qlG.js rename to lightrag/api/webui/assets/kanban-definition-ILFWEQ3N-DN1OyKMK.js index 18bd059fd7477179ed6dfec9f10c743780afa932..630cd2c2c05fbb00c5d7a8b9627b7191aac515f0 100644 Binary files a/lightrag/api/webui/assets/kanban-definition-NDS4AKOZ-ByzL6qlG.js and b/lightrag/api/webui/assets/kanban-definition-ILFWEQ3N-DN1OyKMK.js differ diff --git a/lightrag/api/webui/assets/katex-DCmpTppl.js b/lightrag/api/webui/assets/katex-DCmpTppl.js deleted file mode 100644 index 67f43c5e50f616821cc0ae4c774b1cc323b8200b..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/katex-DCmpTppl.js and /dev/null differ diff --git a/lightrag/api/webui/assets/layout-DhbTtBin.js b/lightrag/api/webui/assets/layout-CwHuHHfz.js similarity index 90% rename from lightrag/api/webui/assets/layout-DhbTtBin.js rename to lightrag/api/webui/assets/layout-CwHuHHfz.js index c03e379f2199a9a4c33223e600e1dfcd5b8cc8bd..6846128bb3a0f450f2f8b88f6d2d9d0103afa7bf 100644 Binary files a/lightrag/api/webui/assets/layout-DhbTtBin.js and b/lightrag/api/webui/assets/layout-CwHuHHfz.js differ diff --git a/lightrag/api/webui/assets/markdown-vendor-DZPCLF-N.js b/lightrag/api/webui/assets/markdown-vendor-DZPCLF-N.js new file mode 100644 index 0000000000000000000000000000000000000000..7805b0c094fed220b1654257a007895b971ce78d Binary files /dev/null and b/lightrag/api/webui/assets/markdown-vendor-DZPCLF-N.js differ diff --git a/lightrag/api/webui/assets/markdown-vendor-mGl2lXzx.js b/lightrag/api/webui/assets/markdown-vendor-mGl2lXzx.js deleted file mode 100644 index e50666e1aa808a6f9b6817cf7d27aafdf1c3a412..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/markdown-vendor-mGl2lXzx.js and /dev/null differ diff --git a/lightrag/api/webui/assets/mermaid-vendor-0pb-wSh1.js b/lightrag/api/webui/assets/mermaid-vendor-0pb-wSh1.js new file mode 100644 index 0000000000000000000000000000000000000000..db6be27828f60b6a9242c7e992e83ed8d548df10 Binary files /dev/null and b/lightrag/api/webui/assets/mermaid-vendor-0pb-wSh1.js differ diff --git a/lightrag/api/webui/assets/mermaid-vendor-DxNSvhPA.js b/lightrag/api/webui/assets/mermaid-vendor-DxNSvhPA.js deleted file mode 100644 index 9c1cf30a35a6e7836433b55ddcd1f44495e7a5b3..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/mermaid-vendor-DxNSvhPA.js and /dev/null differ diff --git a/lightrag/api/webui/assets/mindmap-definition-ALO5MXBD-VDIW4xp5.js b/lightrag/api/webui/assets/mindmap-definition-CZNETY7S-CCDEg217.js similarity index 99% rename from lightrag/api/webui/assets/mindmap-definition-ALO5MXBD-VDIW4xp5.js rename to lightrag/api/webui/assets/mindmap-definition-CZNETY7S-CCDEg217.js index d716e268801235284237c37f8ecc323b0873e34b..1569ffed75dbee6051ed8c3f9c3921bcc2375449 100644 Binary files a/lightrag/api/webui/assets/mindmap-definition-ALO5MXBD-VDIW4xp5.js and b/lightrag/api/webui/assets/mindmap-definition-CZNETY7S-CCDEg217.js differ diff --git a/lightrag/api/webui/assets/pieDiagram-IB7DONF6-dyqP0eYy.js b/lightrag/api/webui/assets/pieDiagram-NIOCPIFQ-2v2dqwXW.js similarity index 69% rename from lightrag/api/webui/assets/pieDiagram-IB7DONF6-dyqP0eYy.js rename to lightrag/api/webui/assets/pieDiagram-NIOCPIFQ-2v2dqwXW.js index 94887c3b5eea6b1f95961966607c77ba480beae6..bebc84a78c6ee72c64d9d74f25f0b9447b65e426 100644 Binary files a/lightrag/api/webui/assets/pieDiagram-IB7DONF6-dyqP0eYy.js and b/lightrag/api/webui/assets/pieDiagram-NIOCPIFQ-2v2dqwXW.js differ diff --git a/lightrag/api/webui/assets/quadrantDiagram-7GDLP6J5-B3rBkYXx.js b/lightrag/api/webui/assets/quadrantDiagram-2OG54O6I-B1HdXuSU.js similarity index 99% rename from lightrag/api/webui/assets/quadrantDiagram-7GDLP6J5-B3rBkYXx.js rename to lightrag/api/webui/assets/quadrantDiagram-2OG54O6I-B1HdXuSU.js index 2e783b27e1982edbd23ac600ad8178eb23c2371c..9f15014a9958820b990437b80008d976a1a7aba3 100644 Binary files a/lightrag/api/webui/assets/quadrantDiagram-7GDLP6J5-B3rBkYXx.js and b/lightrag/api/webui/assets/quadrantDiagram-2OG54O6I-B1HdXuSU.js differ diff --git a/lightrag/api/webui/assets/radar-MK3ICKWK-Bc8q4S1r.js b/lightrag/api/webui/assets/radar-MK3ICKWK-Bc8q4S1r.js deleted file mode 100644 index 569a4376c4635f234a48c60416cea00668e9c749..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/radar-MK3ICKWK-Bc8q4S1r.js and /dev/null differ diff --git a/lightrag/api/webui/assets/react-vendor-CgPb4pW_.js b/lightrag/api/webui/assets/react-vendor-CgPb4pW_.js new file mode 100644 index 0000000000000000000000000000000000000000..e7ed9efb537cade70a9b8530990a7cba0a37056e Binary files /dev/null and b/lightrag/api/webui/assets/react-vendor-CgPb4pW_.js differ diff --git a/lightrag/api/webui/assets/react-vendor-DEwriMA6.js b/lightrag/api/webui/assets/react-vendor-DEwriMA6.js deleted file mode 100644 index a63fd4959e441e7da7b0e351b42a358bc55a6f0e..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/react-vendor-DEwriMA6.js and /dev/null differ diff --git a/lightrag/api/webui/assets/requirementDiagram-KVF5MWMF-DBhepnB-.js b/lightrag/api/webui/assets/requirementDiagram-KVF5MWMF-DBhepnB-.js deleted file mode 100644 index a04fa465d217835ddb327f29e4700e3e01ff6a31..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/requirementDiagram-KVF5MWMF-DBhepnB-.js and /dev/null differ diff --git a/lightrag/api/webui/assets/requirementDiagram-SO3GGRV7-BNtjL9Mr.js b/lightrag/api/webui/assets/requirementDiagram-SO3GGRV7-BNtjL9Mr.js new file mode 100644 index 0000000000000000000000000000000000000000..a6d643cbe1d8b3569952d6468202c04b12eab78b Binary files /dev/null and b/lightrag/api/webui/assets/requirementDiagram-SO3GGRV7-BNtjL9Mr.js differ diff --git a/lightrag/api/webui/assets/sankeyDiagram-QLVOVGJD-DpoogoXk.js b/lightrag/api/webui/assets/sankeyDiagram-4UZDY2LN-CbN-P5qg.js similarity index 96% rename from lightrag/api/webui/assets/sankeyDiagram-QLVOVGJD-DpoogoXk.js rename to lightrag/api/webui/assets/sankeyDiagram-4UZDY2LN-CbN-P5qg.js index e9a35f9c96cfa2a42c0d6faa574b3c9f7223793b..ed88036e5124b4308682f1231f99b8cc218cf383 100644 Binary files a/lightrag/api/webui/assets/sankeyDiagram-QLVOVGJD-DpoogoXk.js and b/lightrag/api/webui/assets/sankeyDiagram-4UZDY2LN-CbN-P5qg.js differ diff --git a/lightrag/api/webui/assets/sequenceDiagram-X6HHIX6F-CHVmXGw_.js b/lightrag/api/webui/assets/sequenceDiagram-X6HHIX6F-CHVmXGw_.js deleted file mode 100644 index 8496807e34400a1c2f91de7091e6a970ea6abc4c..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/sequenceDiagram-X6HHIX6F-CHVmXGw_.js and /dev/null differ diff --git a/lightrag/api/webui/assets/sequenceDiagram-ZIKVLSP4-DAnSPuBo.js b/lightrag/api/webui/assets/sequenceDiagram-ZIKVLSP4-DAnSPuBo.js new file mode 100644 index 0000000000000000000000000000000000000000..3e0c8d7252e4f7663355850857fe2579e811e1a2 Binary files /dev/null and b/lightrag/api/webui/assets/sequenceDiagram-ZIKVLSP4-DAnSPuBo.js differ diff --git a/lightrag/api/webui/assets/stateDiagram-DGXRK772-HAKX-Wp6.js b/lightrag/api/webui/assets/stateDiagram-DGXRK772-HAKX-Wp6.js deleted file mode 100644 index 521bd8d60a128d482d4904aca4f2423da72d2b7f..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/stateDiagram-DGXRK772-HAKX-Wp6.js and /dev/null differ diff --git a/lightrag/api/webui/assets/stateDiagram-XX37X6EN-Wb47NRTE.js b/lightrag/api/webui/assets/stateDiagram-XX37X6EN-Wb47NRTE.js new file mode 100644 index 0000000000000000000000000000000000000000..a6088d53c1ed6c2e15c69e72470b807ed888b491 Binary files /dev/null and b/lightrag/api/webui/assets/stateDiagram-XX37X6EN-Wb47NRTE.js differ diff --git a/lightrag/api/webui/assets/stateDiagram-v2-GD6S3NHB-I1pnn6Vf.js b/lightrag/api/webui/assets/stateDiagram-v2-GD6S3NHB-I1pnn6Vf.js new file mode 100644 index 0000000000000000000000000000000000000000..fed3a69e0248876600b8023332fdaf2d319f7405 Binary files /dev/null and b/lightrag/api/webui/assets/stateDiagram-v2-GD6S3NHB-I1pnn6Vf.js differ diff --git a/lightrag/api/webui/assets/stateDiagram-v2-YXO3MK2T-CtvtA9TP.js b/lightrag/api/webui/assets/stateDiagram-v2-YXO3MK2T-CtvtA9TP.js deleted file mode 100644 index 59831e14b99b1c14c9268c865fcc2a3a173c3b6c..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/stateDiagram-v2-YXO3MK2T-CtvtA9TP.js and /dev/null differ diff --git a/lightrag/api/webui/assets/timeline-definition-BDJGKUSR-BU12fxws.js b/lightrag/api/webui/assets/timeline-definition-BDJGKUSR-BU12fxws.js deleted file mode 100644 index 0a380c8f708e93561dd008f06cfe93e391729ea5..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/timeline-definition-BDJGKUSR-BU12fxws.js and /dev/null differ diff --git a/lightrag/api/webui/assets/timeline-definition-RI47OAVP-CWkCn9Wa.js b/lightrag/api/webui/assets/timeline-definition-RI47OAVP-CWkCn9Wa.js new file mode 100644 index 0000000000000000000000000000000000000000..03856441b68f27f742bb173859b64b5ec4fcc2de Binary files /dev/null and b/lightrag/api/webui/assets/timeline-definition-RI47OAVP-CWkCn9Wa.js differ diff --git a/lightrag/api/webui/assets/treemap-6Y5VK53G-Cu50KCbJ.js b/lightrag/api/webui/assets/treemap-6Y5VK53G-Cu50KCbJ.js new file mode 100644 index 0000000000000000000000000000000000000000..a60c3fa68198762ba336d418e459a79a05e6a25f Binary files /dev/null and b/lightrag/api/webui/assets/treemap-6Y5VK53G-Cu50KCbJ.js differ diff --git a/lightrag/api/webui/assets/ui-vendor-CeCm8EER.js b/lightrag/api/webui/assets/ui-vendor-CeCm8EER.js deleted file mode 100644 index fc840af3daec8f6d1784ec1a4bf921784036bb82..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/ui-vendor-CeCm8EER.js and /dev/null differ diff --git a/lightrag/api/webui/assets/ui-vendor-DaJTMqwy.js b/lightrag/api/webui/assets/ui-vendor-DaJTMqwy.js new file mode 100644 index 0000000000000000000000000000000000000000..16b06696e54c082fef4b23f91aa2d183a6064616 Binary files /dev/null and b/lightrag/api/webui/assets/ui-vendor-DaJTMqwy.js differ diff --git a/lightrag/api/webui/assets/utils-vendor-BysuhMZA.js b/lightrag/api/webui/assets/utils-vendor-BysuhMZA.js deleted file mode 100644 index f558501f791aae760b6b8fcec26a96bd1d4e8b66..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/utils-vendor-BysuhMZA.js and /dev/null differ diff --git a/lightrag/api/webui/assets/utils-vendor-elCzPYZl.js b/lightrag/api/webui/assets/utils-vendor-elCzPYZl.js new file mode 100644 index 0000000000000000000000000000000000000000..31f5678eff09703e1e7ec98134bf7183498211de Binary files /dev/null and b/lightrag/api/webui/assets/utils-vendor-elCzPYZl.js differ diff --git a/lightrag/api/webui/assets/xychartDiagram-H2YORKM3-DpPbowlL.js b/lightrag/api/webui/assets/xychartDiagram-H2YORKM3-DpPbowlL.js new file mode 100644 index 0000000000000000000000000000000000000000..4879140d0d83bde2a6497e9a82a2852995131e79 Binary files /dev/null and b/lightrag/api/webui/assets/xychartDiagram-H2YORKM3-DpPbowlL.js differ diff --git a/lightrag/api/webui/assets/xychartDiagram-VJFVF3MP-BABz2cBw.js b/lightrag/api/webui/assets/xychartDiagram-VJFVF3MP-BABz2cBw.js deleted file mode 100644 index 82198af20213076de969ba03019c19e33c3c1f9c..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/xychartDiagram-VJFVF3MP-BABz2cBw.js and /dev/null differ diff --git a/lightrag/api/webui/index.html b/lightrag/api/webui/index.html index 115f1c03dcafea4b9f8475362071bf650d043caa..6a08e2658cfa2d56838dc33635f04268bd8b917e 100644 Binary files a/lightrag/api/webui/index.html and b/lightrag/api/webui/index.html differ diff --git a/lightrag/api/webui/logo.svg b/lightrag/api/webui/logo.svg index fd32836ba94e05934a73fa226e638889792b5e38..6ffd06015d4a391599bfca7df4896eeb1059727f 100755 Binary files a/lightrag/api/webui/logo.svg and b/lightrag/api/webui/logo.svg differ diff --git a/lightrag/base.py b/lightrag/base.py index 67d641cad403120cfce9c803a7455ae1f2c4a18d..4a2d1b40e4610702c5134eee5ffcaa95525d583c 100644 --- a/lightrag/base.py +++ b/lightrag/base.py @@ -61,15 +61,10 @@ class QueryParam: """Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode.""" chunk_top_k: int = int(os.getenv("CHUNK_TOP_K", "5")) - """Number of text chunks to retrieve initially from vector search. + """Number of text chunks to retrieve initially from vector search and keep after reranking. If None, defaults to top_k value. """ - chunk_rerank_top_k: int = int(os.getenv("CHUNK_RERANK_TOP_K", "5")) - """Number of text chunks to keep after reranking. - If None, keeps all chunks returned from initial retrieval. - """ - max_entity_tokens: int = int(os.getenv("MAX_ENTITY_TOKENS", "10000")) """Maximum number of tokens allocated for entity context in unified token control system.""" @@ -107,6 +102,11 @@ class QueryParam: If proivded, this will be use instead of the default vaulue from prompt template. """ + enable_rerank: bool = True + """Enable reranking for retrieved text chunks. If True but no rerank model is configured, a warning will be issued. + Default is True to enable reranking when rerank model is available. + """ + @dataclass class StorageNameSpace(ABC): diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index b6cca32ad41bcad85745e2a5e4accf270010e6a4..81bac69c22f3797429ff6cb483832f4c6b753c75 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -243,11 +243,6 @@ class LightRAG: # Rerank Configuration # --- - enable_rerank: bool = field( - default=bool(os.getenv("ENABLE_RERANK", "False").lower() == "true") - ) - """Enable reranking for improved retrieval quality. Defaults to False.""" - rerank_model_func: Callable[..., object] | None = field(default=None) """Function for reranking retrieved documents. All rerank configurations (model name, API keys, top_k, etc.) should be included in this function. Optional.""" @@ -459,9 +454,9 @@ class LightRAG: ) # Init Rerank - if self.enable_rerank and self.rerank_model_func: + if self.rerank_model_func: logger.info("Rerank model initialized for improved retrieval quality") - elif self.enable_rerank and not self.rerank_model_func: + else: logger.warning( "Rerank is enabled but no rerank_model_func provided. Reranking will be skipped." ) diff --git a/lightrag/operate.py b/lightrag/operate.py index 98c045fb45e074ce30052aedc7c2b61905a09142..994acaa3fb5e725498abe54e0b6ed6af161ab004 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -1976,6 +1976,14 @@ async def _build_query_context( # Truncate entities based on complete JSON serialization if entities_context: original_entity_count = len(entities_context) + + # Process entities context to replace GRAPH_FIELD_SEP with : in file_path fields + for entity in entities_context: + if "file_path" in entity and entity["file_path"]: + entity["file_path"] = entity["file_path"].replace( + GRAPH_FIELD_SEP, ";" + ) + entities_context = truncate_list_by_token_size( entities_context, key=lambda x: json.dumps(x, ensure_ascii=False), @@ -1990,6 +1998,14 @@ async def _build_query_context( # Truncate relations based on complete JSON serialization if relations_context: original_relation_count = len(relations_context) + + # Process relations context to replace GRAPH_FIELD_SEP with : in file_path fields + for relation in relations_context: + if "file_path" in relation and relation["file_path"]: + relation["file_path"] = relation["file_path"].replace( + GRAPH_FIELD_SEP, ";" + ) + relations_context = truncate_list_by_token_size( relations_context, key=lambda x: json.dumps(x, ensure_ascii=False), @@ -3025,6 +3041,7 @@ async def apply_rerank_if_enabled( query: str, retrieved_docs: list[dict], global_config: dict, + enable_rerank: bool = True, top_k: int = None, ) -> list[dict]: """ @@ -3034,18 +3051,19 @@ async def apply_rerank_if_enabled( query: The search query retrieved_docs: List of retrieved documents global_config: Global configuration containing rerank settings + enable_rerank: Whether to enable reranking from query parameter top_k: Number of top documents to return after reranking Returns: Reranked documents if rerank is enabled, otherwise original documents """ - if not global_config.get("enable_rerank", False) or not retrieved_docs: + if not enable_rerank or not retrieved_docs: return retrieved_docs rerank_func = global_config.get("rerank_model_func") if not rerank_func: - logger.debug( - "Rerank is enabled but no rerank function provided, skipping rerank" + logger.warning( + "Rerank is enabled but no rerank model is configured. Please set up a rerank model or set enable_rerank=False in query parameters." ) return retrieved_docs @@ -3115,12 +3133,13 @@ async def process_chunks_unified( ) # 2. Apply reranking if enabled and query is provided - if global_config.get("enable_rerank", False) and query and unique_chunks: - rerank_top_k = query_param.chunk_rerank_top_k or len(unique_chunks) + if query_param.enable_rerank and query and unique_chunks: + rerank_top_k = query_param.chunk_top_k or len(unique_chunks) unique_chunks = await apply_rerank_if_enabled( query=query, retrieved_docs=unique_chunks, global_config=global_config, + enable_rerank=query_param.enable_rerank, top_k=rerank_top_k, ) logger.debug(f"Rerank: {len(unique_chunks)} chunks (source: {source_type})") diff --git a/lightrag_webui/src/api/lightrag.ts b/lightrag_webui/src/api/lightrag.ts index 1ecde87b6e65d0ca66a6cb0cc409e0c4c7aca919..a050e1c773b0bb6cae87e5b762c0944576cda22e 100644 --- a/lightrag_webui/src/api/lightrag.ts +++ b/lightrag_webui/src/api/lightrag.ts @@ -106,10 +106,8 @@ export type QueryRequest = { stream?: boolean /** Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode. */ top_k?: number - /** Maximum number of text chunks to retrieve and process. */ + /** Maximum number of text chunks to retrieve and keep after reranking. */ chunk_top_k?: number - /** Number of text chunks to keep after reranking. */ - chunk_rerank_top_k?: number /** Maximum number of tokens allocated for entity context in unified token control system. */ max_entity_tokens?: number /** Maximum number of tokens allocated for relationship context in unified token control system. */ @@ -125,6 +123,8 @@ export type QueryRequest = { history_turns?: number /** User-provided prompt for the query. If provided, this will be used instead of the default value from prompt template. */ user_prompt?: string + /** Enable reranking for retrieved text chunks. If True but no rerank model is configured, a warning will be issued. Default is True. */ + enable_rerank?: boolean } export type QueryResponse = { diff --git a/lightrag_webui/src/components/retrieval/QuerySettings.tsx b/lightrag_webui/src/components/retrieval/QuerySettings.tsx index 909de6a77b08514c6881537be0fbc78af665c126..68651fae17fa5e87735c31f20dafaf00ebc2cbf8 100644 --- a/lightrag_webui/src/components/retrieval/QuerySettings.tsx +++ b/lightrag_webui/src/components/retrieval/QuerySettings.tsx @@ -120,7 +120,6 @@ export default function QuerySettings() {
{t('retrievePanel.querySettings.chunkRerankTopKTooltip')}
+{t('retrievePanel.querySettings.maxEntityTokensTooltip')}
{t('retrievePanel.querySettings.maxEntityTokensTooltip')}
-{t('retrievePanel.querySettings.maxRelationTokensTooltip')}
-{t('retrievePanel.querySettings.maxRelationTokensTooltip')}
+{t('retrievePanel.querySettings.maxTotalTokensTooltip')}
-{t('retrievePanel.querySettings.maxTotalTokensTooltip')}
+{t('retrievePanel.querySettings.enableRerankTooltip')}
+