Skip to content

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

fix bug [ERROR][Exception]: 8 vs. 9 (#6955)

dylane54c0e39b58e
diff --git a/rag/raptor.py b/rag/raptor.py
index 99155e19d8..d09ea57193 100644
--- a/rag/raptor.py
+++ b/rag/raptor.py
@@ -77,11 +77,11 @@ class RecursiveAbstractiveProcessing4TreeOrganizedRetrieval:
return optimal_clusters
async def __call__(self, chunks, random_state, callback=None):
- layers = [(0, len(chunks))]
- start, end = 0, len(chunks)
if len(chunks) <= 1:
return []
chunks = [(s, a) for s, a in chunks if s and len(a) > 0]
+ layers = [(0, len(chunks))]
+ start, end = 0, len(chunks)
async def summarize(ck_idx: list[int]):
nonlocal chunks