Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Langgenius Dify Pipeline Template Selection

From Leeroopedia
Knowledge Sources Dify
Domains RAG, Pipeline, Frontend
Last Updated 2026-02-12 00:00 GMT

Overview

Description

Pipeline Template Selection is the foundational step in the Dify RAG pipeline development workflow. It governs how users discover, browse, and select pre-configured pipeline templates that serve as starting points for building Retrieval-Augmented Generation (RAG) pipelines. Templates encapsulate proven configurations for document ingestion, chunking, embedding, and indexing, reducing the complexity of setting up a pipeline from scratch.

Dify supports two categories of templates:

  • Built-in templates -- Curated by the platform and available out of the box. These represent common RAG patterns such as general text chunking, QA-optimized chunking, and hierarchical (parent-child) chunking.
  • Customized templates -- Created by users who have published their own pipeline configurations as reusable templates. These allow teams to share and standardize their RAG pipeline designs across projects.

Each template carries metadata including a name, icon, description, positional ordering, and a chunk_structure field indicating the chunking strategy (e.g., text_model, qa_model, or hierarchical_model).

Usage

Pipeline Template Selection is used whenever a user:

  • Creates a new RAG pipeline and must choose a starting template from either built-in or customized catalogs.
  • Inspects a specific template to understand its graph structure (nodes, edges, viewport) before committing to it.
  • Filters templates by type or language to narrow down relevant options.
  • Evaluates whether to start from a built-in pattern or reuse a previously published customized pipeline.

The selection step feeds directly into the pipeline editor, where the chosen template's graph is loaded for further configuration and customization.

Theoretical Basis

The template selection pattern follows the Template Method design philosophy common in workflow-oriented platforms. By offering parameterized starting points, the system reduces the cognitive load on users while still allowing full customization downstream. This aligns with the broader principle of progressive disclosure in user interface design -- users begin with a high-level choice and refine details incrementally.

In the context of RAG systems, template selection is critical because the choice of chunking strategy fundamentally affects retrieval quality:

  • Text Model (General) -- Splits documents into uniformly-sized chunks optimized for semantic similarity search.
  • QA Model -- Structures chunks as question-answer pairs, improving retrieval precision for FAQ-style use cases.
  • Hierarchical Model (Parent-Child) -- Creates multi-level chunk hierarchies enabling both broad-context and fine-grained retrieval.

The template abstraction also enables infrastructure-as-code patterns: the full pipeline graph (including nodes, edges, and viewport layout) is serializable as a DSL, supporting import/export workflows.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment