Skip to content

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

Fix:limit random sampling range in check_embedding (#11337)

buua436ded9bf80c5f7
diff --git a/api/apps/kb_app.py b/api/apps/kb_app.py
index 53e42303f0..d0c4469dde 100644
--- a/api/apps/kb_app.py
+++ b/api/apps/kb_app.py
@@ -819,7 +819,7 @@ def check_embedding():
return []
n = min(n, total)
- offsets = sorted(random.sample(range(total), n))
+ offsets = sorted(random.sample(range(min(total,1000)), n))
out = []
for off in offsets: