diff --git a/README-zh.md b/README-zh.md index 34fece4352bb4b18172172577626c43831850d63..45335489537d49c87749f59ddb009694efd1f4de 100644 --- a/README-zh.md +++ b/README-zh.md @@ -90,6 +90,8 @@ LightRAG服务器旨在提供Web UI和API支持。Web UI便于文档索引、知 ```bash pip install "lightrag-hku[api]" +cp env.example .env +lightrag-server ``` * 从源代码安装 @@ -100,6 +102,8 @@ cd LightRAG # 如有必要,创建Python虚拟环境 # 以可编辑模式安装并支持API pip install -e ".[api]" +cp env.example .env +lightrag-server ``` * 使用 Docker Compose 启动 LightRAG 服务器 diff --git a/README.md b/README.md index 1caffef4bb1cdc508d9b0832daa20fdfea455d54..39353ef85c73549c40a1ee73dd365d80788b8cae 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,8 @@ The LightRAG Server is designed to provide Web UI and API support. The Web UI fa ```bash pip install "lightrag-hku[api]" +cp env.example .env +lightrag-server ``` * Installation from Source @@ -99,6 +101,8 @@ cd LightRAG # create a Python virtual enviroment if neccesary # Install in editable mode with API support pip install -e ".[api]" +cp env.example .env +lightrag-server ``` * Launching the LightRAG Server with Docker Compose diff --git a/env.example b/env.example index 4738c8b0435d5fd3f552436c4c606adf4d7e56fc..1efe483095451bded452a3d75eb54ebdb159a008 100644 --- a/env.example +++ b/env.example @@ -1,6 +1,5 @@ ### This is sample file of .env - ### Server Configuration HOST=0.0.0.0 PORT=9621 @@ -51,7 +50,7 @@ OLLAMA_EMULATING_MODEL_TAG=latest # MAX_TOKEN_RELATION_DESC=4000 # MAX_TOKEN_ENTITY_DESC=4000 -### Entity and ralation summarization configuration +### Entity and relation summarization configuration ### Language: English, Chinese, French, German ... SUMMARY_LANGUAGE=English ### Number of duplicated entities/edges to trigger LLM re-summary on merge ( at least 3 is recommented) @@ -111,7 +110,7 @@ EMBEDDING_BINDING_HOST=http://localhost:11434 ########################### ### Data storage selection ########################### -### In-memory database with data persistence to local files +### In-memory database with local file persistence(Recommended for small scale deployment) # LIGHTRAG_KV_STORAGE=JsonKVStorage # LIGHTRAG_DOC_STATUS_STORAGE=JsonDocStatusStorage # LIGHTRAG_GRAPH_STORAGE=NetworkXStorage @@ -122,18 +121,18 @@ EMBEDDING_BINDING_HOST=http://localhost:11434 # LIGHTRAG_DOC_STATUS_STORAGE=PGDocStatusStorage # LIGHTRAG_GRAPH_STORAGE=PGGraphStorage # LIGHTRAG_VECTOR_STORAGE=PGVectorStorage -### MongoDB (recommended for production deploy) +### MongoDB (Vector storage only available on Atlas Cloud) # LIGHTRAG_KV_STORAGE=MongoKVStorage # LIGHTRAG_DOC_STATUS_STORAGE=MongoDocStatusStorage # LIGHTRAG_GRAPH_STORAGE=MongoGraphStorage # LIGHTRAG_VECTOR_STORAGE=MongoVectorDBStorage -### Redis Storage (recommended for production deploy) +### Redis Storage (Recommended for production deployment) # LIGHTRAG_KV_STORAGE=RedisKVStorage # LIGHTRAG_DOC_STATUS_STORAGE=RedisDocStatusStorage -### Vector Storage (recommended for production deploy) +### Vector Storage (Recommended for production deployment) # LIGHTRAG_VECTOR_STORAGE=MilvusVectorDBStorage # LIGHTRAG_VECTOR_STORAGE=QdrantVectorDBStorage -### Graph Storage (recommended for production deploy) +### Graph Storage (Recommended for production deployment) # LIGHTRAG_GRAPH_STORAGE=Neo4JStorage #################################################################### diff --git a/lightrag/api/README-zh.md b/lightrag/api/README-zh.md index 840f83845633865a0e54037b6596f685af90960d..1c33d835a8835b119275f3f5f4ddc107cf885cd5 100644 --- a/lightrag/api/README-zh.md +++ b/lightrag/api/README-zh.md @@ -43,7 +43,7 @@ LightRAG 需要同时集成 LLM(大型语言模型)和嵌入模型以有效 建议使用环境变量来配置 LightRAG 服务器。项目根目录中有一个名为 `env.example` 的示例环境变量文件。请将此文件复制到启动目录并重命名为 `.env`。之后,您可以在 `.env` 文件中修改与 LLM 和嵌入模型相关的参数。需要注意的是,LightRAG 服务器每次启动时都会将 `.env` 中的环境变量加载到系统环境变量中。**LightRAG 服务器会优先使用系统环境变量中的设置**。 -> 由于安装了 Python 扩展的 VS Code 可能会在集成终端中自动加载 .env 文件,请在每次修改 .env 文件后打开新的终端会话。 +> 由于安装了 Python 扩展的 VS Code 可能会在集成终端中自动加载 .env 文件,请在每次修改 .env 文件后打开新的终端会话。 以下是 LLM 和嵌入模型的一些常见设置示例: @@ -94,49 +94,23 @@ lightrag-server ``` lightrag-gunicorn --workers 4 ``` -`.env` 文件必须放在启动目录中。启动时,LightRAG 服务器将创建一个文档目录(默认为 `./inputs`)和一个数据目录(默认为 `./rag_storage`)。这允许您从不同目录启动多个 LightRAG 服务器实例,每个实例配置为监听不同的网络端口。 +启动LightRAG的时候,当前工作目录必须含有`.env`配置文件。**要求将.env文件置于启动目录中是经过特意设计的**。 这样做的目的是支持用户同时启动多个LightRAG实例,并为不同实例配置不同的.env文件。**修改.env文件后,您需要重新打开终端以使新设置生效**。 这是因为每次启动时,LightRAG Server会将.env文件中的环境变量加载至系统环境变量,且系统环境变量的设置具有更高优先级。 -以下是一些常用的启动参数: +启动时可以通过命令行参数覆盖`.env`文件中的配置。常用的命令行参数包括: - `--host`:服务器监听地址(默认:0.0.0.0) - `--port`:服务器监听端口(默认:9621) - `--timeout`:LLM 请求超时时间(默认:150 秒) - `--log-level`:日志级别(默认:INFO) -- --input-dir:指定要扫描文档的目录(默认:./input) - -> - **要求将.env文件置于启动目录中是经过特意设计的**。 这样做的目的是支持用户同时启动多个LightRAG实例,并为不同实例配置不同的.env文件。 -> - **修改.env文件后,您需要重新打开终端以使新设置生效**。 这是因为每次启动时,LightRAG Server会将.env文件中的环境变量加载至系统环境变量,且系统环境变量的设置具有更高优先级。 +- `--working-dir`:数据库持久化目录(默认:./rag_storage) +- `--input-dir`:上传文件存放目录(默认:./inputs) +- `--workspace`: 工作空间名称,用于逻辑上隔离多个LightRAG实例之间的数据(默认:空) ### 使用 Docker 启动 LightRAG 服务器 -* 克隆代码仓库: -```shell -git clone https://github.com/HKUDS/LightRAG.git -cd LightRAG -``` - * 配置 .env 文件: 通过复制示例文件 [`env.example`](env.example) 创建个性化的 .env 文件,并根据实际需求设置 LLM 及 Embedding 参数。 - -* 通过以下命令启动 LightRAG 服务器: -```shell -docker compose up -# 如拉取了新版本,请添加 --build 重新构建 -docker compose up --build -``` -### 无需克隆代码而使用 Docker 部署 LightRAG 服务器 - -* 为 LightRAG 服务器创建工作文件夹: - -```shell -mkdir lightrag -cd lightrag -``` - -* 准备 .env 文件: - 通过复制 env.example 文件创建个性化的.env 文件。根据您的需求配置 LLM 和嵌入参数。 - -* 创建一个名为 docker-compose.yml 的 docker compose 文件: +* 创建一个名为 docker-compose.yml 的文件: ```yaml services: @@ -157,26 +131,56 @@ services: - "host.docker.internal:host-gateway" ``` -* 准备 .env 文件: - 通过复制示例文件 [`env.example`](env.example) 创建个性化的 .env 文件。根据您的需求配置 LLM 和嵌入参数。 +* 通过以下命令启动 LightRAG 服务器: -* 使用以下命令启动 LightRAG 服务器: ```shell docker compose up +# 如果希望启动后让程序退到后台运行,需要在命令的最后添加 -d 参数 ``` - -> 在此获取LightRAG docker镜像历史版本: [LightRAG Docker Images]( https://github.com/HKUDS/LightRAG/pkgs/container/lightrag) +> 可以通过以下链接获取官方的docker compose文件:[docker-compose.yml]( https://raw.githubusercontent.com/HKUDS/LightRAG/refs/heads/main/docker-compose.yml) 。如需获取LightRAG的历史版本镜像,可以访问以下链接: [LightRAG Docker Images]( https://github.com/HKUDS/LightRAG/pkgs/container/lightrag) ### 启动时自动扫描 -当使用 `--auto-scan-at-startup` 参数启动任何服务器时,系统将自动: +当使用 `--auto-scan-at-startup` 参数启动LightRAG Server时,系统将自动: 1. 扫描输入目录中的新文件 2. 为尚未在数据库中的新文档建立索引 3. 使所有内容立即可用于 RAG 查询 +这种工作模式给启动一个临时的RAG任务提供给了方便。 + > `--input-dir` 参数指定要扫描的输入目录。您可以从 webui 触发输入目录扫描。 +### 启动多个LightRAG实例 + +有两种方式可以启动多个LightRAG实例。第一种方式是为每个实例配置一个完全独立的工作环境。此时需要为每个实例创建一个独立的工作目录,然后在这个工作目录上放置一个当前实例专用的`.env`配置文件。不同实例的配置文件中的服务器监听端口不能重复,然后在工作目录上执行 lightrag-server 启动服务即可。 + +第二种方式是所有实例共享一套相同的`.env`配置文件,然后通过命令行参数来为每个实例指定不同的服务器监听端口和工作空间。你可以在同一个工作目录中通过不同的命令行参数启动多个LightRAG实例。例如: + +``` +# 启动实例1 +lightrag-server --port 9621 --workspace space1 + +# 启动实例2 +lightrag-server --port 9622 --workspace space2 +``` + +工作空间的作用是实现不同实例之间的数据隔离。因此不同实例之间的`workspace`参数必须不同,否则会导致数据混乱,数据将会被破坏。 + +### LightRAG实例间的数据隔离 + +每个实例配置一个独立的工作目录和专用`.env`配置文件通常能够保证内存数据库中的本地持久化文件保存在各自的工作目录,实现数据的相互隔离。LightRAG默认存储全部都是内存数据库,通过这种方式进行数据隔离是没有问题的。但是如果使用的是外部数据库,如果不同实例访问的是同一个数据库实例,就需要通过配置工作空间来实现数据隔离,否则不同实例的数据将会出现冲突并被破坏。 + +命令行的 workspace 参数和`.env`文件中的环境变量`WORKSPACE` 都可以用于指定当前实例的工作空间名字,命令行参数的优先级别更高。下面是不同类型的存储实现工作空间的方式: + +- **对于本地基于文件的数据库,数据隔离通过工作空间子目录实现:** JsonKVStorage, JsonDocStatusStorage, NetworkXStorage, NanoVectorDBStorage, FaissVectorDBStorage。 +- **对于将数据存储在集合(collection)中的数据库,通过在集合名称前添加工作空间前缀来实现:** RedisKVStorage, RedisDocStatusStorage, MilvusVectorDBStorage, QdrantVectorDBStorage, MongoKVStorage, MongoDocStatusStorage, MongoVectorDBStorage, MongoGraphStorage, PGGraphStorage。 +- **对于关系型数据库,数据隔离通过向表中添加 `workspace` 字段进行数据的逻辑隔离:** PGKVStorage, PGVectorStorage, PGDocStatusStorage。 + +* **对于Neo4j图数据库,通过label来实现数据的逻辑隔离**:Neo4JStorage + +为了保持对遗留数据的兼容,在未配置工作空间时PostgreSQL的默认工作空间为`default`,Neo4j的默认工作空间为`base`。对于所有的外部存储,系统都提供了专用的工作空间环境变量,用于覆盖公共的 `WORKSPACE`环境变量配置。这些适用于指定存储类型的工作空间环境变量为:`REDIS_WORKSPACE`, `MILVUS_WORKSPACE`, `QDRANT_WORKSPACE`, `MONGODB_WORKSPACE`, `POSTGRES_WORKSPACE`, `NEO4J_WORKSPACE`。 + ### Gunicorn + Uvicorn 的多工作进程 LightRAG 服务器可以在 `Gunicorn + Uvicorn` 预加载模式下运行。Gunicorn 的多工作进程(多进程)功能可以防止文档索引任务阻塞 RAG 查询。使用 CPU 密集型文档提取工具(如 docling)在纯 Uvicorn 模式下可能会导致整个系统被阻塞。 diff --git a/lightrag/api/README.md b/lightrag/api/README.md index 4d3ec30982a66b80a570464e17e32ef508dba0cf..915ad7f3f5a495574ecb611ba4d6c52d69b1c6b1 100644 --- a/lightrag/api/README.md +++ b/lightrag/api/README.md @@ -94,50 +94,25 @@ lightrag-server ``` lightrag-gunicorn --workers 4 ``` -The `.env` file **must be placed in the startup directory**. -Upon launching, the LightRAG Server will create a documents directory (default is `./inputs`) and a data directory (default is `./rag_storage`). This allows you to initiate multiple instances of LightRAG Server from different directories, with each instance configured to listen on a distinct network port. +When starting LightRAG, the current working directory must contain the `.env` configuration file. **It is intentionally designed that the `.env` file must be placed in the startup directory**. The purpose of this is to allow users to launch multiple LightRAG instances simultaneously and configure different `.env` files for different instances. **After modifying the `.env` file, you need to reopen the terminal for the new settings to take effect.** This is because each time LightRAG Server starts, it loads the environment variables from the `.env` file into the system environment variables, and system environment variables have higher precedence. -Here are some commonly used startup parameters: +During startup, configurations in the `.env` file can be overridden by command-line parameters. Common command-line parameters include: - `--host`: Server listening address (default: 0.0.0.0) - `--port`: Server listening port (default: 9621) - `--timeout`: LLM request timeout (default: 150 seconds) -- `--log-level`: Logging level (default: INFO) -- `--input-dir`: Specifying the directory to scan for documents (default: ./inputs) - -> - The requirement for the .env file to be in the startup directory is intentionally designed this way. The purpose is to support users in launching multiple LightRAG instances simultaneously, allowing different .env files for different instances. -> - **After changing the .env file, you need to open a new terminal to make the new settings take effect.** This because the LightRAG Server will load the environment variables from .env into the system environment variables each time it starts, and LightRAG Server will prioritize the settings in the system environment variables. +- `--log-level`: Log level (default: INFO) +- `--working-dir`: Database persistence directory (default: ./rag_storage) +- `--input-dir`: Directory for uploaded files (default: ./inputs) +- `--workspace`: Workspace name, used to logically isolate data between multiple LightRAG instances (default: empty) ### Launching LightRAG Server with Docker -* Clone the repository: -```shell -git clone https://github.com/HKUDS/LightRAG.git -cd LightRAG -``` - * Prepare the .env file: - Create a personalized .env file from sample file `env.example`. Configure the LLM and embedding parameters according to your requirements. - -* Start the LightRAG Server using the following commands: -```shell -docker compose up -# Use --build if you have pulled a new version -docker compose up --build -``` - -### Deploying LightRAG Server with docker without cloneing the repository - -* Create a working folder for LightRAG Server: - -```shell -mkdir lightrag -cd lightrag -``` - -* Create a docker compose file named docker-compose.yml: + Create a personalized .env file by copying the sample file [`env.example`](env.example). Configure the LLM and embedding parameters according to your requirements. +* Create a file named `docker-compose.yml`: ```yaml services: @@ -157,26 +132,57 @@ services: extra_hosts: - "host.docker.internal:host-gateway" ``` -* Prepare the .env file: - Create a personalized .env file from sample file `env.example`. Configure the LLM and embedding parameters according to your requirements. -* Start the LightRAG Server using the following commands: +* Start the LightRAG Server with the following command: + ```shell docker compose up +# If you want the program to run in the background after startup, add the -d parameter at the end of the command. ``` -> Historical versions of LightRAG docker images can be found here: [LightRAG Docker Images]( https://github.com/HKUDS/LightRAG/pkgs/container/lightrag) +> You can get the official docker compose file from here: [docker-compose.yml](https://raw.githubusercontent.com/HKUDS/LightRAG/refs/heads/main/docker-compose.yml). For historical versions of LightRAG docker images, visit this link: [LightRAG Docker Images](https://github.com/HKUDS/LightRAG/pkgs/container/lightrag) ### Auto scan on startup -When starting any of the servers with the `--auto-scan-at-startup` parameter, the system will automatically: +When starting the LightRAG Server with the `--auto-scan-at-startup` parameter, the system will automatically: 1. Scan for new files in the input directory 2. Index new documents that aren't already in the database 3. Make all content immediately available for RAG queries +This offers an efficient method for deploying ad-hoc RAG processes. + > The `--input-dir` parameter specifies the input directory to scan. You can trigger the input directory scan from the Web UI. +### Starting Multiple LightRAG Instances + +There are two ways to start multiple LightRAG instances. The first way is to configure a completely independent working environment for each instance. This requires creating a separate working directory for each instance and placing a dedicated `.env` configuration file in that directory. The server listening ports in the configuration files of different instances cannot be the same. Then, you can start the service by running `lightrag-server` in the working directory. + +The second way is for all instances to share the same set of `.env` configuration files, and then use command-line arguments to specify different server listening ports and workspaces for each instance. You can start multiple LightRAG instances in the same working directory with different command-line arguments. For example: + +``` +# Start instance 1 +lightrag-server --port 9621 --workspace space1 + +# Start instance 2 +lightrag-server --port 9622 --workspace space2 +``` + +The purpose of a workspace is to achieve data isolation between different instances. Therefore, the `workspace` parameter must be different for different instances; otherwise, it will lead to data confusion and corruption. + +### Data Isolation Between LightRAG Instances + +Configuring an independent working directory and a dedicated `.env` configuration file for each instance can generally ensure that locally persisted files in the in-memory database are saved in their respective working directories, achieving data isolation. By default, LightRAG uses all in-memory databases, and this method of data isolation is sufficient. However, if you are using an external database, and different instances access the same database instance, you need to use workspaces to achieve data isolation; otherwise, the data of different instances will conflict and be destroyed. + +The command-line `workspace` argument and the `WORKSPACE` environment variable in the `.env` file can both be used to specify the workspace name for the current instance, with the command-line argument having higher priority. Here is how workspaces are implemented for different types of storage: + +- **For local file-based databases, data isolation is achieved through workspace subdirectories:** `JsonKVStorage`, `JsonDocStatusStorage`, `NetworkXStorage`, `NanoVectorDBStorage`, `FaissVectorDBStorage`. +- **For databases that store data in collections, it's done by adding a workspace prefix to the collection name:** `RedisKVStorage`, `RedisDocStatusStorage`, `MilvusVectorDBStorage`, `QdrantVectorDBStorage`, `MongoKVStorage`, `MongoDocStatusStorage`, `MongoVectorDBStorage`, `MongoGraphStorage`, `PGGraphStorage`. +- **For relational databases, data isolation is achieved by adding a `workspace` field to the tables for logical data separation:** `PGKVStorage`, `PGVectorStorage`, `PGDocStatusStorage`. +- **For the Neo4j graph database, logical data isolation is achieved through labels:** `Neo4JStorage` + +To maintain compatibility with legacy data, the default workspace for PostgreSQL is `default` and for Neo4j is `base` when no workspace is configured. For all external storages, the system provides dedicated workspace environment variables to override the common `WORKSPACE` environment variable configuration. These storage-specific workspace environment variables are: `REDIS_WORKSPACE`, `MILVUS_WORKSPACE`, `QDRANT_WORKSPACE`, `MONGODB_WORKSPACE`, `POSTGRES_WORKSPACE`, `NEO4J_WORKSPACE`. + ### Multiple workers for Gunicorn + Uvicorn The LightRAG Server can operate in the `Gunicorn + Uvicorn` preload mode. Gunicorn's multiple worker (multiprocess) capability prevents document indexing tasks from blocking RAG queries. Using CPU-exhaustive document extraction tools, such as docling, can lead to the entire system being blocked in pure Uvicorn mode. diff --git a/lightrag/api/__init__.py b/lightrag/api/__init__.py index 5904b8a9aeee983d6011eed72063f9cbb98b9e92..7a52ac827e6645d37a9aacbdf221f249ab8c8463 100644 --- a/lightrag/api/__init__.py +++ b/lightrag/api/__init__.py @@ -1 +1 @@ -__api_version__ = "0179" +__api_version__ = "0180" diff --git a/lightrag/api/config.py b/lightrag/api/config.py index 2e15fd3a4da871b7ce8866ecf5b071944b25c8ac..ad0e670bdac67e1a4ac151f86cab49f93b68fd85 100644 --- a/lightrag/api/config.py +++ b/lightrag/api/config.py @@ -244,6 +244,9 @@ def parse_args() -> argparse.Namespace: # Get MAX_PARALLEL_INSERT from environment args.max_parallel_insert = get_env_value("MAX_PARALLEL_INSERT", 2, int) + # Get MAX_GRAPH_NODES from environment + args.max_graph_nodes = get_env_value("MAX_GRAPH_NODES", 1000, int) + # Handle openai-ollama special case if args.llm_binding == "openai-ollama": args.llm_binding = "openai" diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index 7a34ab5c4e50d248830479113c8bf3900e9775e2..cd87af22f4c4079548daa5eac1b4d1bcbdd464bf 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -326,6 +326,7 @@ def create_app(args): enable_llm_cache=args.enable_llm_cache, auto_manage_storages_states=False, max_parallel_insert=args.max_parallel_insert, + max_graph_nodes=args.max_graph_nodes, addon_params={"language": args.summary_language}, ) else: # azure_openai @@ -353,6 +354,7 @@ def create_app(args): enable_llm_cache=args.enable_llm_cache, auto_manage_storages_states=False, max_parallel_insert=args.max_parallel_insert, + max_graph_nodes=args.max_graph_nodes, addon_params={"language": args.summary_language}, ) @@ -475,7 +477,7 @@ def create_app(args): "enable_llm_cache_for_extract": args.enable_llm_cache_for_extract, "enable_llm_cache": args.enable_llm_cache, "workspace": args.workspace, - "max_graph_nodes": os.getenv("MAX_GRAPH_NODES"), + "max_graph_nodes": args.max_graph_nodes, }, "auth_mode": auth_mode, "pipeline_busy": pipeline_status.get("busy", False), diff --git a/lightrag/api/utils_api.py b/lightrag/api/utils_api.py index e55e2a111d7f0c5811ae4f24299fa579b5d50296..a724069dbe67eda7661614298d26ba57ca25982e 100644 --- a/lightrag/api/utils_api.py +++ b/lightrag/api/utils_api.py @@ -175,12 +175,24 @@ def display_splash_screen(args: argparse.Namespace) -> None: args: Parsed command line arguments """ # Banner - ASCIIColors.cyan(f""" - ╔══════════════════════════════════════════════════════════════╗ - ║ 🚀 LightRAG Server v{core_version}/{api_version} ║ - ║ Fast, Lightweight RAG Server Implementation ║ - ╚══════════════════════════════════════════════════════════════╝ - """) + # Banner + top_border = "╔══════════════════════════════════════════════════════════════╗" + bottom_border = "╚══════════════════════════════════════════════════════════════╝" + width = len(top_border) - 4 # width inside the borders + + line1_text = f"LightRAG Server v{core_version}/{api_version}" + line2_text = "Fast, Lightweight RAG Server Implementation" + + line1 = f"║ {line1_text.center(width)} ║" + line2 = f"║ {line2_text.center(width)} ║" + + banner = f""" + {top_border} + {line1} + {line2} + {bottom_border} + """ + ASCIIColors.cyan(banner) # Server Configuration ASCIIColors.magenta("\n📡 Server Configuration:") diff --git a/lightrag/api/webui/assets/_basePickBy-BSdLglB8.js b/lightrag/api/webui/assets/_basePickBy-BVZSZRdU.js similarity index 95% rename from lightrag/api/webui/assets/_basePickBy-BSdLglB8.js rename to lightrag/api/webui/assets/_basePickBy-BVZSZRdU.js index 82e45b0d5a67aa8ec23bb1edea16daf5792507b5..16c3a2a61542c8b11439554abc8aa46fc6847532 100644 Binary files a/lightrag/api/webui/assets/_basePickBy-BSdLglB8.js and b/lightrag/api/webui/assets/_basePickBy-BVZSZRdU.js differ diff --git a/lightrag/api/webui/assets/_baseUniq-UvGlUd6J.js b/lightrag/api/webui/assets/_baseUniq-CoKY6BVy.js similarity index 98% rename from lightrag/api/webui/assets/_baseUniq-UvGlUd6J.js rename to lightrag/api/webui/assets/_baseUniq-CoKY6BVy.js index a93129c9504ffa701135205951b065b3eec3559f..1378c5cdc6c064d38211bdaf4d38ee447818e72b 100644 Binary files a/lightrag/api/webui/assets/_baseUniq-UvGlUd6J.js and b/lightrag/api/webui/assets/_baseUniq-CoKY6BVy.js differ diff --git a/lightrag/api/webui/assets/architectureDiagram-IEHRJDOE-BniHOq-e.js b/lightrag/api/webui/assets/architectureDiagram-IEHRJDOE-vef8RqWB.js similarity index 99% rename from lightrag/api/webui/assets/architectureDiagram-IEHRJDOE-BniHOq-e.js rename to lightrag/api/webui/assets/architectureDiagram-IEHRJDOE-vef8RqWB.js index d25c1526b080de75d28eabea4f556fe95e40f818..e1202dbb8a961fb615cebc1360c3adbd4707e777 100644 Binary files a/lightrag/api/webui/assets/architectureDiagram-IEHRJDOE-BniHOq-e.js and b/lightrag/api/webui/assets/architectureDiagram-IEHRJDOE-vef8RqWB.js differ diff --git a/lightrag/api/webui/assets/blockDiagram-JOT3LUYC-DIN2mi-0.js b/lightrag/api/webui/assets/blockDiagram-JOT3LUYC-CbrB0eRz.js similarity index 99% rename from lightrag/api/webui/assets/blockDiagram-JOT3LUYC-DIN2mi-0.js rename to lightrag/api/webui/assets/blockDiagram-JOT3LUYC-CbrB0eRz.js index 84f64223f7e8aab756f2624b21ac397a80be2918..29588baaa3532503cec73933ce60b61d145c7813 100644 Binary files a/lightrag/api/webui/assets/blockDiagram-JOT3LUYC-DIN2mi-0.js and b/lightrag/api/webui/assets/blockDiagram-JOT3LUYC-CbrB0eRz.js differ diff --git a/lightrag/api/webui/assets/c4Diagram-VJAJSXHY-BJN20C_B.js b/lightrag/api/webui/assets/c4Diagram-VJAJSXHY-1eEG1RbS.js similarity index 99% rename from lightrag/api/webui/assets/c4Diagram-VJAJSXHY-BJN20C_B.js rename to lightrag/api/webui/assets/c4Diagram-VJAJSXHY-1eEG1RbS.js index 1bff779a978d17c32f4935d48cccfdf56e810f24..4a0a194ebf818a7ee8aee5dceb8b7df6d4e51bb3 100644 Binary files a/lightrag/api/webui/assets/c4Diagram-VJAJSXHY-BJN20C_B.js and b/lightrag/api/webui/assets/c4Diagram-VJAJSXHY-1eEG1RbS.js differ diff --git a/lightrag/api/webui/assets/chunk-4BMEZGHF-B1TxGISA.js b/lightrag/api/webui/assets/chunk-4BMEZGHF-BqribV_z.js similarity index 78% rename from lightrag/api/webui/assets/chunk-4BMEZGHF-B1TxGISA.js rename to lightrag/api/webui/assets/chunk-4BMEZGHF-BqribV_z.js index 34e3ccb13daee3b962a0fc719f88515bc3a001e7..a74d0312ace7b227fd13c9d69cf624326cacf70c 100644 Binary files a/lightrag/api/webui/assets/chunk-4BMEZGHF-B1TxGISA.js and b/lightrag/api/webui/assets/chunk-4BMEZGHF-BqribV_z.js differ diff --git a/lightrag/api/webui/assets/chunk-A2AXSNBT-9BBpDWtu.js b/lightrag/api/webui/assets/chunk-A2AXSNBT-79sAOFxS.js similarity index 99% rename from lightrag/api/webui/assets/chunk-A2AXSNBT-9BBpDWtu.js rename to lightrag/api/webui/assets/chunk-A2AXSNBT-79sAOFxS.js index e5d752b2de33005c0a44659b58647aef19923fc3..d5c1d3847f25bb5430fe58c48f51773c92a5f950 100644 Binary files a/lightrag/api/webui/assets/chunk-A2AXSNBT-9BBpDWtu.js and b/lightrag/api/webui/assets/chunk-A2AXSNBT-79sAOFxS.js differ diff --git a/lightrag/api/webui/assets/chunk-AEK57VVT-CXtM_4Od.js b/lightrag/api/webui/assets/chunk-AEK57VVT-C_8ebDHI.js similarity index 99% rename from lightrag/api/webui/assets/chunk-AEK57VVT-CXtM_4Od.js rename to lightrag/api/webui/assets/chunk-AEK57VVT-C_8ebDHI.js index ffced50b8521aada9ffe224ce12603722eed0a9e..8b62e3518e1e18798b8dfb18f5a9319604d4aaef 100644 Binary files a/lightrag/api/webui/assets/chunk-AEK57VVT-CXtM_4Od.js and b/lightrag/api/webui/assets/chunk-AEK57VVT-C_8ebDHI.js differ diff --git a/lightrag/api/webui/assets/chunk-D6G4REZN-CxUcE0YF.js b/lightrag/api/webui/assets/chunk-D6G4REZN-DYSFhgH1.js similarity index 95% rename from lightrag/api/webui/assets/chunk-D6G4REZN-CxUcE0YF.js rename to lightrag/api/webui/assets/chunk-D6G4REZN-DYSFhgH1.js index 2a6304cacb7c17f6ef56c72f39ae90f27c7f31f1..95004ab2cc15be9e225527e7b1eca448d3064271 100644 Binary files a/lightrag/api/webui/assets/chunk-D6G4REZN-CxUcE0YF.js and b/lightrag/api/webui/assets/chunk-D6G4REZN-DYSFhgH1.js differ diff --git a/lightrag/api/webui/assets/chunk-RZ5BOZE2-Du3GUvfy.js b/lightrag/api/webui/assets/chunk-RZ5BOZE2-PbmQbmec.js similarity index 81% rename from lightrag/api/webui/assets/chunk-RZ5BOZE2-Du3GUvfy.js rename to lightrag/api/webui/assets/chunk-RZ5BOZE2-PbmQbmec.js index c87a9bd242f5c47ee61a0402a58d573eeb93e073..a9cd68174ff2a59e2e96fe0c3573d2ad6b65da8d 100644 Binary files a/lightrag/api/webui/assets/chunk-RZ5BOZE2-Du3GUvfy.js and b/lightrag/api/webui/assets/chunk-RZ5BOZE2-PbmQbmec.js differ diff --git a/lightrag/api/webui/assets/chunk-XZIHB7SX-HOIwmCiB.js b/lightrag/api/webui/assets/chunk-XZIHB7SX-UCc0agNy.js similarity index 67% rename from lightrag/api/webui/assets/chunk-XZIHB7SX-HOIwmCiB.js rename to lightrag/api/webui/assets/chunk-XZIHB7SX-UCc0agNy.js index 7062482254815dbd68024e4d3529764b8a53091f..db7265e9ae62fd41aa0f45ef1345492107434382 100644 Binary files a/lightrag/api/webui/assets/chunk-XZIHB7SX-HOIwmCiB.js and b/lightrag/api/webui/assets/chunk-XZIHB7SX-UCc0agNy.js differ diff --git a/lightrag/api/webui/assets/classDiagram-GIVACNV2-f9sRw-GR.js b/lightrag/api/webui/assets/classDiagram-GIVACNV2-CtQONuGk.js similarity index 61% rename from lightrag/api/webui/assets/classDiagram-GIVACNV2-f9sRw-GR.js rename to lightrag/api/webui/assets/classDiagram-GIVACNV2-CtQONuGk.js index b335b4d5f992057b57ae7d2939904d5fa5c6fffc..8c8238eac7191c0b0223674f65bab0a36d87d394 100644 Binary files a/lightrag/api/webui/assets/classDiagram-GIVACNV2-f9sRw-GR.js and b/lightrag/api/webui/assets/classDiagram-GIVACNV2-CtQONuGk.js differ diff --git a/lightrag/api/webui/assets/classDiagram-v2-COTLJTTW-f9sRw-GR.js b/lightrag/api/webui/assets/classDiagram-v2-COTLJTTW-CtQONuGk.js similarity index 61% rename from lightrag/api/webui/assets/classDiagram-v2-COTLJTTW-f9sRw-GR.js rename to lightrag/api/webui/assets/classDiagram-v2-COTLJTTW-CtQONuGk.js index b335b4d5f992057b57ae7d2939904d5fa5c6fffc..8c8238eac7191c0b0223674f65bab0a36d87d394 100644 Binary files a/lightrag/api/webui/assets/classDiagram-v2-COTLJTTW-f9sRw-GR.js and b/lightrag/api/webui/assets/classDiagram-v2-COTLJTTW-CtQONuGk.js differ diff --git a/lightrag/api/webui/assets/clone-JfI4KmSh.js b/lightrag/api/webui/assets/clone-JfI4KmSh.js deleted file mode 100644 index 68f1c746dc4bc5189eabd31d633c9179d413781b..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/clone-JfI4KmSh.js and /dev/null differ diff --git a/lightrag/api/webui/assets/clone-UTZGcTvC.js b/lightrag/api/webui/assets/clone-UTZGcTvC.js new file mode 100644 index 0000000000000000000000000000000000000000..9e8db024cf58cdb27def748a31e92da56eb03205 Binary files /dev/null and b/lightrag/api/webui/assets/clone-UTZGcTvC.js differ diff --git a/lightrag/api/webui/assets/dagre-OKDRZEBW-BfLyJCXh.js b/lightrag/api/webui/assets/dagre-OKDRZEBW-B2QKcgt1.js similarity index 97% rename from lightrag/api/webui/assets/dagre-OKDRZEBW-BfLyJCXh.js rename to lightrag/api/webui/assets/dagre-OKDRZEBW-B2QKcgt1.js index cf95c7bcfc42e2caf67baab20b23a3b8879cc91e..882945118ec0da6b4e7deb23ba17472d6a617844 100644 Binary files a/lightrag/api/webui/assets/dagre-OKDRZEBW-BfLyJCXh.js and b/lightrag/api/webui/assets/dagre-OKDRZEBW-B2QKcgt1.js differ diff --git a/lightrag/api/webui/assets/diagram-SSKATNLV-BPBm_HA_.js b/lightrag/api/webui/assets/diagram-SSKATNLV-C9gAoCDH.js similarity index 93% rename from lightrag/api/webui/assets/diagram-SSKATNLV-BPBm_HA_.js rename to lightrag/api/webui/assets/diagram-SSKATNLV-C9gAoCDH.js index caf246c631f0a34af680672346a061b99cfc4d65..e9d1b64d25f7467311f50552211dc91013febdd5 100644 Binary files a/lightrag/api/webui/assets/diagram-SSKATNLV-BPBm_HA_.js and b/lightrag/api/webui/assets/diagram-SSKATNLV-C9gAoCDH.js differ diff --git a/lightrag/api/webui/assets/diagram-VNBRO52H-B3H-hAHN.js b/lightrag/api/webui/assets/diagram-VNBRO52H-YHo3tP1S.js similarity index 90% rename from lightrag/api/webui/assets/diagram-VNBRO52H-B3H-hAHN.js rename to lightrag/api/webui/assets/diagram-VNBRO52H-YHo3tP1S.js index 29c6300e6b9c09b861d7df5e2df12a2fba2a444c..a3e66eb7b1dbdf507f0a5c0f0dce6e520f2edc3b 100644 Binary files a/lightrag/api/webui/assets/diagram-VNBRO52H-B3H-hAHN.js and b/lightrag/api/webui/assets/diagram-VNBRO52H-YHo3tP1S.js differ diff --git a/lightrag/api/webui/assets/erDiagram-Q7BY3M3F-B0M4Dgpb.js b/lightrag/api/webui/assets/erDiagram-Q7BY3M3F-BZdHFlc9.js similarity index 99% rename from lightrag/api/webui/assets/erDiagram-Q7BY3M3F-B0M4Dgpb.js rename to lightrag/api/webui/assets/erDiagram-Q7BY3M3F-BZdHFlc9.js index eb98a356d2909e5e3b2e2749c901770e1a24d1e2..1b255041c8ad831be3abbe4f92b8398cbee01853 100644 Binary files a/lightrag/api/webui/assets/erDiagram-Q7BY3M3F-B0M4Dgpb.js and b/lightrag/api/webui/assets/erDiagram-Q7BY3M3F-BZdHFlc9.js differ diff --git a/lightrag/api/webui/assets/feature-documents-DYAipKCP.js b/lightrag/api/webui/assets/feature-documents-CSExwz2a.js similarity index 99% rename from lightrag/api/webui/assets/feature-documents-DYAipKCP.js rename to lightrag/api/webui/assets/feature-documents-CSExwz2a.js index 2739291dfa60eb14969fa3be2fe48d1ec7edc2df..3b5563f0dc2915780a64842d4bc97a3f6aed5874 100644 Binary files a/lightrag/api/webui/assets/feature-documents-DYAipKCP.js and b/lightrag/api/webui/assets/feature-documents-CSExwz2a.js differ diff --git a/lightrag/api/webui/assets/feature-graph-D-mwOi0p.js b/lightrag/api/webui/assets/feature-graph-D-mwOi0p.js new file mode 100644 index 0000000000000000000000000000000000000000..e11568773fc8c90f8e677d500d838f25a6c8434b Binary files /dev/null and b/lightrag/api/webui/assets/feature-graph-D-mwOi0p.js differ diff --git a/lightrag/api/webui/assets/feature-graph-yCDRht5b.js b/lightrag/api/webui/assets/feature-graph-yCDRht5b.js deleted file mode 100644 index c687afd64233d44cc27ba444ef12b1629768e57c..0000000000000000000000000000000000000000 Binary files a/lightrag/api/webui/assets/feature-graph-yCDRht5b.js and /dev/null differ diff --git a/lightrag/api/webui/assets/feature-retrieval-DRE_iZah.js b/lightrag/api/webui/assets/feature-retrieval-BhEQ7fz5.js similarity index 99% rename from lightrag/api/webui/assets/feature-retrieval-DRE_iZah.js rename to lightrag/api/webui/assets/feature-retrieval-BhEQ7fz5.js index b7fc4eda2aa6e03e653e255dd352bdd04a393d70..a9edd19e8b420e1a97d2caa95b56cdba2c199788 100644 Binary files a/lightrag/api/webui/assets/feature-retrieval-DRE_iZah.js and b/lightrag/api/webui/assets/feature-retrieval-BhEQ7fz5.js differ diff --git a/lightrag/api/webui/assets/flowDiagram-4HSFHLVR-0O9i7rCc.js b/lightrag/api/webui/assets/flowDiagram-4HSFHLVR-Cyoqee_Z.js similarity index 99% rename from lightrag/api/webui/assets/flowDiagram-4HSFHLVR-0O9i7rCc.js rename to lightrag/api/webui/assets/flowDiagram-4HSFHLVR-Cyoqee_Z.js index c93ec36f69dd8b1b8bfc3d17832f495e2b8f681b..106d00c9775bfb39a29fd4735c1379635e8ff473 100644 Binary files a/lightrag/api/webui/assets/flowDiagram-4HSFHLVR-0O9i7rCc.js and b/lightrag/api/webui/assets/flowDiagram-4HSFHLVR-Cyoqee_Z.js differ diff --git a/lightrag/api/webui/assets/ganttDiagram-APWFNJXF-r6T2Qk9A.js b/lightrag/api/webui/assets/ganttDiagram-APWFNJXF-8xxuNmi-.js similarity index 99% rename from lightrag/api/webui/assets/ganttDiagram-APWFNJXF-r6T2Qk9A.js rename to lightrag/api/webui/assets/ganttDiagram-APWFNJXF-8xxuNmi-.js index 33767b82e5661fa1bfd898e02df95f4796546ee1..b042010c1c76aacc9294870e735ee0980b062a7d 100644 Binary files a/lightrag/api/webui/assets/ganttDiagram-APWFNJXF-r6T2Qk9A.js and b/lightrag/api/webui/assets/ganttDiagram-APWFNJXF-8xxuNmi-.js differ diff --git a/lightrag/api/webui/assets/gitGraphDiagram-7IBYFJ6S-Bu88rIEh.js b/lightrag/api/webui/assets/gitGraphDiagram-7IBYFJ6S-C00chpNw.js similarity index 98% rename from lightrag/api/webui/assets/gitGraphDiagram-7IBYFJ6S-Bu88rIEh.js rename to lightrag/api/webui/assets/gitGraphDiagram-7IBYFJ6S-C00chpNw.js index b8b1d28d586cdaa7bbd26c9d7f065e7b9d240bac..2b32a678c599f96d0c5ff7e8b43c329662390dc3 100644 Binary files a/lightrag/api/webui/assets/gitGraphDiagram-7IBYFJ6S-Bu88rIEh.js and b/lightrag/api/webui/assets/gitGraphDiagram-7IBYFJ6S-C00chpNw.js differ diff --git a/lightrag/api/webui/assets/graph-BA-Xpc80.js b/lightrag/api/webui/assets/graph-gg_UPtwE.js similarity index 97% rename from lightrag/api/webui/assets/graph-BA-Xpc80.js rename to lightrag/api/webui/assets/graph-gg_UPtwE.js index 5337dca6b9b9b0be08f2deaa3484e50bc8598da8..43f325ff48828f4777d37e231e058a7906b4d00d 100644 Binary files a/lightrag/api/webui/assets/graph-BA-Xpc80.js and b/lightrag/api/webui/assets/graph-gg_UPtwE.js differ diff --git a/lightrag/api/webui/assets/index-BlAjHenV.js b/lightrag/api/webui/assets/index-CZQXgxUO.js similarity index 99% rename from lightrag/api/webui/assets/index-BlAjHenV.js rename to lightrag/api/webui/assets/index-CZQXgxUO.js index cee1a59cf48ddc5395bb061022d64b37f553dd62..9ebb2e9c8b5a937f3ab356e107afebc03448daf9 100644 Binary files a/lightrag/api/webui/assets/index-BlAjHenV.js and b/lightrag/api/webui/assets/index-CZQXgxUO.js differ diff --git a/lightrag/api/webui/assets/infoDiagram-PH2N3AL5-Ccvh5jh9.js b/lightrag/api/webui/assets/infoDiagram-PH2N3AL5-DKUJQA1J.js similarity index 61% rename from lightrag/api/webui/assets/infoDiagram-PH2N3AL5-Ccvh5jh9.js rename to lightrag/api/webui/assets/infoDiagram-PH2N3AL5-DKUJQA1J.js index e9fe825fdf7fe09f2b0f5025bf681afd85223580..1c1c8eab0c8937e7afb68fa773c1496622020bdc 100644 Binary files a/lightrag/api/webui/assets/infoDiagram-PH2N3AL5-Ccvh5jh9.js and b/lightrag/api/webui/assets/infoDiagram-PH2N3AL5-DKUJQA1J.js differ diff --git a/lightrag/api/webui/assets/journeyDiagram-U35MCT3I-Bjko5wAq.js b/lightrag/api/webui/assets/journeyDiagram-U35MCT3I-C9ZzbUpH.js similarity index 99% rename from lightrag/api/webui/assets/journeyDiagram-U35MCT3I-Bjko5wAq.js rename to lightrag/api/webui/assets/journeyDiagram-U35MCT3I-C9ZzbUpH.js index ce09e62d3e3d563ecc763032a2271fa128f2a3f5..8d5cbd3bfedee8660907434f17e662b5db79d86a 100644 Binary files a/lightrag/api/webui/assets/journeyDiagram-U35MCT3I-Bjko5wAq.js and b/lightrag/api/webui/assets/journeyDiagram-U35MCT3I-C9ZzbUpH.js differ diff --git a/lightrag/api/webui/assets/kanban-definition-NDS4AKOZ-CI4n-C9D.js b/lightrag/api/webui/assets/kanban-definition-NDS4AKOZ-BMGhZtt7.js similarity index 99% rename from lightrag/api/webui/assets/kanban-definition-NDS4AKOZ-CI4n-C9D.js rename to lightrag/api/webui/assets/kanban-definition-NDS4AKOZ-BMGhZtt7.js index 80ec463a8a47777c2a1760e11e65cb89826a3b1e..7a5138228745279955f716e7307e437038e67ee1 100644 Binary files a/lightrag/api/webui/assets/kanban-definition-NDS4AKOZ-CI4n-C9D.js and b/lightrag/api/webui/assets/kanban-definition-NDS4AKOZ-BMGhZtt7.js differ diff --git a/lightrag/api/webui/assets/layout-DVOtj2IM.js b/lightrag/api/webui/assets/layout-DgVd6nly.js similarity index 99% rename from lightrag/api/webui/assets/layout-DVOtj2IM.js rename to lightrag/api/webui/assets/layout-DgVd6nly.js index d52c1c29d01ee9bbd3b1c1fe084d3cb2e1b4f868..76893b93d0653b432f3d975282f008255d8c5204 100644 Binary files a/lightrag/api/webui/assets/layout-DVOtj2IM.js and b/lightrag/api/webui/assets/layout-DgVd6nly.js differ diff --git a/lightrag/api/webui/assets/mermaid-vendor-DnUYjsdS.js b/lightrag/api/webui/assets/mermaid-vendor-BVBgFwCv.js similarity index 99% rename from lightrag/api/webui/assets/mermaid-vendor-DnUYjsdS.js rename to lightrag/api/webui/assets/mermaid-vendor-BVBgFwCv.js index 8f7bd754fc6763d932fe8feb7902f2bc150acb0b..aee1a4428e189de60a316e09c34b1acae41a8bd3 100644 Binary files a/lightrag/api/webui/assets/mermaid-vendor-DnUYjsdS.js and b/lightrag/api/webui/assets/mermaid-vendor-BVBgFwCv.js differ diff --git a/lightrag/api/webui/assets/mindmap-definition-ALO5MXBD-C4YiM3o9.js b/lightrag/api/webui/assets/mindmap-definition-ALO5MXBD-Dy7fqjSb.js similarity index 99% rename from lightrag/api/webui/assets/mindmap-definition-ALO5MXBD-C4YiM3o9.js rename to lightrag/api/webui/assets/mindmap-definition-ALO5MXBD-Dy7fqjSb.js index 9e62ed4afe43db084368ed9b4c66d854bf1ed1b9..1afafcb9657f8d663ebc8c071c26e2277fb20853 100644 Binary files a/lightrag/api/webui/assets/mindmap-definition-ALO5MXBD-C4YiM3o9.js and b/lightrag/api/webui/assets/mindmap-definition-ALO5MXBD-Dy7fqjSb.js differ diff --git a/lightrag/api/webui/assets/pieDiagram-IB7DONF6-Riizpkaf.js b/lightrag/api/webui/assets/pieDiagram-IB7DONF6-DDY8pHxZ.js similarity index 91% rename from lightrag/api/webui/assets/pieDiagram-IB7DONF6-Riizpkaf.js rename to lightrag/api/webui/assets/pieDiagram-IB7DONF6-DDY8pHxZ.js index c62d51e16ba7bff0da1ddad29d6243ac8753576f..f2712162fc14682af2df7652f199362b55469836 100644 Binary files a/lightrag/api/webui/assets/pieDiagram-IB7DONF6-Riizpkaf.js and b/lightrag/api/webui/assets/pieDiagram-IB7DONF6-DDY8pHxZ.js differ diff --git a/lightrag/api/webui/assets/quadrantDiagram-7GDLP6J5-CzGAtLV_.js b/lightrag/api/webui/assets/quadrantDiagram-7GDLP6J5-9aLJ3TJw.js similarity index 99% rename from lightrag/api/webui/assets/quadrantDiagram-7GDLP6J5-CzGAtLV_.js rename to lightrag/api/webui/assets/quadrantDiagram-7GDLP6J5-9aLJ3TJw.js index 102df13a68eb164dd0bcb5138fe679320a7348c3..6abb91f74cad683b7f89c8ffe30b10ed19d35504 100644 Binary files a/lightrag/api/webui/assets/quadrantDiagram-7GDLP6J5-CzGAtLV_.js and b/lightrag/api/webui/assets/quadrantDiagram-7GDLP6J5-9aLJ3TJw.js differ diff --git a/lightrag/api/webui/assets/radar-MK3ICKWK-CpuAiCbQ.js b/lightrag/api/webui/assets/radar-MK3ICKWK-B0N6XiM2.js similarity index 99% rename from lightrag/api/webui/assets/radar-MK3ICKWK-CpuAiCbQ.js rename to lightrag/api/webui/assets/radar-MK3ICKWK-B0N6XiM2.js index 04bf59519a4b692eb3644554cee33075d7ce015b..266f93d7013f57c7161aacc72c3cfd284a79ab9a 100644 Binary files a/lightrag/api/webui/assets/radar-MK3ICKWK-CpuAiCbQ.js and b/lightrag/api/webui/assets/radar-MK3ICKWK-B0N6XiM2.js differ diff --git a/lightrag/api/webui/assets/requirementDiagram-KVF5MWMF-CgGQX3wU.js b/lightrag/api/webui/assets/requirementDiagram-KVF5MWMF-DqX-DNvM.js similarity index 99% rename from lightrag/api/webui/assets/requirementDiagram-KVF5MWMF-CgGQX3wU.js rename to lightrag/api/webui/assets/requirementDiagram-KVF5MWMF-DqX-DNvM.js index ae3d1eacbe2a78418fca5562a6d8dac832ebe93c..e2977516ace47a43459a2d571b2037e232de8b28 100644 Binary files a/lightrag/api/webui/assets/requirementDiagram-KVF5MWMF-CgGQX3wU.js and b/lightrag/api/webui/assets/requirementDiagram-KVF5MWMF-DqX-DNvM.js differ diff --git a/lightrag/api/webui/assets/sankeyDiagram-QLVOVGJD-DqnzGw22.js b/lightrag/api/webui/assets/sankeyDiagram-QLVOVGJD-BrbjIPio.js similarity index 99% rename from lightrag/api/webui/assets/sankeyDiagram-QLVOVGJD-DqnzGw22.js rename to lightrag/api/webui/assets/sankeyDiagram-QLVOVGJD-BrbjIPio.js index d3372dd82bac985113d81d30f62726b7c6889a65..7ef17c838dcf22b28edb4e664ab62f95eb1c303c 100644 Binary files a/lightrag/api/webui/assets/sankeyDiagram-QLVOVGJD-DqnzGw22.js and b/lightrag/api/webui/assets/sankeyDiagram-QLVOVGJD-BrbjIPio.js differ diff --git a/lightrag/api/webui/assets/sequenceDiagram-X6HHIX6F-YUSWxee1.js b/lightrag/api/webui/assets/sequenceDiagram-X6HHIX6F-wqcg8nnG.js similarity index 99% rename from lightrag/api/webui/assets/sequenceDiagram-X6HHIX6F-YUSWxee1.js rename to lightrag/api/webui/assets/sequenceDiagram-X6HHIX6F-wqcg8nnG.js index 06fe50496272119f4409390d220763d947f3c1c1..2b1f7acd6040c7820eadbd196f8bca8e4e1b1d67 100644 Binary files a/lightrag/api/webui/assets/sequenceDiagram-X6HHIX6F-YUSWxee1.js and b/lightrag/api/webui/assets/sequenceDiagram-X6HHIX6F-wqcg8nnG.js differ diff --git a/lightrag/api/webui/assets/stateDiagram-DGXRK772-DZnU_4RL.js b/lightrag/api/webui/assets/stateDiagram-DGXRK772-CGL2vL66.js similarity index 96% rename from lightrag/api/webui/assets/stateDiagram-DGXRK772-DZnU_4RL.js rename to lightrag/api/webui/assets/stateDiagram-DGXRK772-CGL2vL66.js index 0b787f3959448ac846ebb44f2b39419c233b6e84..4b8cae845868de86acee61c9d17b6068d1c60e6b 100644 Binary files a/lightrag/api/webui/assets/stateDiagram-DGXRK772-DZnU_4RL.js and b/lightrag/api/webui/assets/stateDiagram-DGXRK772-CGL2vL66.js differ diff --git a/lightrag/api/webui/assets/stateDiagram-v2-YXO3MK2T-ZS0tnvcs.js b/lightrag/api/webui/assets/stateDiagram-v2-YXO3MK2T-DIpE_gWh.js similarity index 61% rename from lightrag/api/webui/assets/stateDiagram-v2-YXO3MK2T-ZS0tnvcs.js rename to lightrag/api/webui/assets/stateDiagram-v2-YXO3MK2T-DIpE_gWh.js index 67ee3fd4ed03d233a09afeacb737084588695465..9ee064090a0dd51fb5c4f731de323fb8238bacc7 100644 Binary files a/lightrag/api/webui/assets/stateDiagram-v2-YXO3MK2T-ZS0tnvcs.js and b/lightrag/api/webui/assets/stateDiagram-v2-YXO3MK2T-DIpE_gWh.js differ diff --git a/lightrag/api/webui/assets/timeline-definition-BDJGKUSR-Cl68_gMM.js b/lightrag/api/webui/assets/timeline-definition-BDJGKUSR-CwuNSBuu.js similarity index 99% rename from lightrag/api/webui/assets/timeline-definition-BDJGKUSR-Cl68_gMM.js rename to lightrag/api/webui/assets/timeline-definition-BDJGKUSR-CwuNSBuu.js index 97e6c0601632e2d09be6cbd7c7384e6fe12d6ffe..29e7401e08817483fc3db8f6c2cd486fca0c0e5f 100644 Binary files a/lightrag/api/webui/assets/timeline-definition-BDJGKUSR-Cl68_gMM.js and b/lightrag/api/webui/assets/timeline-definition-BDJGKUSR-CwuNSBuu.js differ diff --git a/lightrag/api/webui/assets/xychartDiagram-VJFVF3MP-Bc_rddYS.js b/lightrag/api/webui/assets/xychartDiagram-VJFVF3MP-B1xgKNPc.js similarity index 99% rename from lightrag/api/webui/assets/xychartDiagram-VJFVF3MP-Bc_rddYS.js rename to lightrag/api/webui/assets/xychartDiagram-VJFVF3MP-B1xgKNPc.js index 0ddbc20489bdd759a3b1e7b58b975680b9ff5ad5..4092209cb8496b0a4bce73f07c7e63fad5d77b31 100644 Binary files a/lightrag/api/webui/assets/xychartDiagram-VJFVF3MP-Bc_rddYS.js and b/lightrag/api/webui/assets/xychartDiagram-VJFVF3MP-B1xgKNPc.js differ diff --git a/lightrag/api/webui/index.html b/lightrag/api/webui/index.html index d156be81c227a21b21bde3beea74f07089c27725..5064f712fcc98b3ada6db795a9c83a3d5c33fadc 100644 Binary files a/lightrag/api/webui/index.html and b/lightrag/api/webui/index.html differ diff --git a/lightrag/kg/mongo_impl.py b/lightrag/kg/mongo_impl.py index 527ef5db821c717c8a880fb5504dde963e0f8714..dcf993271a23f67b211457f97e682a95bc300245 100644 --- a/lightrag/kg/mongo_impl.py +++ b/lightrag/kg/mongo_impl.py @@ -34,8 +34,6 @@ from pymongo.errors import PyMongoError # type: ignore config = configparser.ConfigParser() config.read("config.ini", "utf-8") -# Get maximum number of graph nodes from environment variable, default is 1000 -MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000)) GRAPH_BFS_MODE = os.getenv("MONGO_GRAPH_BFS_MODE", "bidirectional") @@ -883,7 +881,7 @@ class MongoGraphStorage(BaseGraphStorage): ) async def get_knowledge_graph_all_by_degree( - self, max_depth: int = 3, max_nodes: int = MAX_GRAPH_NODES + self, max_depth: int, max_nodes: int ) -> KnowledgeGraph: """ It's possible that the node with one or multiple relationships is retrieved, @@ -961,9 +959,9 @@ class MongoGraphStorage(BaseGraphStorage): node_labels: list[str], seen_nodes: set[str], result: KnowledgeGraph, - depth: int = 0, - max_depth: int = 3, - max_nodes: int = MAX_GRAPH_NODES, + depth: int, + max_depth: int, + max_nodes: int, ) -> KnowledgeGraph: if depth > max_depth or len(result.nodes) > max_nodes: return result @@ -1006,9 +1004,9 @@ class MongoGraphStorage(BaseGraphStorage): async def get_knowledge_subgraph_bidirectional_bfs( self, node_label: str, - depth=0, - max_depth: int = 3, - max_nodes: int = MAX_GRAPH_NODES, + depth: int, + max_depth: int, + max_nodes: int, ) -> KnowledgeGraph: seen_nodes = set() seen_edges = set() @@ -1038,7 +1036,7 @@ class MongoGraphStorage(BaseGraphStorage): return result async def get_knowledge_subgraph_in_out_bound_bfs( - self, node_label: str, max_depth: int = 3, max_nodes: int = MAX_GRAPH_NODES + self, node_label: str, max_depth: int, max_nodes: int ) -> KnowledgeGraph: seen_nodes = set() seen_edges = set() @@ -1152,7 +1150,7 @@ class MongoGraphStorage(BaseGraphStorage): self, node_label: str, max_depth: int = 3, - max_nodes: int = MAX_GRAPH_NODES, + max_nodes: int = None, ) -> KnowledgeGraph: """ Retrieve a connected subgraph of nodes where the label includes the specified `node_label`. @@ -1160,7 +1158,7 @@ class MongoGraphStorage(BaseGraphStorage): Args: node_label: Label of the starting node, * means all nodes max_depth: Maximum depth of the subgraph, Defaults to 3 - max_nodes: Maxiumu nodes to return, Defaults to 1000 + max_nodes: Maximum nodes to return, Defaults to global_config max_graph_nodes Returns: KnowledgeGraph object containing nodes and edges, with an is_truncated flag @@ -1184,6 +1182,13 @@ class MongoGraphStorage(BaseGraphStorage): C → B C → D """ + # Use global_config max_graph_nodes as default if max_nodes is None + if max_nodes is None: + max_nodes = self.global_config.get("max_graph_nodes", 1000) + else: + # Limit max_nodes to not exceed global_config max_graph_nodes + max_nodes = min(max_nodes, self.global_config.get("max_graph_nodes", 1000)) + result = KnowledgeGraph() start = time.perf_counter() @@ -1419,7 +1424,11 @@ class MongoVectorDBStorage(BaseVectorStorage): logger.info(f"Vector index {self._index_name} created successfully.") except PyMongoError as e: - logger.error(f"Error creating vector index {self._index_name}: {e}") + error_msg = f"Error creating vector index {self._index_name}: {e}" + logger.error(error_msg) + raise SystemExit( + f"Failed to create MongoDB vector index. Program cannot continue. {error_msg}" + ) async def upsert(self, data: dict[str, dict[str, Any]]) -> None: logger.debug(f"Inserting {len(data)} to {self.namespace}") diff --git a/lightrag/kg/neo4j_impl.py b/lightrag/kg/neo4j_impl.py index 63a3300a511b178bdb958e3bc9bf48cf8b09bf04..b0efc4b56817f324ec2afd64bfe207ff89ebb60f 100644 --- a/lightrag/kg/neo4j_impl.py +++ b/lightrag/kg/neo4j_impl.py @@ -36,9 +36,6 @@ from dotenv import load_dotenv # the OS environment variables take precedence over the .env file load_dotenv(dotenv_path=".env", override=False) -# Get maximum number of graph nodes from environment variable, default is 1000 -MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000)) - config = configparser.ConfigParser() config.read("config.ini", "utf-8") @@ -902,7 +899,7 @@ class Neo4JStorage(BaseGraphStorage): self, node_label: str, max_depth: int = 3, - max_nodes: int = MAX_GRAPH_NODES, + max_nodes: int = None, ) -> KnowledgeGraph: """ Retrieve a connected subgraph of nodes where the label includes the specified `node_label`. @@ -916,6 +913,13 @@ class Neo4JStorage(BaseGraphStorage): KnowledgeGraph object containing nodes and edges, with an is_truncated flag indicating whether the graph was truncated due to max_nodes limit """ + # Get max_nodes from global_config if not provided + if max_nodes is None: + max_nodes = self.global_config.get("max_graph_nodes", 1000) + else: + # Limit max_nodes to not exceed global_config max_graph_nodes + max_nodes = min(max_nodes, self.global_config.get("max_graph_nodes", 1000)) + workspace_label = self._get_workspace_label() result = KnowledgeGraph() seen_nodes = set() diff --git a/lightrag/kg/networkx_impl.py b/lightrag/kg/networkx_impl.py index faff6a964c3323eb977c46f880b25ed232d62f42..01b345662523ad46d69edd2e9957d5b9f9d338f8 100644 --- a/lightrag/kg/networkx_impl.py +++ b/lightrag/kg/networkx_impl.py @@ -26,8 +26,6 @@ from dotenv import load_dotenv # the OS environment variables take precedence over the .env file load_dotenv(dotenv_path=".env", override=False) -MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000)) - @final @dataclass @@ -218,7 +216,7 @@ class NetworkXStorage(BaseGraphStorage): self, node_label: str, max_depth: int = 3, - max_nodes: int = MAX_GRAPH_NODES, + max_nodes: int = None, ) -> KnowledgeGraph: """ Retrieve a connected subgraph of nodes where the label includes the specified `node_label`. @@ -232,6 +230,13 @@ class NetworkXStorage(BaseGraphStorage): KnowledgeGraph object containing nodes and edges, with an is_truncated flag indicating whether the graph was truncated due to max_nodes limit """ + # Get max_nodes from global_config if not provided + if max_nodes is None: + max_nodes = self.global_config.get("max_graph_nodes", 1000) + else: + # Limit max_nodes to not exceed global_config max_graph_nodes + max_nodes = min(max_nodes, self.global_config.get("max_graph_nodes", 1000)) + graph = await self._get_graph() result = KnowledgeGraph() diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index 5750fd6e712a7f7a0daf6fc56d0ba6e7eae9efd7..7e696c77ee068672ba35d832141b655600c8ea2f 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -45,9 +45,6 @@ from dotenv import load_dotenv # the OS environment variables take precedence over the .env file load_dotenv(dotenv_path=".env", override=False) -# Get maximum number of graph nodes from environment variable, default is 1000 -MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000)) - class PostgreSQLDB: def __init__(self, config: dict[str, Any], **kwargs: Any): @@ -2819,7 +2816,7 @@ class PGGraphStorage(BaseGraphStorage): self, node_label: str, max_depth: int = 3, - max_nodes: int = MAX_GRAPH_NODES, + max_nodes: int = None, ) -> KnowledgeGraph: """ Retrieve a connected subgraph of nodes where the label includes the specified `node_label`. @@ -2827,12 +2824,18 @@ class PGGraphStorage(BaseGraphStorage): Args: node_label: Label of the starting node, * means all nodes max_depth: Maximum depth of the subgraph, Defaults to 3 - max_nodes: Maxiumu nodes to return, Defaults to 1000 + max_nodes: Maximum nodes to return, Defaults to global_config max_graph_nodes Returns: KnowledgeGraph object containing nodes and edges, with an is_truncated flag indicating whether the graph was truncated due to max_nodes limit """ + # Use global_config max_graph_nodes as default if max_nodes is None + if max_nodes is None: + max_nodes = self.global_config.get("max_graph_nodes", 1000) + else: + # Limit max_nodes to not exceed global_config max_graph_nodes + max_nodes = min(max_nodes, self.global_config.get("max_graph_nodes", 1000)) kg = KnowledgeGraph() # Handle wildcard query - get all nodes diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index 5d96aebaf32611f44edcdc270cd0c66a318547e1..cbb5e2a89a18353d8083bb57686476247a9b3188 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -258,6 +258,9 @@ class LightRAG: max_parallel_insert: int = field(default=int(os.getenv("MAX_PARALLEL_INSERT", 2))) """Maximum number of parallel insert operations.""" + max_graph_nodes: int = field(default=get_env_value("MAX_GRAPH_NODES", 1000, int)) + """Maximum number of graph nodes to return in knowledge graph queries.""" + addon_params: dict[str, Any] = field( default_factory=lambda: { "language": get_env_value("SUMMARY_LANGUAGE", "English", str) @@ -526,18 +529,24 @@ class LightRAG: self, node_label: str, max_depth: int = 3, - max_nodes: int = 1000, + max_nodes: int = None, ) -> KnowledgeGraph: """Get knowledge graph for a given label Args: node_label (str): Label to get knowledge graph for max_depth (int): Maximum depth of graph - max_nodes (int, optional): Maximum number of nodes to return. Defaults to 1000. + max_nodes (int, optional): Maximum number of nodes to return. Defaults to self.max_graph_nodes. Returns: KnowledgeGraph: Knowledge graph containing nodes and edges """ + # Use self.max_graph_nodes as default if max_nodes is None + if max_nodes is None: + max_nodes = self.max_graph_nodes + else: + # Limit max_nodes to not exceed self.max_graph_nodes + max_nodes = min(max_nodes, self.max_graph_nodes) return await self.chunk_entity_relation_graph.get_knowledge_graph( node_label, max_depth, max_nodes diff --git a/lightrag_webui/src/components/graph/Settings.tsx b/lightrag_webui/src/components/graph/Settings.tsx index 758f6d58d96f9f92babadd53290611720b592042..37a36305b1e20cb1e65435a4e5c67f760d37c505 100644 --- a/lightrag_webui/src/components/graph/Settings.tsx +++ b/lightrag_webui/src/components/graph/Settings.tsx @@ -1,4 +1,4 @@ -import { useState, useCallback} from 'react' +import { useState, useCallback, useEffect} from 'react' import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/Popover' import Checkbox from '@/components/ui/Checkbox' import Button from '@/components/ui/Button' @@ -62,6 +62,10 @@ const LabeledNumberInput = ({ // Create unique ID using the label text converted to lowercase with spaces removed const id = `input-${label.toLowerCase().replace(/\s+/g, '-')}`; + useEffect(() => { + setCurrentValue(value) + }, [value]) + const onValueChange = useCallback( (e: React.ChangeEvent) => { const text = e.target.value.trim() @@ -154,6 +158,7 @@ export default function Settings() { const maxEdgeSize = useSettingsStore.use.maxEdgeSize() const graphQueryMaxDepth = useSettingsStore.use.graphQueryMaxDepth() const graphMaxNodes = useSettingsStore.use.graphMaxNodes() + const backendMaxGraphNodes = useSettingsStore.use.backendMaxGraphNodes() const graphLayoutMaxIterations = useSettingsStore.use.graphLayoutMaxIterations() const enableHealthCheck = useSettingsStore.use.enableHealthCheck() @@ -213,14 +218,10 @@ export default function Settings() { }, []) const setGraphMaxNodes = useCallback((nodes: number) => { - if (nodes < 1 || nodes > 1000) return - useSettingsStore.setState({ graphMaxNodes: nodes }) - const currentLabel = useSettingsStore.getState().queryLabel - useSettingsStore.getState().setQueryLabel('') - setTimeout(() => { - useSettingsStore.getState().setQueryLabel(currentLabel) - }, 300) - }, []) + const maxLimit = backendMaxGraphNodes || 1000 + if (nodes < 1 || nodes > maxLimit) return + useSettingsStore.getState().setGraphMaxNodes(nodes, true) + }, [backendMaxGraphNodes]) const setGraphLayoutMaxIterations = useCallback((iterations: number) => { if (iterations < 1) return @@ -360,11 +361,11 @@ export default function Settings() { onEditFinished={setGraphQueryMaxDepth} /> handleDocumentSelect(doc.id, checked === true)} - disabled={doc.status !== 'processed'} + // disabled={doc.status !== 'processed'} className="mx-auto" /> diff --git a/lightrag_webui/src/stores/settings.ts b/lightrag_webui/src/stores/settings.ts index fb3246ea3e3b6c1cf9cea6be5ae61f0cfeb13e25..203502dc9da2340941f3a97a4f2a3bb5e119c52a 100644 --- a/lightrag_webui/src/stores/settings.ts +++ b/lightrag_webui/src/stores/settings.ts @@ -36,7 +36,10 @@ interface SettingsState { setGraphQueryMaxDepth: (depth: number) => void graphMaxNodes: number - setGraphMaxNodes: (nodes: number) => void + setGraphMaxNodes: (nodes: number, triggerRefresh?: boolean) => void + + backendMaxGraphNodes: number | null + setBackendMaxGraphNodes: (maxNodes: number | null) => void graphLayoutMaxIterations: number setGraphLayoutMaxIterations: (iterations: number) => void @@ -90,6 +93,7 @@ const useSettingsStoreBase = create()( graphQueryMaxDepth: 3, graphMaxNodes: 1000, + backendMaxGraphNodes: null, graphLayoutMaxIterations: 15, queryLabel: defaultQueryLabel, @@ -143,7 +147,27 @@ const useSettingsStoreBase = create()( setGraphQueryMaxDepth: (depth: number) => set({ graphQueryMaxDepth: depth }), - setGraphMaxNodes: (nodes: number) => set({ graphMaxNodes: nodes }), + setGraphMaxNodes: (nodes: number, triggerRefresh: boolean = false) => { + const state = useSettingsStore.getState(); + if (state.graphMaxNodes === nodes) { + return; + } + + if (triggerRefresh) { + const currentLabel = state.queryLabel; + // Atomically update both the node count and the query label to trigger a refresh. + set({ graphMaxNodes: nodes, queryLabel: '' }); + + // Restore the label after a short delay. + setTimeout(() => { + set({ queryLabel: currentLabel }); + }, 300); + } else { + set({ graphMaxNodes: nodes }); + } + }, + + setBackendMaxGraphNodes: (maxNodes: number | null) => set({ backendMaxGraphNodes: maxNodes }), setMinEdgeSize: (size: number) => set({ minEdgeSize: size }), @@ -168,7 +192,7 @@ const useSettingsStoreBase = create()( { name: 'settings-storage', storage: createJSONStorage(() => localStorage), - version: 13, + version: 14, migrate: (state: any, version: number) => { if (version < 2) { state.showEdgeLabel = false @@ -232,6 +256,10 @@ const useSettingsStoreBase = create()( state.querySettings.user_prompt = '' } } + if (version < 14) { + // Add backendMaxGraphNodes field for older versions + state.backendMaxGraphNodes = null + } return state } } diff --git a/lightrag_webui/src/stores/state.ts b/lightrag_webui/src/stores/state.ts index 3bc4560e989b938445d7afb6d1b9088118178c35..c73b3bcd77e0af084f2b1549962f5a992b94fa70 100644 --- a/lightrag_webui/src/stores/state.ts +++ b/lightrag_webui/src/stores/state.ts @@ -1,6 +1,7 @@ import { create } from 'zustand' import { createSelectors } from '@/lib/utils' import { checkHealth, LightragStatus } from '@/api/lightrag' +import { useSettingsStore } from './settings' interface BackendState { health: boolean @@ -58,6 +59,25 @@ const useBackendStateStoreBase = create()((set) => ({ ); } + // Extract and store backend max graph nodes limit + if (health.configuration?.max_graph_nodes) { + const maxNodes = parseInt(health.configuration.max_graph_nodes, 10) + if (!isNaN(maxNodes) && maxNodes > 0) { + const currentBackendMaxNodes = useSettingsStore.getState().backendMaxGraphNodes + + // Only update if the backend limit has actually changed + if (currentBackendMaxNodes !== maxNodes) { + useSettingsStore.getState().setBackendMaxGraphNodes(maxNodes) + + // Auto-adjust current graphMaxNodes if it exceeds the new backend limit + const currentMaxNodes = useSettingsStore.getState().graphMaxNodes + if (currentMaxNodes > maxNodes) { + useSettingsStore.getState().setGraphMaxNodes(maxNodes, true) + } + } + } + } + set({ health: true, message: null,