Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
roll back rerank topn setting (#11297)
Jyongc58d2fce89c0
diff --git a/api/.env.example b/api/.env.exampleindex 00b6c28a919..52cdd9ecb28 100644--- a/api/.env.example+++ b/api/.env.example@@ -413,4 +413,3 @@ RESET_PASSWORD_TOKEN_EXPIRY_MINUTES=5CREATE_TIDB_SERVICE_JOB_ENABLED=false-RETRIEVAL_TOP_N=0diff --git a/api/configs/feature/__init__.py b/api/configs/feature/__init__.pyindex e88eb980577..f1cb3efda7b 100644--- a/api/configs/feature/__init__.py+++ b/api/configs/feature/__init__.py@@ -626,8 +626,6 @@ class DataSetConfig(BaseSettings):default=30,)- RETRIEVAL_TOP_N: int = Field(description="number of retrieval top_n", default=0)-class WorkspaceConfig(BaseSettings):"""diff --git a/api/core/rag/datasource/retrieval_service.py b/api/core/rag/datasource/retrieval_service.pyindex 759166da4c4..b2141396d6d 100644--- a/api/core/rag/datasource/retrieval_service.py+++ b/api/core/rag/datasource/retrieval_service.py@@ -3,7 +3,6 @@ from typing import Optionalfrom flask import Flask, current_app-from configs import DifyConfigfrom core.rag.data_post_processor.data_post_processor import DataPostProcessorfrom core.rag.datasource.keyword.keyword_factory import Keywordfrom core.rag.datasource.vdb.vector_factory import Vector@@ -114,7 +113,7 @@ class RetrievalService:query=query,documents=all_documents,score_threshold=score_threshold,- top_n=DifyConfig.RETRIEVAL_TOP_N or top_k,+ top_n=top_k,)return all_documents@@ -186,7 +185,7 @@ class RetrievalService:query=query,documents=documents,score_threshold=score_threshold,- top_n=DifyConfig.RETRIEVAL_TOP_N or len(documents),+ top_n=len(documents),))else:@@ -231,7 +230,7 @@ class RetrievalService:query=query,documents=documents,score_threshold=score_threshold,- top_n=DifyConfig.RETRIEVAL_TOP_N or len(documents),+ top_n=len(documents),))else: