Skip to content

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

Feat: Access the "Naive" and "Agentic" menu options on the chat page. (#20877)

balibabub5b69ca42f0d
diff --git a/web/src/components/message-input/next.tsx b/web/src/components/message-input/next.tsx
index 2cac903590..bfd05fdb46 100644
--- a/web/src/components/message-input/next.tsx
+++ b/web/src/components/message-input/next.tsx
@@ -51,13 +51,6 @@ export type NextMessageInputOnPressEnterParameter = {
omitSessionId?: boolean;
};
-// The selector only offers numeric thinking levels; a value persisted by a
-// since-removed mode is not one, so it falls back to the default rather than
-// reaching the request as NaN.
-function normalizeThinkingLevel(level: string) {
- return /^[0-5]$/.test(level) ? level : '1';
-}
-
interface NextMessageInputProps {
disabled: boolean;
value: string;
@@ -105,7 +98,7 @@ export function NextMessageInput({
);
const [enableThinking, setEnableThinking] = useState(() =>
- normalizeThinkingLevel(storage.getThinkingLevel()),
+ storage.getThinkingLevel(),
);
const [enableInternet, setEnableInternet] = useState(false);
@@ -161,33 +154,13 @@ export function NextMessageInput({
// Level 5 is not a deeper step on the same ladder: the backend hands it to
// the agentic RAG agent, which runs its own retrieval instead of the
- // pipeline's. It still sorts first as the highest-effort choice.
+ // pipeline's.
const thinkingOptions = [
{
label: t('chat.thinkingLevelAgentic'),
value: '5',
description: t('chat.thinkingLevelAgenticDescription'),
},
- {
- label: t('chat.thinkingLevelUltra'),
- value: '4',
- description: t('chat.thinkingLevelUltraDescription'),
- },
- {
- label: t('chat.thinkingLevelHigh'),
- value: '3',
- description: t('chat.thinkingLevelHighDescription'),
- },
- {
- label: t('chat.thinkingLevelMedium'),
- value: '2',
- description: t('chat.thinkingLevelMediumDescription'),
- },
- {
- label: t('chat.thinkingLevelLow'),
- value: '1',
- description: t('chat.thinkingLevelLowDescription'),
- },
{ label: t('chat.thinkingLevelNone'), value: '0' },
];
diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts
index f5a25287ee..aa62445d8b 100644
--- a/web/src/locales/en.ts
+++ b/web/src/locales/en.ts
@@ -1164,14 +1164,6 @@ This auto-tagging feature enhances retrieval by adding another layer of domain-s
thinkingEnabled: 'Enabled',
thinkingDisabled: 'Disabled',
thinkingLevelNone: 'Naive',
- thinkingLevelLow: 'Low',
- thinkingLevelLowDescription: 'Fast responses',
- thinkingLevelMedium: 'Medium',
- thinkingLevelMediumDescription: 'Balanced speed & depth',
- thinkingLevelHigh: 'High',
- thinkingLevelHighDescription: 'Deep reasoning',
- thinkingLevelUltra: 'Ultra',
- thinkingLevelUltraDescription: 'Maximum cognitive effort',
thinkingLevelAgentic: 'Agentic',
thinkingLevelAgenticDescription: 'Self-directed corpus exploration',
thinkingTip:
diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts
index 367c6b3659..d44f084698 100644
--- a/web/src/locales/zh.ts
+++ b/web/src/locales/zh.ts
@@ -1059,14 +1059,6 @@ NER:使用 spaCy NER 和基于规则的关键词提取来抽取 Entities 和 R
thinkingEnabled: '开启',
thinkingDisabled: '关闭',
thinkingLevelNone: 'Naive',
- thinkingLevelLow: 'Low',
- thinkingLevelLowDescription: '快速响应',
- thinkingLevelMedium: 'Medium',
- thinkingLevelMediumDescription: '平衡速度与深度',
- thinkingLevelHigh: 'High',
- thinkingLevelHighDescription: '深度推理',
- thinkingLevelUltra: 'Ultra',
- thinkingLevelUltraDescription: '尽力思考',
thinkingLevelAgentic: 'Agentic',
thinkingLevelAgenticDescription: '自主探索语料库',
thinkingTip:
diff --git a/web/src/pages/agent/form/tokenizer-form/index.tsx b/web/src/pages/agent/form/tokenizer-form/index.tsx
index 95b0b4ce4c..ae4501abda 100644
--- a/web/src/pages/agent/form/tokenizer-form/index.tsx
+++ b/web/src/pages/agent/form/tokenizer-form/index.tsx
@@ -78,6 +78,7 @@ const TokenizerForm = ({
onValueChange={field.onChange}
defaultValue={field.value}
variant="inverted"
+ disabled
/>
)}
</RAGFlowFormItem>
diff --git a/web/src/utils/authorization-util.ts b/web/src/utils/authorization-util.ts
index af54859e54..86abe7a7d8 100644
--- a/web/src/utils/authorization-util.ts
+++ b/web/src/utils/authorization-util.ts
@@ -69,8 +69,12 @@ const storage = {
setThinkingLevel: (level: string) => {
localStorage.setItem(ThinkingLevel, level);
},
+ // Only Naive (0) and Agentic (5) are offered; a level persisted by a
+ // since-removed option falls back to the Naive default rather than reaching
+ // the request as NaN.
getThinkingLevel: (): string => {
- return localStorage.getItem(ThinkingLevel) || '1';
+ const level = localStorage.getItem(ThinkingLevel);
+ return level === '0' || level === '5' ? level : '0';
},
};