This page documents the standard components available in RAGFlow's Canvas workflow system. These components serve as building blocks for constructing AI agent workflows, ranging from simple LLM invocations to complex multi-tool agent orchestrations with retrieval and conditional routing.
RAGFlow provides a library of built-in components that inherit from ComponentBase agent/component/base.py407-420 Each component consists of a parameter class (inheriting from ComponentParamBase agent/component/base.py43-54) and an implementation class that provides the _invoke or _invoke_async method.
Built-in components fall into several functional categories:
| Category | Components | Purpose |
|---|---|---|
| LLM Interaction | LLM, Agent, RewriteQuestion | Direct LLM calls with prompt templates and tool-augmented ReAct agents. |
| Information Retrieval | Retrieval, Search tools | Knowledge base search and context-aware content generation. |
| Control Flow | Categorize, Switch, Iteration, Loop | Conditional branching and repetitive execution logic. |
| Data & Logic | CodeExec, DataOperations, ListOperations, VariableAssigner | Manipulation of variables and data structures within the workflow. |
| Integration | Tool, Message, Invoke, DocGenerator, Crawler | External API calls, specialized tool functions, user communication, and web scraping. |
Sources: agent/component/base.py43-54 agent/component/base.py407-420 web/src/pages/agent/constant/index.tsx60-70 web/src/constants/agent.tsx69-122
The LLM component agent/component/llm.py86-101 provides direct access to language models with configurable prompts and generation parameters.
Sources: agent/component/llm.py34-83 agent/component/llm.py86-101 agent/component/base.py407-420 api/db/services/llm_service.py27
The LLM component supports variable references using the syntax {component_id@output_var} or {sys.variable}. Variables are resolved during invocation via string_format agent/component/llm.py127-134
The component automatically detects base64-encoded images in input variables via _extract_data_images agent/component/llm.py162-176 It handles vision-capable models by processing these images before sending the payload to the LLMBundle agent/component/llm.py180-214
Sources: agent/component/llm.py127-134 agent/component/llm.py162-176 agent/component/llm.py180-214
The Agent component agent/component/agent_with_tools.py74-95 implements a ReAct (Reasoning + Acting) loop that iteratively calls language models to plan actions, invoke tools, and reflect on results.
Sources: agent/component/agent_with_tools.py40-71 agent/component/agent_with_tools.py74-111 agent/tools/base.py29 agent/component/agent_with_tools.py104-111 common/mcp_tool_call_conn.py34
The agent loads tool components during initialization agent/component/agent_with_tools.py80-95 It handles tool calls by binding them to the LLMBundle agent/component/agent_with_tools.py113-116 The core execution logic follows the ReAct pattern where the LLM decides which tool to call based on prompts like kb_prompt or structured_output_prompt agent/component/agent_with_tools.py35 It supports MCP (Model Context Protocol) servers for external tool integration via MCPServerService agent/component/agent_with_tools.py104-112
Sources: agent/component/agent_with_tools.py80-95 agent/component/agent_with_tools.py113-116 agent/component/agent_with_tools.py104-112 agent/component/agent_with_tools.py35
The Retrieval component extracts information from specified datasets or memories to provide context for LLMs.
initialKeywordsSimilarityWeightValue controls this balance web/src/pages/agent/constant/index.tsx95rerank_id web/src/pages/agent/constant/index.tsx92Dataset and Memory sources web/src/pages/agent/constant/index.tsx82-85 In the UI, this is controlled via the retrieval_from field web/src/pages/agent/constant/index.tsx99use_kg web/src/pages/agent/constant/index.tsx96chunks_format rag/prompts/generator.py41-66Sources: web/src/pages/agent/constant/index.tsx82-110 rag/prompts/generator.py41-66 agent/canvas.py42
The Categorize component agent/component/categorize.py90-91 classifies user input into predefined categories and routes execution to different downstream components.
Sources: agent/component/categorize.py30-88 agent/component/categorize.py101-154 agent/component/categorize.py129-132 web/src/pages/agent/constant/index.tsx122-133
The Message component agent/component/message.py65-66 handles communication with the end-user, supporting streaming and variable interpolation.
variable_ref_patt to find and replace placeholders with actual values from the canvas agent/component/message.py193-216_stream to yield content chunks as they are resolved agent/component/message.py188-228queue_save_to_memory_task agent/component/message.py43doc_id, filename, mime_type) in values to populate the downloads output agent/component/message.py88-101Sources: agent/component/message.py46-63 agent/component/message.py188-228 agent/component/message.py88-101 agent/component/message.py43
The Switch component handles conditional branching based on logical operations. It supports multiple conditions with logical operators (AND/OR) web/src/constants/agent.tsx196-199
=, ≠, >, ≥, <, ≤, contains, empty, in, etc. web/src/constants/agent.tsx124-139end_cpn_ids web/src/pages/agent/constant/index.tsx80IterationStartNode web/src/pages/agent/canvas/index.tsx64 marks the entry point of the iteration block.LoopStartNode web/src/pages/agent/canvas/index.tsx67 represents the beginning of a loop cycle.Sources: web/src/pages/agent/canvas/index.tsx61-108 web/src/pages/agent/constant/index.tsx80 web/src/constants/agent.tsx124-199
The Invoke component agent/component/invoke.py57-58 allows workflows to interact with external HTTP APIs.
get, post, and put agent/component/invoke.py50json and formdata agent/component/invoke.py54_render_template agent/component/invoke.py125-133The Code component enables execution of Python or JavaScript snippets for dynamic data processing.
The Tool component serves as a wrapper for specialized search plugins:
Sources: agent/component/invoke.py50-182 web/src/constants/agent.tsx16-29 web/src/pages/agent/constant/index.tsx164-343 web/src/pages/agent/hooks/use-add-node.ts165
All components share a common lifecycle managed by ComponentBase agent/component/base.py407-420
Components store results using set_output(key, value) agent/component/base.py458-461 Special output keys include:
_ERROR: Captures execution errors agent/component/base.py463_elapsed_time: Tracks execution duration agent/component/base.py418Components can configure automated responses to failures via ComponentParamBase agent/component/base.py43-53:
Sources: agent/component/base.py43-53 agent/component/base.py407-585
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.