fix(pipeline): make data-analysis stage opt-in per agent (#1244)
The legacy in-pipeline DuckDB SQL data-analysis stage used to run on every quick-answer RAG request whose retrieved chunks included a CSV/Excel file, adding one extra LLM round-trip (~3s) to generate a SQL query that most plain Q&A users never wanted. There was no way to disable it. Introduce a per-agent DataAnalysisEnabled flag (default off), wire it through PipelineRequest, and gate the DATA_ANALYSIS stage on it. Surface the toggle in the agent editor for quick-answer agents with at least one knowledge base attached. Refs: https://github.com/Tencent/WeKnora/issues/1244
This commit is contained in:
@@ -199,6 +199,12 @@ func (s *sessionService) applyAgentOverridesToChatManage(
|
||||
logger.Infof(ctx, "FAQ priority enabled: threshold=%.2f, boost=%.2f",
|
||||
cm.FAQDirectAnswerThreshold, cm.FAQScoreBoost)
|
||||
}
|
||||
|
||||
// Data-analysis pipeline stage (opt-in, default off).
|
||||
cm.DataAnalysisEnabled = customAgent.Config.DataAnalysisEnabled
|
||||
if cm.DataAnalysisEnabled {
|
||||
logger.Infof(ctx, "Data analysis pipeline stage enabled by custom agent")
|
||||
}
|
||||
}
|
||||
|
||||
// restrictMentionsToAgentScope filters user-provided @mention targets (KB IDs
|
||||
|
||||
Reference in New Issue
Block a user