From 8994c70f2f6590e5048eb68e2ff89ae7de0e8c9b Mon Sep 17 00:00:00 2001 From: EightyOliveira Date: Tue, 25 Nov 2025 16:36:41 +0800 Subject: [PATCH 01/28] fix:exception handling order error --- lightrag/llm/openai.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightrag/llm/openai.py b/lightrag/llm/openai.py index 11a5f9d7..5ab2ac87 100644 --- a/lightrag/llm/openai.py +++ b/lightrag/llm/openai.py @@ -309,6 +309,10 @@ async def openai_complete_if_cache( response = await openai_async_client.chat.completions.create( model=api_model, messages=messages, **kwargs ) + except APITimeoutError as e: + logger.error(f"OpenAI API Timeout Error: {e}") + await openai_async_client.close() # Ensure client is closed + raise except APIConnectionError as e: logger.error(f"OpenAI API Connection Error: {e}") await openai_async_client.close() # Ensure client is closed @@ -317,10 +321,6 @@ async def openai_complete_if_cache( logger.error(f"OpenAI API Rate Limit Error: {e}") await openai_async_client.close() # Ensure client is closed raise - except APITimeoutError as e: - logger.error(f"OpenAI API Timeout Error: {e}") - await openai_async_client.close() # Ensure client is closed - raise except Exception as e: logger.error( f"OpenAI API Call Failed,\nModel: {model},\nParams: {kwargs}, Got: {e}" From 777c91794b7b2ad5cdfabf770b542ee5acd1f60f Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 25 Nov 2025 17:16:55 +0800 Subject: [PATCH 02/28] Add Langfuse observability configuration to env.example - Add Langfuse environment variables - Include setup instructions - Support OpenAI compatible APIs - Enable tracing configuration - Add cloud/self-host options --- env.example | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/env.example b/env.example index fea99953..d30a03cb 100644 --- a/env.example +++ b/env.example @@ -447,6 +447,17 @@ MEMGRAPH_DATABASE=memgraph ### DB specific workspace should not be set, keep for compatible only ### MEMGRAPH_WORKSPACE=forced_workspace_name +########################################################### +### Langfuse Observability Configuration +### Only works with LLM provided by OpenAI compatible API +### Install with: pip install lightrag-hku[observability] +### Sign up at: https://cloud.langfuse.com or self-host +########################################################### +# LANGFUSE_SECRET_KEY="" +# LANGFUSE_PUBLIC_KEY="" +# LANGFUSE_HOST="https://cloud.langfuse.com" # 或您的自托管实例地址 +# LANGFUSE_ENABLE_TRACE=true + ############################ ### Evaluation Configuration ############################ From 93d445dfdd4c51e4e56a516bae0b81036593434f Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 25 Nov 2025 18:24:39 +0800 Subject: [PATCH 03/28] Add pipeline status lock function for legacy compatibility - Add get_pipeline_status_lock function - Return NamespaceLock for consistency - Support workspace parameter - Enable logging option - Legacy code compatibility --- lightrag/kg/shared_storage.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lightrag/kg/shared_storage.py b/lightrag/kg/shared_storage.py index 834cdc8f..ef0f61e2 100644 --- a/lightrag/kg/shared_storage.py +++ b/lightrag/kg/shared_storage.py @@ -1683,3 +1683,17 @@ def get_default_workspace() -> str: """ global _default_workspace return _default_workspace + + +def get_pipeline_status_lock( + enable_logging: bool = False, workspace: str = None +) -> NamespaceLock: + """Return unified storage lock for pipeline status data consistency. + + This function is for compatibility with legacy code only. + """ + global _default_workspace + actual_workspace = workspace if workspace else _default_workspace + return get_namespace_lock( + "pipeline_status", workspace=actual_workspace, enable_logging=enable_logging + ) From 4f12fe121d06298b135dcd57cadeeea5259aaf63 Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 27 Nov 2025 11:00:34 +0800 Subject: [PATCH 04/28] Change entity extraction logging from warning to info level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Reduce log noise for empty entities --- lightrag/operate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lightrag/operate.py b/lightrag/operate.py index 5f824af0..c6724974 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -397,8 +397,8 @@ async def _handle_single_entity_extraction( # Validate entity name after all cleaning steps if not entity_name or not entity_name.strip(): - logger.warning( - f"Entity extraction error: entity name became empty after cleaning. Original: '{record_attributes[1]}'" + logger.info( + f"Empty entity name found after sanitization. Original: '{record_attributes[1]}'" ) return None @@ -474,14 +474,14 @@ async def _handle_single_relationship_extraction( # Validate entity names after all cleaning steps if not source: - logger.warning( - f"Relationship extraction error: source entity became empty after cleaning. Original: '{record_attributes[1]}'" + logger.info( + f"Empty source entity found after sanitization. Original: '{record_attributes[1]}'" ) return None if not target: - logger.warning( - f"Relationship extraction error: target entity became empty after cleaning. Original: '{record_attributes[2]}'" + logger.info( + f"Empty target entity found after sanitization. Original: '{record_attributes[2]}'" ) return None From 6e2946e78aa1213d23749aac23fe3513f5c957db Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 28 Nov 2025 13:41:01 +0800 Subject: [PATCH 05/28] Add max_token_size parameter to azure_openai_embed wrapper --- lightrag/llm/openai.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/llm/openai.py b/lightrag/llm/openai.py index 5ab2ac87..9c3d0261 100644 --- a/lightrag/llm/openai.py +++ b/lightrag/llm/openai.py @@ -867,7 +867,7 @@ async def azure_openai_complete( return result -@wrap_embedding_func_with_attrs(embedding_dim=1536) +@wrap_embedding_func_with_attrs(embedding_dim=1536, max_token_size=8192) async def azure_openai_embed( texts: list[str], model: str | None = None, From 1d07ff7f60439abacbe67832c2da1c8cabb86ca9 Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 28 Nov 2025 14:41:29 +0800 Subject: [PATCH 06/28] Update OpenAI and Ollama embedding func examples in README --- README-zh.md | 47 ++++++++++++++++++++++++++--------------------- README.md | 47 ++++++++++++++++++++++++++--------------------- 2 files changed, 52 insertions(+), 42 deletions(-) diff --git a/README-zh.md b/README-zh.md index 3c72b846..3d0e6301 100644 --- a/README-zh.md +++ b/README-zh.md @@ -407,6 +407,11 @@ LightRAG 需要利用LLM和Embeding模型来完成文档索引和知识库查询 * LightRAG还支持类OpenAI的聊天/嵌入API: ```python +import os +import numpy as np +from lightrag.utils import wrap_embedding_func_with_attrs +from lightrag.llm.openai import openai_complete_if_cache, openai_embed + async def llm_model_func( prompt, system_prompt=None, history_messages=[], keyword_extraction=False, **kwargs ) -> str: @@ -420,8 +425,9 @@ async def llm_model_func( **kwargs ) +@wrap_embedding_func_with_attrs(embedding_dim=4096, max_token_size=8192) async def embedding_func(texts: list[str]) -> np.ndarray: - return await openai_embed( + return await openai_embed.func( texts, model="solar-embedding-1-large-query", api_key=os.getenv("UPSTAGE_API_KEY"), @@ -432,10 +438,7 @@ async def initialize_rag(): rag = LightRAG( working_dir=WORKING_DIR, llm_model_func=llm_model_func, - embedding_func=EmbeddingFunc( - embedding_dim=4096, - func=embedding_func - ) + embedding_func=embedding_func # 直接传入装饰后的函数 ) await rag.initialize_storages() @@ -478,19 +481,20 @@ rag = LightRAG( 然后您只需要按如下方式设置LightRAG: ```python +import numpy as np +from lightrag.utils import wrap_embedding_func_with_attrs +from lightrag.llm.ollama import ollama_model_complete, ollama_embed + +@wrap_embedding_func_with_attrs(embedding_dim=768, max_token_size=8192) +async def embedding_func(texts: list[str]) -> np.ndarray: + return await ollama_embed.func(texts, embed_model="nomic-embed-text") + # 使用Ollama模型初始化LightRAG rag = LightRAG( working_dir=WORKING_DIR, llm_model_func=ollama_model_complete, # 使用Ollama模型进行文本生成 llm_model_name='your_model_name', # 您的模型名称 - # 使用Ollama嵌入函数 - embedding_func=EmbeddingFunc( - embedding_dim=768, - func=lambda texts: ollama_embed( - texts, - embed_model="nomic-embed-text" - ) - ), + embedding_func=embedding_func, # 直接传入装饰后的函数 ) ``` @@ -529,19 +533,20 @@ ollama create -f Modelfile qwen2m 您可以使用`llm_model_kwargs`参数配置ollama: ```python +import numpy as np +from lightrag.utils import wrap_embedding_func_with_attrs +from lightrag.llm.ollama import ollama_model_complete, ollama_embed + +@wrap_embedding_func_with_attrs(embedding_dim=768, max_token_size=8192) +async def embedding_func(texts: list[str]) -> np.ndarray: + return await ollama_embed.func(texts, embed_model="nomic-embed-text") + rag = LightRAG( working_dir=WORKING_DIR, llm_model_func=ollama_model_complete, # 使用Ollama模型进行文本生成 llm_model_name='your_model_name', # 您的模型名称 llm_model_kwargs={"options": {"num_ctx": 32768}}, - # 使用Ollama嵌入函数 - embedding_func=EmbeddingFunc( - embedding_dim=768, - func=lambda texts: ollama_embed( - texts, - embed_model="nomic-embed-text" - ) - ), + embedding_func=embedding_func, # 直接传入装饰后的函数 ) ``` diff --git a/README.md b/README.md index 47906d2e..6ab85dc4 100644 --- a/README.md +++ b/README.md @@ -403,6 +403,11 @@ LightRAG requires the utilization of LLM and Embedding models to accomplish docu * LightRAG also supports Open AI-like chat/embeddings APIs: ```python +import os +import numpy as np +from lightrag.utils import wrap_embedding_func_with_attrs +from lightrag.llm.openai import openai_complete_if_cache, openai_embed + async def llm_model_func( prompt, system_prompt=None, history_messages=[], keyword_extraction=False, **kwargs ) -> str: @@ -416,8 +421,9 @@ async def llm_model_func( **kwargs ) +@wrap_embedding_func_with_attrs(embedding_dim=4096, max_token_size=8192) async def embedding_func(texts: list[str]) -> np.ndarray: - return await openai_embed( + return await openai_embed.func( texts, model="solar-embedding-1-large-query", api_key=os.getenv("UPSTAGE_API_KEY"), @@ -428,10 +434,7 @@ async def initialize_rag(): rag = LightRAG( working_dir=WORKING_DIR, llm_model_func=llm_model_func, - embedding_func=EmbeddingFunc( - embedding_dim=4096, - func=embedding_func - ) + embedding_func=embedding_func # Pass the decorated function directly ) await rag.initialize_storages() @@ -476,19 +479,20 @@ If you want to use Ollama models, you need to pull model you plan to use and emb Then you only need to set LightRAG as follows: ```python +import numpy as np +from lightrag.utils import wrap_embedding_func_with_attrs +from lightrag.llm.ollama import ollama_model_complete, ollama_embed + +@wrap_embedding_func_with_attrs(embedding_dim=768, max_token_size=8192) +async def embedding_func(texts: list[str]) -> np.ndarray: + return await ollama_embed.func(texts, embed_model="nomic-embed-text") + # Initialize LightRAG with Ollama model rag = LightRAG( working_dir=WORKING_DIR, llm_model_func=ollama_model_complete, # Use Ollama model for text generation llm_model_name='your_model_name', # Your model name - # Use Ollama embedding function - embedding_func=EmbeddingFunc( - embedding_dim=768, - func=lambda texts: ollama_embed( - texts, - embed_model="nomic-embed-text" - ) - ), + embedding_func=embedding_func, # Pass the decorated function directly ) ``` @@ -527,19 +531,20 @@ ollama create -f Modelfile qwen2m Tiy can use `llm_model_kwargs` param to configure ollama: ```python +import numpy as np +from lightrag.utils import wrap_embedding_func_with_attrs +from lightrag.llm.ollama import ollama_model_complete, ollama_embed + +@wrap_embedding_func_with_attrs(embedding_dim=768, max_token_size=8192) +async def embedding_func(texts: list[str]) -> np.ndarray: + return await ollama_embed.func(texts, embed_model="nomic-embed-text") + rag = LightRAG( working_dir=WORKING_DIR, llm_model_func=ollama_model_complete, # Use Ollama model for text generation llm_model_name='your_model_name', # Your model name llm_model_kwargs={"options": {"num_ctx": 32768}}, - # Use Ollama embedding function - embedding_func=EmbeddingFunc( - embedding_dim=768, - func=lambda texts: ollama_embed( - texts, - embed_model="nomic-embed-text" - ) - ), + embedding_func=embedding_func, # Pass the decorated function directly ) ``` From 97a9dfcac05417ebe6d577cb995d89e293137f5b Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 28 Nov 2025 14:55:15 +0800 Subject: [PATCH 07/28] Add important note about embedding function wrapping restrictions --- README-zh.md | 8 ++++++++ README.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/README-zh.md b/README-zh.md index 3d0e6301..478d67ab 100644 --- a/README-zh.md +++ b/README-zh.md @@ -445,6 +445,10 @@ async def initialize_rag(): return rag ``` +> **关于嵌入函数封装的重要说明:** +> +> `EmbeddingFunc` 不能嵌套封装。已经被 `@wrap_embedding_func_with_attrs` 装饰过的嵌入函数(如 `openai_embed`、`ollama_embed` 等)不能再次使用 `EmbeddingFunc()` 封装。这就是为什么在创建自定义嵌入函数时,我们调用 `xxx_embed.func`(底层未封装的函数)而不是直接调用 `xxx_embed`。 +
@@ -550,6 +554,10 @@ rag = LightRAG( ) ``` +> **关于嵌入函数封装的重要说明:** +> +> `EmbeddingFunc` 不能嵌套封装。已经被 `@wrap_embedding_func_with_attrs` 装饰过的嵌入函数(如 `openai_embed`、`ollama_embed` 等)不能再次使用 `EmbeddingFunc()` 封装。这就是为什么在创建自定义嵌入函数时,我们调用 `xxx_embed.func`(底层未封装的函数)而不是直接调用 `xxx_embed`。 + * **低RAM GPU** 为了在低RAM GPU上运行此实验,您应该选择小型模型并调整上下文窗口(增加上下文会增加内存消耗)。例如,在6Gb RAM的改装挖矿GPU上运行这个ollama示例需要将上下文大小设置为26k,同时使用`gemma2:2b`。它能够在`book.txt`中找到197个实体和19个关系。 diff --git a/README.md b/README.md index 6ab85dc4..68d61eee 100644 --- a/README.md +++ b/README.md @@ -441,6 +441,10 @@ async def initialize_rag(): return rag ``` +> **Important Note on Embedding Function Wrapping:** +> +> `EmbeddingFunc` cannot be nested. Functions that have been decorated with `@wrap_embedding_func_with_attrs` (such as `openai_embed`, `ollama_embed`, etc.) cannot be wrapped again using `EmbeddingFunc()`. This is why we call `xxx_embed.func` (the underlying unwrapped function) instead of `xxx_embed` directly when creating custom embedding functions. +
@@ -548,6 +552,10 @@ rag = LightRAG( ) ``` +> **Important Note on Embedding Function Wrapping:** +> +> `EmbeddingFunc` cannot be nested. Functions that have been decorated with `@wrap_embedding_func_with_attrs` (such as `openai_embed`, `ollama_embed`, etc.) cannot be wrapped again using `EmbeddingFunc()`. This is why we call `xxx_embed.func` (the underlying unwrapped function) instead of `xxx_embed` directly when creating custom embedding functions. + * **Low RAM GPUs** In order to run this experiment on low RAM GPU you should select small model and tune context window (increasing context increase memory consumption). For example, running this ollama example on repurposed mining GPU with 6Gb of RAM required to set context size to 26k while using `gemma2:2b`. It was able to find 197 entities and 19 relations on `book.txt`. From 56e0365cf0d4b0563136daa3481e6788b42fea99 Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 28 Nov 2025 15:38:29 +0800 Subject: [PATCH 08/28] Add configurable model parameter to jina_embed function - Add model parameter to jina_embed - Pass model from API server - Default to jina-embeddings-v4 - Update function documentation - Make model selection flexible --- lightrag/api/lightrag_server.py | 1 + lightrag/llm/jina.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index a8a14c66..16e59d21 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -780,6 +780,7 @@ def create_app(args): ) return await actual_func( texts, + model=model, embedding_dim=embedding_dim, base_url=host, api_key=api_key, diff --git a/lightrag/llm/jina.py b/lightrag/llm/jina.py index f61faadd..41251f4a 100644 --- a/lightrag/llm/jina.py +++ b/lightrag/llm/jina.py @@ -69,6 +69,7 @@ async def fetch_data(url, headers, data): ) async def jina_embed( texts: list[str], + model: str = "jina-embeddings-v4", embedding_dim: int = 2048, late_chunking: bool = False, base_url: str = None, @@ -78,6 +79,8 @@ async def jina_embed( Args: texts: List of texts to embed. + model: The Jina embedding model to use (default: jina-embeddings-v4). + Supported models: jina-embeddings-v3, jina-embeddings-v4, etc. embedding_dim: The embedding dimensions (default: 2048 for jina-embeddings-v4). **IMPORTANT**: This parameter is automatically injected by the EmbeddingFunc wrapper. Do NOT manually pass this parameter when calling the function directly. @@ -107,7 +110,7 @@ async def jina_embed( "Authorization": f"Bearer {os.environ['JINA_API_KEY']}", } data = { - "model": "jina-embeddings-v4", + "model": model, "task": "text-matching", "dimensions": embedding_dim, "embedding_type": "base64", From 881b8d3a505926a12d5c38d917f511ca95854e75 Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 28 Nov 2025 15:39:55 +0800 Subject: [PATCH 09/28] Bump API version to 0257 --- lightrag/api/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/api/__init__.py b/lightrag/api/__init__.py index 1e689c38..aae48894 100644 --- a/lightrag/api/__init__.py +++ b/lightrag/api/__init__.py @@ -1 +1 @@ -__api_version__ = "0256" +__api_version__ = "0257" From 4ab4a7ac949aa0bb96983b3e9eda46e977803d21 Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 28 Nov 2025 16:57:33 +0800 Subject: [PATCH 10/28] Allow embedding models to use provider defaults when unspecified - Set EMBEDDING_MODEL default to None - Pass model param only when provided - Let providers use their own defaults - Fix lollms embed function params - Add ollama embed_model default param --- lightrag/api/config.py | 8 ++- lightrag/api/lightrag_server.py | 91 +++++++++++++++++++++------------ lightrag/llm/ollama.py | 4 +- 3 files changed, 66 insertions(+), 37 deletions(-) diff --git a/lightrag/api/config.py b/lightrag/api/config.py index 4f59d3c1..4d8ab1e1 100644 --- a/lightrag/api/config.py +++ b/lightrag/api/config.py @@ -365,8 +365,12 @@ def parse_args() -> argparse.Namespace: # Inject model configuration args.llm_model = get_env_value("LLM_MODEL", "mistral-nemo:latest") - args.embedding_model = get_env_value("EMBEDDING_MODEL", "bge-m3:latest") - args.embedding_dim = get_env_value("EMBEDDING_DIM", 1024, int) + # EMBEDDING_MODEL defaults to None - each binding will use its own default model + # e.g., OpenAI uses "text-embedding-3-small", Jina uses "jina-embeddings-v4" + args.embedding_model = get_env_value("EMBEDDING_MODEL", None, special_none=True) + # EMBEDDING_DIM defaults to None - each binding will use its own default dimension + # Value is inherited from provider defaults via wrap_embedding_func_with_attrs decorator + args.embedding_dim = get_env_value("EMBEDDING_DIM", None, int, special_none=True) args.embedding_send_dim = get_env_value("EMBEDDING_SEND_DIM", False, bool) # Inject chunk configuration diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index 16e59d21..930358a7 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -713,6 +713,7 @@ def create_app(args): ) # Step 3: Create optimized embedding function (calls underlying function directly) + # Note: When model is None, each binding will use its own default model async def optimized_embedding_function(texts, embedding_dim=None): try: if binding == "lollms": @@ -724,9 +725,9 @@ def create_app(args): if isinstance(lollms_embed, EmbeddingFunc) else lollms_embed ) - return await actual_func( - texts, embed_model=model, host=host, api_key=api_key - ) + # lollms embed_model is not used (server uses configured vectorizer) + # Only pass base_url and api_key + return await actual_func(texts, base_url=host, api_key=api_key) elif binding == "ollama": from lightrag.llm.ollama import ollama_embed @@ -745,13 +746,16 @@ def create_app(args): ollama_options = OllamaEmbeddingOptions.options_dict(args) - return await actual_func( - texts, - embed_model=model, - host=host, - api_key=api_key, - options=ollama_options, - ) + # Pass embed_model only if provided, let function use its default (bge-m3:latest) + kwargs = { + "texts": texts, + "host": host, + "api_key": api_key, + "options": ollama_options, + } + if model: + kwargs["embed_model"] = model + return await actual_func(**kwargs) elif binding == "azure_openai": from lightrag.llm.azure_openai import azure_openai_embed @@ -760,7 +764,11 @@ def create_app(args): if isinstance(azure_openai_embed, EmbeddingFunc) else azure_openai_embed ) - return await actual_func(texts, model=model, api_key=api_key) + # Pass model only if provided, let function use its default otherwise + kwargs = {"texts": texts, "api_key": api_key} + if model: + kwargs["model"] = model + return await actual_func(**kwargs) elif binding == "aws_bedrock": from lightrag.llm.bedrock import bedrock_embed @@ -769,7 +777,11 @@ def create_app(args): if isinstance(bedrock_embed, EmbeddingFunc) else bedrock_embed ) - return await actual_func(texts, model=model) + # Pass model only if provided, let function use its default otherwise + kwargs = {"texts": texts} + if model: + kwargs["model"] = model + return await actual_func(**kwargs) elif binding == "jina": from lightrag.llm.jina import jina_embed @@ -778,13 +790,16 @@ def create_app(args): if isinstance(jina_embed, EmbeddingFunc) else jina_embed ) - return await actual_func( - texts, - model=model, - embedding_dim=embedding_dim, - base_url=host, - api_key=api_key, - ) + # Pass model only if provided, let function use its default (jina-embeddings-v4) + kwargs = { + "texts": texts, + "embedding_dim": embedding_dim, + "base_url": host, + "api_key": api_key, + } + if model: + kwargs["model"] = model + return await actual_func(**kwargs) elif binding == "gemini": from lightrag.llm.gemini import gemini_embed @@ -802,14 +817,19 @@ def create_app(args): gemini_options = GeminiEmbeddingOptions.options_dict(args) - return await actual_func( - texts, - model=model, - base_url=host, - api_key=api_key, - embedding_dim=embedding_dim, - task_type=gemini_options.get("task_type", "RETRIEVAL_DOCUMENT"), - ) + # Pass model only if provided, let function use its default (gemini-embedding-001) + kwargs = { + "texts": texts, + "base_url": host, + "api_key": api_key, + "embedding_dim": embedding_dim, + "task_type": gemini_options.get( + "task_type", "RETRIEVAL_DOCUMENT" + ), + } + if model: + kwargs["model"] = model + return await actual_func(**kwargs) else: # openai and compatible from lightrag.llm.openai import openai_embed @@ -818,13 +838,16 @@ def create_app(args): if isinstance(openai_embed, EmbeddingFunc) else openai_embed ) - return await actual_func( - texts, - model=model, - base_url=host, - api_key=api_key, - embedding_dim=embedding_dim, - ) + # Pass model only if provided, let function use its default (text-embedding-3-small) + kwargs = { + "texts": texts, + "base_url": host, + "api_key": api_key, + "embedding_dim": embedding_dim, + } + if model: + kwargs["model"] = model + return await actual_func(**kwargs) except ImportError as e: raise Exception(f"Failed to import {binding} embedding: {e}") diff --git a/lightrag/llm/ollama.py b/lightrag/llm/ollama.py index e35dc293..cd633e80 100644 --- a/lightrag/llm/ollama.py +++ b/lightrag/llm/ollama.py @@ -173,7 +173,9 @@ async def ollama_model_complete( @wrap_embedding_func_with_attrs(embedding_dim=1024, max_token_size=8192) -async def ollama_embed(texts: list[str], embed_model, **kwargs) -> np.ndarray: +async def ollama_embed( + texts: list[str], embed_model: str = "bge-m3:latest", **kwargs +) -> np.ndarray: api_key = kwargs.pop("api_key", None) if not api_key: api_key = os.getenv("OLLAMA_API_KEY") From 90f341d614bf393aae48080ba0f400da70e656eb Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 28 Nov 2025 10:31:52 +0100 Subject: [PATCH 11/28] Fix typos discovered by codespell --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 68d61eee..bd73f895 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,7 @@ For a streaming response implementation example, please see `examples/lightrag_o **Note 2**: Only `lightrag_openai_demo.py` and `lightrag_openai_compatible_demo.py` are officially supported sample codes. Other sample files are community contributions that haven't undergone full testing and optimization. -## Programing with LightRAG Core +## Programming with LightRAG Core > ⚠️ **If you would like to integrate LightRAG into your project, we recommend utilizing the REST API provided by the LightRAG Server**. LightRAG Core is typically intended for embedded applications or for researchers who wish to conduct studies and evaluations. @@ -313,7 +313,7 @@ A full list of LightRAG init parameters: | **vector_db_storage_cls_kwargs** | `dict` | Additional parameters for vector database, like setting the threshold for nodes and relations retrieval | cosine_better_than_threshold: 0.2(default value changed by env var COSINE_THRESHOLD) | | **enable_llm_cache** | `bool` | If `TRUE`, stores LLM results in cache; repeated prompts return cached responses | `TRUE` | | **enable_llm_cache_for_entity_extract** | `bool` | If `TRUE`, stores LLM results in cache for entity extraction; Good for beginners to debug your application | `TRUE` | -| **addon_params** | `dict` | Additional parameters, e.g., `{"language": "Simplified Chinese", "entity_types": ["organization", "person", "location", "event"]}`: sets example limit, entiy/relation extraction output language | language: English` | +| **addon_params** | `dict` | Additional parameters, e.g., `{"language": "Simplified Chinese", "entity_types": ["organization", "person", "location", "event"]}`: sets example limit, entity/relation extraction output language | language: English` | | **embedding_cache_config** | `dict` | Configuration for question-answer caching. Contains three parameters: `enabled`: Boolean value to enable/disable cache lookup functionality. When enabled, the system will check cached responses before generating new answers. `similarity_threshold`: Float value (0-1), similarity threshold. When a new question's similarity with a cached question exceeds this threshold, the cached answer will be returned directly without calling the LLM. `use_llm_check`: Boolean value to enable/disable LLM similarity verification. When enabled, LLM will be used as a secondary check to verify the similarity between questions before returning cached answers. | Default: `{"enabled": False, "similarity_threshold": 0.95, "use_llm_check": False}` |
@@ -364,7 +364,7 @@ class QueryParam: max_total_tokens: int = int(os.getenv("MAX_TOTAL_TOKENS", "30000")) """Maximum total tokens budget for the entire query context (entities + relations + chunks + system prompt).""" - # History mesages is only send to LLM for context, not used for retrieval + # History messages are only sent to LLM for context, not used for retrieval conversation_history: list[dict[str, str]] = field(default_factory=list) """Stores past conversation history to maintain context. Format: [{"role": "user/assistant", "content": "message"}]. @@ -1568,7 +1568,7 @@ Langfuse provides a drop-in replacement for the OpenAI client that automatically pip install lightrag-hku pip install lightrag-hku[observability] -# Or install from souce code with debug mode enabled +# Or install from source code with debug mode enabled pip install -e . pip install -e ".[observability]" ``` From ea8d55ab429394d8297b97778ed681a63a31f24c Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 28 Nov 2025 17:49:30 +0800 Subject: [PATCH 12/28] Add documentation for embedding provider configuration rules --- lightrag/api/lightrag_server.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index 930358a7..5f59085a 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -654,6 +654,17 @@ def create_app(args): 2. Extracts max_token_size and embedding_dim from provider if it's an EmbeddingFunc 3. Creates an optimized wrapper that calls the underlying function directly (avoiding double-wrapping) 4. Returns a properly configured EmbeddingFunc instance + + Configuration Rules: + - When EMBEDDING_MODEL is not set: Uses provider's default model and dimension + (e.g., jina-embeddings-v4 with 2048 dims, text-embedding-3-small with 1536 dims) + - When EMBEDDING_MODEL is set to a custom model: User MUST also set EMBEDDING_DIM + to match the custom model's dimension (e.g., for jina-embeddings-v3, set EMBEDDING_DIM=1024) + + Note: The embedding_dim parameter is automatically injected by EmbeddingFunc wrapper + when send_dimensions=True (enabled for Jina and Gemini bindings). This wrapper calls + the underlying provider function directly (.func) to avoid double-wrapping, so we must + explicitly pass embedding_dim to the provider's underlying function. """ # Step 1: Import provider function and extract default attributes From 90e38c20ca377201d91f2e19efacacb8faf2f14b Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 28 Nov 2025 15:04:53 +0100 Subject: [PATCH 13/28] Keep GitHub Actions up to date with GitHub's Dependabot * [Keeping your software supply chain secure with Dependabot](https://docs.github.com/en/code-security/dependabot) * [Keeping your actions up to date with Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot) * [Configuration options for the `dependabot.yml` file - package-ecosystem](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem) To see all GitHub Actions dependencies, type: % `git grep 'uses: ' .github/workflows/` --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..be006de9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# Keep GitHub Actions up to date with GitHub's Dependabot... +# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot +# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + groups: + github-actions: + patterns: + - "*" # Group all Actions updates into a single larger pull request + schedule: + interval: weekly From d2ab7fb246e51c2a36b5bcaef319c6b5ca8ab0b0 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 28 Nov 2025 16:15:16 +0100 Subject: [PATCH 14/28] Add Python 3.13 and 3.14 to the testing --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e7d00f4a..d09d4757 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,13 +13,13 @@ jobs: strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -45,7 +45,7 @@ jobs: - name: Upload test results if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: test-results-py${{ matrix.python-version }} path: | From 5c9642675b1a8552413c3a77acff8b9380b1ceac Mon Sep 17 00:00:00 2001 From: chaohuang-ai Date: Sun, 30 Nov 2025 00:17:04 +0800 Subject: [PATCH 15/28] Update README.md --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index bd73f895..3147e23c 100644 --- a/README.md +++ b/README.md @@ -51,24 +51,24 @@ --- ## 🎉 News -- [2025.11.05]🎯[New Feature]: Integrated **RAGAS for Evaluation** and **Langfuse for Tracing**. Updated the API to return retrieved contexts alongside query results to support context precision metrics. -- [2025.10.22]🎯[Scalability Enhancement]: Eliminated processing bottlenecks to support **Large-Scale Datasets Efficiently**. -- [2025.09.15]🎯Significantly enhances KG extraction accuracy for **small LLMs** like Qwen3-30B-A3B. -- [2025.08.29]🎯**Reranker** is supported now , significantly boosting performance for mixed queries(Set as default query mode now). -- [2025.08.04]🎯**Document deletion** with KG regeneration to ensure query performance. -- [2025.06.16]🎯Our team has released [RAG-Anything](https://github.com/HKUDS/RAG-Anything) an All-in-One Multimodal RAG System for seamless text, image, table, and equation processing. -- [2025.06.05]🎯LightRAG now supports comprehensive multimodal data handling through [RAG-Anything](https://github.com/HKUDS/RAG-Anything) integration, enabling seamless document parsing and RAG capabilities across diverse formats including PDFs, images, Office documents, tables, and formulas. Please refer to the new [multimodal section](https://github.com/HKUDS/LightRAG/?tab=readme-ov-file#multimodal-document-processing-rag-anything-integration) for details. -- [2025.03.18]🎯LightRAG now supports citation functionality, enabling proper source attribution. -- [2025.02.12]🎯You can now use MongoDB as all in-one Storage. -- [2025.02.05]🎯Our team has released [VideoRAG](https://github.com/HKUDS/VideoRAG) understanding extremely long-context videos. -- [2025.01.13]🎯Our team has released [MiniRAG](https://github.com/HKUDS/MiniRAG) making RAG simpler with small models. -- [2025.01.06]🎯You can now use PostgreSQL as all in-one Storage. -- [2024.11.19]🎯A comprehensive guide to LightRAG is now available on [LearnOpenCV](https://learnopencv.com/lightrag). Many thanks to the blog author. -- [2024.11.09]🎯Introducing the LightRAG Webui, which allows you to insert, query, visualize LightRAG knowledge. -- [2024.11.04]🎯You can now [use Neo4J for Storage](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#using-neo4j-for-storage). -- [2024.10.18]🎯We've added a link to a [LightRAG Introduction Video](https://youtu.be/oageL-1I0GE). Thanks to the author! -- [2024.10.17]🎯We have created a [Discord channel](https://discord.gg/yF2MmDJyGJ)! Welcome to join for sharing and discussions! 🎉🎉 -- [2024.10.16]🎯LightRAG now supports [Ollama models](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#quick-start)! +- [2025.11]🎯[New Feature]: Integrated **RAGAS for Evaluation** and **Langfuse for Tracing**. Updated the API to return retrieved contexts alongside query results to support context precision metrics. +- [2025.10]🎯[Scalability Enhancement]: Eliminated processing bottlenecks to support **Large-Scale Datasets Efficiently**. +- [2025.09]🎯[New Feature] Enhances knowledge graph extraction accuracy for **Open-Sourced LLMs** such as Qwen3-30B-A3B. +- [2025.08]🎯[New Feature] **Reranker** is now supported, significantly boosting performance for mixed queries (set as default query mode). +- [2025.08]🎯[New Feature] Added **Document Deletion** with automatic KG regeneration to ensure optimal query performance. +- [2025.06]🎯[New Release] Our team has released [RAG-Anything](https://github.com/HKUDS/RAG-Anything) — an **All-in-One Multimodal RAG** system for seamless processing of text, images, tables, and equations. +- [2025.06]🎯[New Feature] LightRAG now supports comprehensive multimodal data handling through [RAG-Anything](https://github.com/HKUDS/RAG-Anything) integration, enabling seamless document parsing and RAG capabilities across diverse formats including PDFs, images, Office documents, tables, and formulas. Please refer to the new [multimodal section](https://github.com/HKUDS/LightRAG/?tab=readme-ov-file#multimodal-document-processing-rag-anything-integration) for details. +- [2025.03]🎯[New Feature] LightRAG now supports citation functionality, enabling proper source attribution and enhanced document traceability. +- [2025.02]🎯[New Feature] You can now use MongoDB as an all-in-one storage solution for unified data management. +- [2025.02]🎯[New Release] Our team has released [VideoRAG](https://github.com/HKUDS/VideoRAG)-a RAG system for understanding extremely long-context videos +- [2025.01]🎯[New Release] Our team has released [MiniRAG](https://github.com/HKUDS/MiniRAG) making RAG simpler with small models. +- [2025.01]🎯You can now use PostgreSQL as an all-in-one storage solution for data management. +- [2024.11]🎯[New Resource] A comprehensive guide to LightRAG is now available on [LearnOpenCV](https://learnopencv.com/lightrag). — explore in-depth tutorials and best practices. Many thanks to the blog author for this excellent contribution! +- [2024.11]🎯[New Feature] Introducing the LightRAG WebUI — an interface that allows you to insert, query, and visualize LightRAG knowledge through an intuitive web-based dashboard. +- [2024.11]🎯[New Feature] You can now [use Neo4J for Storage](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#using-neo4j-for-storage)-enabling graph database support. +- [2024.10]🎯[New Feature] We've added a link to a [LightRAG Introduction Video](https://youtu.be/oageL-1I0GE). — a walkthrough of LightRAG's capabilities. Thanks to the author for this excellent contribution! +- [2024.10]🎯[New Channel] We have created a [Discord channel](https://discord.gg/yF2MmDJyGJ)!💬 Welcome to join our community for sharing, discussions, and collaboration! 🎉🎉 +- [2024.10]🎯[New Feature] LightRAG now supports [Ollama models](https://github.com/HKUDS/LightRAG?tab=readme-ov-file#quick-start)!
From aeaa0b32f9e51613633dafb3c3be16d4fc679e82 Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 1 Dec 2025 12:16:43 +0800 Subject: [PATCH 16/28] Add mhchem extension support for chemistry formulas in ChatMessage --- lightrag_webui/src/components/retrieval/ChatMessage.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lightrag_webui/src/components/retrieval/ChatMessage.tsx b/lightrag_webui/src/components/retrieval/ChatMessage.tsx index 7570f503..c9b67a87 100644 --- a/lightrag_webui/src/components/retrieval/ChatMessage.tsx +++ b/lightrag_webui/src/components/retrieval/ChatMessage.tsx @@ -76,10 +76,14 @@ export const ChatMessage = ({ ? message.content : (displayContent !== undefined ? displayContent : (message.content || '')) - // Load KaTeX dynamically + // Load KaTeX dynamically with mhchem extension for chemistry formulas useEffect(() => { const loadKaTeX = async () => { try { + // First load mhchem extension (must be loaded before rehype-katex) + // This enables \ce and \pu commands for chemistry formulas + await import('katex/contrib/mhchem'); + // Then load rehype-katex const { default: rehypeKatex } = await import('rehype-katex'); setKatexPlugin(() => rehypeKatex); } catch (error) { From 8f4bfbf1a3419dcce63efaca8948c29f1cd3785c Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 1 Dec 2025 12:20:17 +0800 Subject: [PATCH 17/28] Add KaTeX copy-tex extension support for formula copying --- lightrag_webui/src/components/retrieval/ChatMessage.tsx | 8 +++++--- lightrag_webui/src/types/katex.d.ts | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lightrag_webui/src/components/retrieval/ChatMessage.tsx b/lightrag_webui/src/components/retrieval/ChatMessage.tsx index c9b67a87..a4703e46 100644 --- a/lightrag_webui/src/components/retrieval/ChatMessage.tsx +++ b/lightrag_webui/src/components/retrieval/ChatMessage.tsx @@ -76,13 +76,15 @@ export const ChatMessage = ({ ? message.content : (displayContent !== undefined ? displayContent : (message.content || '')) - // Load KaTeX dynamically with mhchem extension for chemistry formulas + // Load KaTeX dynamically with extensions useEffect(() => { const loadKaTeX = async () => { try { - // First load mhchem extension (must be loaded before rehype-katex) - // This enables \ce and \pu commands for chemistry formulas + // Load KaTeX extensions (must be loaded before rehype-katex) + // 1. mhchem: enables \ce and \pu commands for chemistry formulas await import('katex/contrib/mhchem'); + // 2. copy-tex: allows users to copy rendered formulas as LaTeX source code + await import('katex/contrib/copy-tex'); // Then load rehype-katex const { default: rehypeKatex } = await import('rehype-katex'); setKatexPlugin(() => rehypeKatex); diff --git a/lightrag_webui/src/types/katex.d.ts b/lightrag_webui/src/types/katex.d.ts index de362150..499dbf30 100644 --- a/lightrag_webui/src/types/katex.d.ts +++ b/lightrag_webui/src/types/katex.d.ts @@ -1 +1,2 @@ declare module 'katex/contrib/mhchem'; +declare module 'katex/contrib/copy-tex'; From 112ed234c4413965c58a993675ae93abb9851134 Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 1 Dec 2025 12:20:27 +0800 Subject: [PATCH 18/28] Bump API version to 0258 --- lightrag/api/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/api/__init__.py b/lightrag/api/__init__.py index aae48894..417d3445 100644 --- a/lightrag/api/__init__.py +++ b/lightrag/api/__init__.py @@ -1 +1 @@ -__api_version__ = "0257" +__api_version__ = "0258" From 3f6423df33815f3efc5285cfbba869bdc989efb4 Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 1 Dec 2025 12:44:04 +0800 Subject: [PATCH 19/28] Fix KaTeX extension loading by moving imports to app startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Move mhchem/copy-tex to main.tsx • Add katex to Vite dedupe config • Remove dynamic extension loading • Ensure extensions available globally • Fix chemistry formula rendering --- .../src/components/retrieval/ChatMessage.tsx | 10 ++-------- lightrag_webui/src/main.tsx | 3 +++ lightrag_webui/vite.config.ts | 5 ++++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lightrag_webui/src/components/retrieval/ChatMessage.tsx b/lightrag_webui/src/components/retrieval/ChatMessage.tsx index a4703e46..e490941c 100644 --- a/lightrag_webui/src/components/retrieval/ChatMessage.tsx +++ b/lightrag_webui/src/components/retrieval/ChatMessage.tsx @@ -76,21 +76,15 @@ export const ChatMessage = ({ ? message.content : (displayContent !== undefined ? displayContent : (message.content || '')) - // Load KaTeX dynamically with extensions + // Load KaTeX rehype plugin dynamically + // Note: KaTeX extensions (mhchem, copy-tex) are imported statically in main.tsx useEffect(() => { const loadKaTeX = async () => { try { - // Load KaTeX extensions (must be loaded before rehype-katex) - // 1. mhchem: enables \ce and \pu commands for chemistry formulas - await import('katex/contrib/mhchem'); - // 2. copy-tex: allows users to copy rendered formulas as LaTeX source code - await import('katex/contrib/copy-tex'); - // Then load rehype-katex const { default: rehypeKatex } = await import('rehype-katex'); setKatexPlugin(() => rehypeKatex); } catch (error) { console.error('Failed to load KaTeX plugin:', error); - // Set to null to ensure we don't try to use a failed plugin setKatexPlugin(null); } }; diff --git a/lightrag_webui/src/main.tsx b/lightrag_webui/src/main.tsx index fb234a60..95a3e587 100644 --- a/lightrag_webui/src/main.tsx +++ b/lightrag_webui/src/main.tsx @@ -4,6 +4,9 @@ import './index.css' import AppRouter from './AppRouter' import './i18n.ts'; import 'katex/dist/katex.min.css'; +// Import KaTeX extensions at app startup to ensure they are registered before any rendering +import 'katex/contrib/mhchem'; // Chemistry formulas: \ce{} and \pu{} +import 'katex/contrib/copy-tex'; // Allow copying rendered formulas as LaTeX source diff --git a/lightrag_webui/vite.config.ts b/lightrag_webui/vite.config.ts index f39969c6..c89c34b4 100644 --- a/lightrag_webui/vite.config.ts +++ b/lightrag_webui/vite.config.ts @@ -10,7 +10,10 @@ export default defineConfig({ resolve: { alias: { '@': path.resolve(__dirname, './src') - } + }, + // Force all modules to use the same katex instance + // This ensures mhchem extension registered in main.tsx is available to rehype-katex + dedupe: ['katex'] }, // base: import.meta.env.VITE_BASE_URL || '/webui/', base: webuiPrefix, From d6019c82afa543ea3b248861c894fe11f226abb5 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 2 Dec 2025 00:17:41 +0800 Subject: [PATCH 20/28] Add CASCADE to AGE extension creation in PostgreSQL implementation - Add CASCADE option to CREATE EXTENSION - Ensure dependencies are installed - Fix potential AGE setup issues --- lightrag/kg/postgres_impl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index 1447a79e..49069ce3 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -383,7 +383,7 @@ class PostgreSQLDB: async def configure_age_extension(connection: asyncpg.Connection) -> None: """Create AGE extension if it doesn't exist for graph operations.""" try: - await connection.execute("CREATE EXTENSION IF NOT EXISTS age") # type: ignore + await connection.execute("CREATE EXTENSION IF NOT EXISTS AGE CASCADE") # type: ignore logger.info("PostgreSQL, AGE extension enabled") except Exception as e: logger.warning(f"Could not create AGE extension: {e}") From fc44f1136877e8acad8773ec8acaf3d760899067 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 2 Dec 2025 02:46:55 +0800 Subject: [PATCH 21/28] Remove future dependency and replace passlib with direct bcrypt --- pyproject.toml | 4 +--- uv.lock | 34 +++------------------------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 31667ab9..649ecb41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,6 @@ classifiers = [ dependencies = [ "aiohttp", "configparser", - "future", "google-api-core>=2.0.0,<3.0.0", "google-genai>=1.0.0,<2.0.0", "json_repair", @@ -54,7 +53,6 @@ api = [ # Core dependencies "aiohttp", "configparser", - "future", "json_repair", "nano-vectordb", "networkx", @@ -80,7 +78,7 @@ api = [ "httpcore", "httpx", "jiter", - "passlib[bcrypt]", + "bcrypt>=4.0.0", "psutil", "PyJWT>=2.8.0,<3.0.0", "python-jose[cryptography]", diff --git a/uv.lock b/uv.lock index fb483760..b07a8ea1 100644 --- a/uv.lock +++ b/uv.lock @@ -1334,15 +1334,6 @@ http = [ { name = "aiohttp" }, ] -[[package]] -name = "future" -version = "1.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a7/b2/4140c69c6a66432916b26158687e821ba631a4c9273c474343badf84d3ba/future-1.0.0.tar.gz", hash = "sha256:bd2968309307861edae1458a4f8a4f3598c03be43b97521076aebf5d94c07b05", size = 1228490, upload-time = "2024-02-21T11:52:38.461Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/da/71/ae30dadffc90b9006d77af76b393cb9dfbfc9629f339fc1574a1c52e6806/future-1.0.0-py3-none-any.whl", hash = "sha256:929292d34f5872e70396626ef385ec22355a1fae8ad29e1a734c3e43f9fbc216", size = 491326, upload-time = "2024-02-21T11:52:35.956Z" }, -] - [[package]] name = "gitdb" version = "4.0.12" @@ -2542,7 +2533,6 @@ source = { editable = "." } dependencies = [ { name = "aiohttp" }, { name = "configparser" }, - { name = "future" }, { name = "google-api-core" }, { name = "google-genai" }, { name = "json-repair" }, @@ -2567,10 +2557,10 @@ api = [ { name = "aiohttp" }, { name = "ascii-colors" }, { name = "asyncpg" }, + { name = "bcrypt" }, { name = "configparser" }, { name = "distro" }, { name = "fastapi" }, - { name = "future" }, { name = "google-api-core" }, { name = "google-genai" }, { name = "gunicorn" }, @@ -2585,7 +2575,6 @@ api = [ { name = "openai" }, { name = "openpyxl" }, { name = "pandas" }, - { name = "passlib", extra = ["bcrypt"] }, { name = "pipmaster" }, { name = "psutil" }, { name = "pycryptodome" }, @@ -2627,10 +2616,10 @@ offline = [ { name = "anthropic" }, { name = "ascii-colors" }, { name = "asyncpg" }, + { name = "bcrypt" }, { name = "configparser" }, { name = "distro" }, { name = "fastapi" }, - { name = "future" }, { name = "google-api-core" }, { name = "google-genai" }, { name = "gunicorn" }, @@ -2648,7 +2637,6 @@ offline = [ { name = "openai" }, { name = "openpyxl" }, { name = "pandas" }, - { name = "passlib", extra = ["bcrypt"] }, { name = "pipmaster" }, { name = "psutil" }, { name = "pycryptodome" }, @@ -2714,14 +2702,13 @@ requires-dist = [ { name = "ascii-colors", marker = "extra == 'api'" }, { name = "asyncpg", marker = "extra == 'api'" }, { name = "asyncpg", marker = "extra == 'offline-storage'", specifier = ">=0.29.0,<1.0.0" }, + { name = "bcrypt", marker = "extra == 'api'", specifier = ">=4.0.0" }, { name = "configparser" }, { name = "configparser", marker = "extra == 'api'" }, { name = "datasets", marker = "extra == 'evaluation'", specifier = ">=4.3.0" }, { name = "distro", marker = "extra == 'api'" }, { name = "docling", marker = "sys_platform != 'darwin' and extra == 'docling'", specifier = ">=2.0.0,<3.0.0" }, { name = "fastapi", marker = "extra == 'api'" }, - { name = "future" }, - { name = "future", marker = "extra == 'api'" }, { name = "google-api-core", specifier = ">=2.0.0,<3.0.0" }, { name = "google-api-core", marker = "extra == 'api'", specifier = ">=2.0.0,<3.0.0" }, { name = "google-api-core", marker = "extra == 'offline-llm'", specifier = ">=2.0.0,<3.0.0" }, @@ -2751,7 +2738,6 @@ requires-dist = [ { name = "openpyxl", marker = "extra == 'api'", specifier = ">=3.0.0,<4.0.0" }, { name = "pandas", specifier = ">=2.0.0,<2.4.0" }, { name = "pandas", marker = "extra == 'api'", specifier = ">=2.0.0,<2.4.0" }, - { name = "passlib", extras = ["bcrypt"], marker = "extra == 'api'" }, { name = "pipmaster" }, { name = "pipmaster", marker = "extra == 'api'" }, { name = "pre-commit", marker = "extra == 'evaluation'" }, @@ -4110,20 +4096,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ab/5f/b38085618b950b79d2d9164a711c52b10aefc0ae6833b96f626b7021b2ed/pandas-2.2.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:ad5b65698ab28ed8d7f18790a0dc58005c7629f227be9ecc1072aa74c0c1d43a", size = 13098436, upload-time = "2024-09-20T13:09:48.112Z" }, ] -[[package]] -name = "passlib" -version = "1.7.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b6/06/9da9ee59a67fae7761aab3ccc84fa4f3f33f125b370f1ccdb915bf967c11/passlib-1.7.4.tar.gz", hash = "sha256:defd50f72b65c5402ab2c573830a6978e5f202ad0d984793c8dde2c4152ebe04", size = 689844, upload-time = "2020-10-08T19:00:52.121Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3b/a4/ab6b7589382ca3df236e03faa71deac88cae040af60c071a78d254a62172/passlib-1.7.4-py2.py3-none-any.whl", hash = "sha256:aa6bca462b8d8bda89c70b382f0c298a20b5560af6cbfa2dce410c0a2fb669f1", size = 525554, upload-time = "2020-10-08T19:00:49.856Z" }, -] - -[package.optional-dependencies] -bcrypt = [ - { name = "bcrypt" }, -] - [[package]] name = "pillow" version = "11.3.0" From 2ecf77efe29d41a47952325c30753a60a1f95042 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 2 Dec 2025 02:52:31 +0800 Subject: [PATCH 22/28] Update help text to use correct gunicorn command with workers flag --- lightrag/api/run_with_gunicorn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/api/run_with_gunicorn.py b/lightrag/api/run_with_gunicorn.py index deabe7cf..e3bc0a8c 100644 --- a/lightrag/api/run_with_gunicorn.py +++ b/lightrag/api/run_with_gunicorn.py @@ -100,7 +100,7 @@ def main(): print("\nHow to fix:") print(" Option 1 - Set environment variable before starting (recommended):") print(" export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES") - print(" lightrag-server") + print(" lightrag-gunicorn --workers 2") print("\n Option 2 - Add to your shell profile (~/.zshrc or ~/.bash_profile):") print(" echo 'export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES' >> ~/.zshrc") print(" source ~/.zshrc") From 268e4ff6f15af316c07856327d7afe6603bb1185 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 2 Dec 2025 03:02:43 +0800 Subject: [PATCH 23/28] Refactor dependencies and add test extra in pyproject.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Pin httpx version in api extra • Extract test dependencies to new extra • Move httpx pin from evaluation to api • Add api dependency to evaluation extra • Separate test from evaluation concerns --- pyproject.toml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 649ecb41..761a3309 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,7 @@ api = [ "distro", "fastapi", "httpcore", - "httpx", + "httpx>=0.28.1", "jiter", "bcrypt>=4.0.0", "psutil", @@ -130,16 +130,18 @@ offline = [ "lightrag-hku[api,offline-storage,offline-llm]", ] -evaluation = [ - # Test framework dependencies +test = [ + "lightrag-hku[api]", "pytest>=8.4.2", "pytest-asyncio>=1.2.0", "pre-commit", "ruff", - # RAG evaluation dependencies (RAGAS framework) +] + +evaluation = [ + "lightrag-hku[api]", "ragas>=0.3.7", "datasets>=4.3.0", - "httpx>=0.28.1", ] observability = [ From ecef842cb5f7f7dff31476c27c516c0d37c71283 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 2 Dec 2025 03:47:47 +0800 Subject: [PATCH 24/28] Update GitHub Actions to use latest versions (v6) --- .github/workflows/copilot-setup-steps.yml | 4 ++-- .github/workflows/docker-build-lite.yml | 2 +- .github/workflows/docker-build-manual.yml | 2 +- .github/workflows/docker-publish.yml | 2 +- .github/workflows/linting.yaml | 4 ++-- .github/workflows/pypi-publish.yml | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 6b946ed1..618b80b4 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -23,10 +23,10 @@ jobs: # If you do not check out your code, Copilot will do this for you. steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Python 3.11 - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.11' diff --git a/.github/workflows/docker-build-lite.yml b/.github/workflows/docker-build-lite.yml index 9cbe6289..652c5649 100644 --- a/.github/workflows/docker-build-lite.yml +++ b/.github/workflows/docker-build-lite.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/docker-build-manual.yml b/.github/workflows/docker-build-manual.yml index de459d5a..31027304 100644 --- a/.github/workflows/docker-build-manual.yml +++ b/.github/workflows/docker-build-manual.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 # Fetch all history for tags diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6c290d59..b81d4f53 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 # Fetch all history for tags diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index aa054369..7aef7d13 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -14,10 +14,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: python-version: '3.x' diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 14c2bcc5..5c35eee2 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 # Fetch all history for tags @@ -40,7 +40,7 @@ jobs: echo "Frontend files:" ls -lh lightrag/api/webui/ | head -10 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.x" From 0f19f80fdbdc2f6dd08a7aea35013f1fead00030 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 2 Dec 2025 04:28:59 +0800 Subject: [PATCH 25/28] Configure comprehensive Dependabot for Python and frontend dependencies - Add pip ecosystem with grouping - Add bun ecosystem for webui - Set weekly update schedule - Configure cooldown periods - Ignore numpy breaking changes --- .github/dependabot.yml | 157 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index be006de9..ff191bf1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,6 +3,8 @@ # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem version: 2 updates: + # Enable version updates for GitHub Actions + # Workflow files stored in the default location of `.github/workflows` - package-ecosystem: github-actions directory: / groups: @@ -11,3 +13,158 @@ updates: - "*" # Group all Actions updates into a single larger pull request schedule: interval: weekly + labels: + - "dependencies" + - "github-actions" + open-pull-requests-limit: 5 + + # Configuration for pip (Python dependencies) + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + cooldown: + default-days: 5 + semver-major-days: 30 + semver-minor-days: 7 + semver-patch-days: 3 + groups: + # Core dependencies - LLM providers and embeddings + llm-providers: + patterns: + - "openai" + - "anthropic" + - "google-*" + - "boto3" + - "botocore" + - "ollama" + update-types: + - "minor" + - "patch" + # Storage backends + storage: + patterns: + - "neo4j" + - "pymongo" + - "redis" + - "psycopg*" + - "asyncpg" + - "milvus*" + - "qdrant*" + update-types: + - "minor" + - "patch" + # Data processing and ML + data-processing: + patterns: + # - "numpy" + - "scipy" + - "pandas" + - "tiktoken" + - "transformers" + - "torch*" + update-types: + - "minor" + - "patch" + # Web framework and API + web-framework: + patterns: + - "fastapi" + - "uvicorn" + - "gunicorn" + - "starlette" + - "pydantic*" + update-types: + - "minor" + - "patch" + # Development and testing tools + dev-tools: + patterns: + - "pytest*" + - "ruff" + - "pre-commit" + - "black" + - "mypy" + update-types: + - "minor" + - "patch" + # Minor and patch updates for everything else + python-minor-patch: + patterns: + - "*" + update-types: + - "minor" + - "patch" + ignore: + # numpy updates are disabled due to potential breaking changes + - dependency-name: "numpy" + labels: + - "dependencies" + - "python" + open-pull-requests-limit: 10 + + # Configuration for bun (Frontend dependencies) + - package-ecosystem: "bun" + directory: "/lightrag_webui" + schedule: + interval: "weekly" + cooldown: + default-days: 5 + semver-major-days: 30 + semver-minor-days: 7 + semver-patch-days: 3 + groups: + # React ecosystem + react: + patterns: + - "react" + - "react-dom" + - "react-router*" + - "@types/react*" + update-types: + - "minor" + - "patch" + # UI components and styling + ui-components: + patterns: + - "@radix-ui/*" + - "tailwind*" + - "@tailwindcss/*" + - "lucide-react" + - "class-variance-authority" + - "clsx" + update-types: + - "minor" + - "patch" + # Graph visualization + graph-viz: + patterns: + - "sigma" + - "@sigma/*" + - "graphology*" + update-types: + - "minor" + - "patch" + # Build tools and dev dependencies + build-tools: + patterns: + - "vite" + - "@vitejs/*" + - "typescript" + - "eslint*" + - "@eslint/*" + - "prettier" + update-types: + - "minor" + - "patch" + # All other minor and patch updates + frontend-minor-patch: + patterns: + - "*" + update-types: + - "minor" + - "patch" + labels: + - "dependencies" + - "frontend" + open-pull-requests-limit: 10 From 88357675ea9ec199c8c8c0c245aba913e30472cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 20:45:49 +0000 Subject: [PATCH 26/28] Bump the github-actions group with 7 updates Bumps the github-actions group with 7 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `2` | `6` | | [actions/setup-python](https://github.com/actions/setup-python) | `2` | `6` | | [docker/build-push-action](https://github.com/docker/build-push-action) | `5` | `6` | | [oven-sh/setup-bun](https://github.com/oven-sh/setup-bun) | `1` | `2` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4` | `5` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `4` | `6` | | [actions/stale](https://github.com/actions/stale) | `9` | `10` | Updates `actions/checkout` from 2 to 6 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v6) Updates `actions/setup-python` from 2 to 6 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v6) Updates `docker/build-push-action` from 5 to 6 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v5...v6) Updates `oven-sh/setup-bun` from 1 to 2 - [Release notes](https://github.com/oven-sh/setup-bun/releases) - [Commits](https://github.com/oven-sh/setup-bun/compare/v1...v2) Updates `actions/upload-artifact` from 4 to 5 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v5) Updates `actions/download-artifact` from 4 to 6 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v6) Updates `actions/stale` from 9 to 10 - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v9...v10) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/setup-python dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: docker/build-push-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: oven-sh/setup-bun dependency-version: '2' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/upload-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/download-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/stale dependency-version: '10' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/copilot-setup-steps.yml | 4 ++-- .github/workflows/docker-build-lite.yml | 4 ++-- .github/workflows/docker-build-manual.yml | 4 ++-- .github/workflows/docker-publish.yml | 4 ++-- .github/workflows/linting.yaml | 4 ++-- .github/workflows/pypi-publish.yml | 10 +++++----- .github/workflows/stale.yaml | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 6b946ed1..618b80b4 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -23,10 +23,10 @@ jobs: # If you do not check out your code, Copilot will do this for you. steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Python 3.11 - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.11' diff --git a/.github/workflows/docker-build-lite.yml b/.github/workflows/docker-build-lite.yml index 9cbe6289..76ae4cce 100644 --- a/.github/workflows/docker-build-lite.yml +++ b/.github/workflows/docker-build-lite.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 @@ -66,7 +66,7 @@ jobs: type=raw,value=lite - name: Build and push lite Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile.lite diff --git a/.github/workflows/docker-build-manual.yml b/.github/workflows/docker-build-manual.yml index de459d5a..780a288d 100644 --- a/.github/workflows/docker-build-manual.yml +++ b/.github/workflows/docker-build-manual.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 # Fetch all history for tags @@ -61,7 +61,7 @@ jobs: type=raw,value=${{ steps.get_tag.outputs.tag }} - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6c290d59..d0b1a305 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 # Fetch all history for tags @@ -63,7 +63,7 @@ jobs: type=raw,value=latest,enable=${{ steps.check_prerelease.outputs.is_prerelease == 'false' }} - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index aa054369..7aef7d13 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -14,10 +14,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: python-version: '3.x' diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 14c2bcc5..3539d8f6 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -13,13 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 # Fetch all history for tags # Build frontend WebUI - name: Setup Bun - uses: oven-sh/setup-bun@v1 + uses: oven-sh/setup-bun@v2 with: bun-version: latest @@ -40,7 +40,7 @@ jobs: echo "Frontend files:" ls -lh lightrag/api/webui/ | head -10 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.x" @@ -64,7 +64,7 @@ jobs: python -m build - name: Upload distributions - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: release-dists path: dist/ @@ -81,7 +81,7 @@ jobs: steps: - name: Retrieve release distributions - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v6 with: name: release-dists path: dist/ diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 30643dda..34634c9c 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -13,7 +13,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v9 + - uses: actions/stale@v10 with: days-before-stale: 90 # 90 days days-before-close: 7 # 7 days after marked as stale From f93bda585951ea2a743a4db915b1af37ef9feaab Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 2 Dec 2025 04:50:28 +0800 Subject: [PATCH 27/28] Enable numpy updates in dependabot configuration - Re-enable numpy in data-processing group - Remove numpy from ignore list - Allow minor and patch updates - Remove breaking change comment --- .github/dependabot.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ff191bf1..62ffb6b5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -57,7 +57,7 @@ updates: # Data processing and ML data-processing: patterns: - # - "numpy" + - "numpy" - "scipy" - "pandas" - "tiktoken" @@ -95,9 +95,6 @@ updates: update-types: - "minor" - "patch" - ignore: - # numpy updates are disabled due to potential breaking changes - - dependency-name: "numpy" labels: - "dependencies" - "python" From 445adfc9cb3d12ece8dbd1c184349c077250ee99 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 2 Dec 2025 05:17:28 +0800 Subject: [PATCH 28/28] Add name to lint-and-format job in GitHub workflow --- .github/workflows/linting.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 7aef7d13..499e4ce5 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -10,6 +10,7 @@ on: jobs: lint-and-format: + name: Linting and Formatting runs-on: ubuntu-latest steps: