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:
wizardchen
2026-05-12 19:36:28 +08:00
committed by lyingbug
parent 86b05d923e
commit 3f9b09e306
9 changed files with 49 additions and 1 deletions
+4
View File
@@ -4070,6 +4070,10 @@ export default {
boostLabel: 'FAQ 점수 가중치',
boostDesc: 'FAQ 관련성 점수에 이 계수를 곱하여 순위를 높입니다',
},
dataAnalysis: {
enableLabel: '표 데이터 분석 활성화',
enableDesc: '검색된 청크가 CSV/Excel 파일에서 온 경우, 답변 전에 LLM에 DuckDB SQL 쿼리를 생성하도록 요청합니다. LLM 호출이 한 번 더 발생하고 수 초의 지연이 추가되므로 SQL 스타일 분석이 실제로 필요할 때만 활성화하세요.',
},
fallback: {
fixed: '고정 응답',
model: '모델 생성',