From 50eb97762a2bb64ebd7fe4df3f11d4ad5412107a Mon Sep 17 00:00:00 2001 From: Konrad Wojciechowski Date: Thu, 20 Feb 2025 23:08:36 +0100 Subject: [PATCH] fix insert_custom_chunks skipping every new doc with "This document is already in the storage." --- lightrag/lightrag.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index db61788a..2dd1080d 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -524,7 +524,7 @@ class LightRAG: doc_key = compute_mdhash_id(full_text.strip(), prefix="doc-") new_docs = {doc_key: {"content": full_text.strip()}} - _add_doc_keys = await self.full_docs.filter_keys(set(doc_key)) + _add_doc_keys = await self.full_docs.filter_keys({doc_key}) new_docs = {k: v for k, v in new_docs.items() if k in _add_doc_keys} if not len(new_docs): logger.warning("This document is already in the storage.")