Dataset Configuration UI#
The dataset settings page in RAGFlow uses a dynamic, chunk-method-driven form architecture: selecting a chunk method swaps in a method-specific configuration component, which in turn renders only the form fields relevant to that method.
Entry Point#
The top-level page is DatasetSettings (web/src/pages/dataset/dataset-setting/index.tsx). It owns the react-hook-form instance validated against formSchema (Zod), renders the general dataset fields, and conditionally mounts ChunkMethodForm when parse_type === ParseType.BuiltIn.
The form defaults chunk_method to DocumentParserType.Naive and initialises parser_config.compilation_template_group_id as an empty array . When the user switches to a Pipeline parse type, chunk_method is reset to Naive and the chunk-method section is hidden .
Dynamic Configuration Dispatch#
ChunkMethodForm (chunk-method-form.tsx) is the dispatch layer. It watches chunk_method via useWatch and looks up the active component from ConfigurationComponentMap :
chunk_method value | Component |
|---|---|
naive | NaiveConfiguration |
qa | QAConfiguration |
resume | ResumeConfiguration |
manual | ManualConfiguration |
table | TableConfiguration |
paper | PaperConfiguration |
book | BookConfiguration |
laws | LawsConfiguration |
presentation | PresentationConfiguration |
picture | PictureConfiguration |
one | OneConfiguration |
audio | AudioConfiguration |
email | EmailConfiguration |
tag | TagConfiguration |
knowledge_graph | KnowledgeGraphConfiguration |
If no method is selected, an EmptyComponent renders a blank <div> .
All configuration components live under web/src/pages/dataset/dataset-setting/configuration/.
Per-Method Configuration Components#
Each component uses ConfigurationFormContainer and MainContainer as layout wrappers, then composes reusable atomic form field components.
NaiveConfiguration is the most complete example — it includes:
CompilationTemplateFormField— compilation template group selector (see below)LayoutRecognizeFormField,MaxTokenNumberFormField,DelimiterFormField,ChildrenDelimiterForm,EnableTocToggle,ImageContextWindow,AutoMetadata,OverlappedPercentAutoKeywordsFormField,AutoQuestionsFormField,ExcelToHtmlFormField
Other methods are narrower: KnowledgeGraphConfiguration shows EntityTypesFormField + MaxTokenNumberFormField + DelimiterFormField; AudioConfiguration, EmailConfiguration, and PictureConfiguration show only the auto-tagging/metadata fields. QAConfiguration, ResumeConfiguration, and TagConfiguration are currently placeholder implementations returning empty fragments .
Shared per-section form items (ChunkMethodItem, ParseTypeItem, EnableTocToggle, ImageContextWindow, OverlappedPercent, AutoMetadata, LLMModelItem, etc.) are centralised in common-item.tsx.
CompilationTemplateFormField#
CompilationTemplateFormField (web/src/components/compilation-template-form-field.tsx) binds to parser_config.compilation_template_group_id by default. It wraps CompilationTemplateMultiSelect, which:
- Fetches all user-created template groups via
useFetchAllCompilationTemplateGroups. - Derives
selectedScopesfrom the current value to enforce the at-most-one-group-per-scope rule : once a"file"- or"dataset"-scope group is selected, all other groups sharing that scope are disabled in the picker. - Appends the scope label (
(file)/(dataset)) as a suffix on each option . - Normalises legacy single-string values into arrays during migration .
The field is used both in NaiveConfiguration (dataset-settings page) and directly in ChunkMethodDialog (the per-document chunk method dialog), where it appears when parseType === ParseType.BuiltIn.
For details on template group scopes, CRUD API, and the downstream compilation workflow, see the Compilation Template Management article.
Form Schema#
formSchema (Zod) covers the full settings payload including parser_config.compilation_template_group_id: z.array(z.string()).optional(). Custom superRefine validators enforce that a pipeline_id must be present when parse_type === Pipeline, that RAPTOR requires a prompt, and that GraphRAG requires at least one entity_type.
The same compilation_template_group_id array field is also declared in the ChunkMethodDialog's inline Zod schema .
Key Source Files#
| File | Role |
|---|---|
dataset-setting/index.tsx | Page root, form owner, chunk-method watcher |
dataset-setting/chunk-method-form.tsx | ConfigurationComponentMap dispatch |
dataset-setting/configuration/naive.tsx | Naive method config (most complete) |
dataset-setting/configuration/common-item.tsx | Shared form field atoms |
dataset-setting/form-schema.ts | Zod validation schema |
components/compilation-template-form-field.tsx | Compilation template group picker |
components/chunk-method-dialog/index.tsx | Per-document chunk method dialog (reuses same fields) |