Dataset Parsing Mode (BuiltIn vs Pipeline)#
Overview#
Every RAGFlow dataset has a parse_type that selects one of two mutually exclusive document-ingestion paths:
ParseType | Value | What happens |
|---|---|---|
BuiltIn | 1 | Documents are processed by one of RAGFlow's built-in chunk-method parsers (naive, paper, book, etc.) |
Pipeline | 2 | Documents are routed through a custom DataFlow Canvas pipeline (File → Parser → Chunker → Indexer) identified by pipeline_id |
The enum is defined in web/src/constants/knowledge.ts.
How parse_type Controls the UI#
The dataset settings page (web/src/pages/dataset/dataset-setting/index.tsx) watches parse_type via useWatch and conditionally renders two entirely different configuration panels :
ParseType.BuiltIn: Shows theChunkMethodItemdropdown (to pick a chunk method) and theChunkMethodForm(the per-method configuration panel). A "Learn More" sidebar also appears.ParseType.Pipeline: Hides chunk-method fields entirely and showsDataFlowSelect— a searchable dropdown that lets the user attach any existing DataFlow Canvas pipeline viapipeline_id.
Switching modes triggers a side-effect :
- Switching to BuiltIn clears
pipeline_id. - Switching to Pipeline resets
chunk_methodback toDocumentParserType.Naive(default).
The toggle itself is rendered by ParseTypeItem — a radio group with two options labeled "Built-In" and "Manual Setup" (i18n keys builtIn / manualSetup).
BuiltIn Mode: Chunk Methods#
When parse_type === BuiltIn, the active chunk_method is read from DocumentParserType, which maps to 14 parser slugs:
naive, qa, resume, manual, table, paper, book, laws, presentation, picture, one, audio, email, tag, knowledge_graph
ChunkMethodForm dispatches to a per-method configuration component via ConfigurationComponentMap (in chunk-method-form.tsx). See the Dataset Configuration UI article for the full dispatch table and per-method field breakdown.
The default is DocumentParserType.Naive .
Pipeline Mode: DataFlow Canvas#
When parse_type === Pipeline, the form field pipeline_id stores the ID of a DataFlow Canvas agent. DataFlowSelect (in web/src/components/data-pipeline-select/) fetches available pipelines via the /agents endpoint filtered by canvas_category: AgentCategory.DataflowCanvas.
A pipeline executes a fixed linear chain: File → Parser → Chunker → Indexer. See the Pipeline Canvas Architecture article for runtime details.
Backend Behavior#
parse_type is a request-only field — it is used at API validation time but is not persisted to the database. The service layer explicitly deletes it before saving (in api/apps/dataset_api_service.py). What gets stored instead are:
parser_id— the chosen chunk method slug (e.g."naive")pipeline_id— the DataFlow Canvas ID (nullable)
The API validation model (CreateDatasetReq) enforces mutual exclusivity: if chunk_method (i.e. parser_id) is provided, pipeline_id must be absent, and vice versa. If neither is present, the system defaults to chunk_method="naive".
The Knowledgebase and Document DB models both carry parser_id and pipeline_id fields, allowing per-document overrides at the document level as well.
Zod Form Validation#
The frontend enforces the same mutual-exclusivity constraint in formSchema (Zod): a superRefine validator requires a non-empty pipeline_id when parse_type === Pipeline, and requires a valid chunk_method otherwise.
Key Source Files#
| File | Role |
|---|---|
web/src/constants/knowledge.ts | ParseType enum definition |
web/src/pages/dataset/dataset-setting/index.tsx | Settings page: parse_type watcher, conditional rendering |
web/src/components/parse-type-form-field.tsx | ParseTypeItem radio toggle |
web/src/components/data-pipeline-select/index.tsx | DataFlowSelect pipeline picker |
web/src/pages/dataset/dataset-setting/form-schema.ts | Zod validation schema |
api/apps/dataset_api_service.py | Drops parse_type before DB write; stores parser_id / pipeline_id |
Related articles:
- Dataset Configuration UI — chunk method dispatch and per-method form components
- Pipeline Canvas Architecture — DataFlow Pipeline runtime, components, and execution model