RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Let parallism of RAPTOR controlable. (#5379)
Kevin Hu96e9d50060cc
diff --git a/rag/raptor.py b/rag/raptor.pyindex 8c2547adf4..886ef1a9c3 100644--- a/rag/raptor.py+++ b/rag/raptor.py@@ -14,6 +14,7 @@# limitations under the License.#import logging+import osimport refrom concurrent.futures import ThreadPoolExecutor, ALL_COMPLETED, waitfrom threading import Lock@@ -122,7 +123,7 @@ class RecursiveAbstractiveProcessing4TreeOrganizedRetrieval:lbls = [np.where(prob > self._threshold)[0] for prob in probs]lbls = [lbl[0] if isinstance(lbl, np.ndarray) else lbl for lbl in lbls]lock = Lock()- with ThreadPoolExecutor(max_workers=12) as executor:+ with ThreadPoolExecutor(max_workers=int(os.environ.get('GRAPH_EXTRACTOR_MAX_WORKERS', 10))) as executor:threads = []for c in range(n_clusters):ck_idx = [i + start for i in range(len(lbls)) if lbls[i] == c]