Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Refactor: get rid of graphrag and raptor during task creation (#19194)

Wang Qi51da97784b65
diff --git a/api/db/services/task_service.py b/api/db/services/task_service.py
index 7c14e3e652..f723d9c719 100644
--- a/api/db/services/task_service.py
+++ b/api/db/services/task_service.py
@@ -218,6 +218,9 @@ class TaskService(CommonService):
if not docs:
return None
doc = docs[0]
+ for config_key in ("parser_config", "kb_parser_config"):
+ if isinstance(doc.get(config_key), dict):
+ doc[config_key] = {key: value for key, value in doc[config_key].items() if key not in ("graphrag", "raptor")}
msg = f"\n{datetime.now().strftime('%H:%M:%S')} Task has been received."
prog = random.random() / 10.0
diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.py
index aada32fc38..ae5d3fa0f2 100644
--- a/rag/svr/task_executor.py
+++ b/rag/svr/task_executor.py
@@ -1753,6 +1753,8 @@ async def handle_task():
await asyncio.sleep(5)
return
+ logging.info(f"handle_task begin for task {json.dumps(task)}")
+
task_type = task["task_type"]
pipeline_task_type = TASK_TYPE_TO_PIPELINE_TASK_TYPE.get(task_type, PipelineTaskType.PARSE) or PipelineTaskType.PARSE
task_id = task["id"]