Implementation:Infiniflow Ragflow Agent Constants
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Agent_System, Configuration |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete central registry of enums, constants, and configuration values for the agent workflow system in the RAGFlow frontend.
Description
The constants/agent.tsx module defines the Operator enum (listing all agent operator types like Retrieval, Generate, Categorize, Message, etc.), operator display metadata, default operator configurations, and connection validation rules. This is the single source of truth for agent workflow operator definitions on the frontend.
Usage
Import Operator enum and related constants when building agent canvas components, operator configuration forms, or workflow validation logic.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/constants/agent.tsx
- Lines: 1-230
Signature
export enum Operator {
Retrieval = 'Retrieval',
Generate = 'Generate',
Categorize = 'Categorize',
Message = 'Message',
Answer = 'Answer',
// ... 20+ operator types
}
export const operatorMap: Record<Operator, OperatorConfig>;
Import
import { Operator, operatorMap } from '@/constants/agent';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | Module-level constants; no inputs |
Outputs
| Name | Type | Description |
|---|---|---|
| Operator | enum | All agent operator type identifiers |
| operatorMap | Record | Operator metadata and default configs |
Usage Examples
import { Operator, operatorMap } from '@/constants/agent';
const config = operatorMap[Operator.Retrieval];
console.log(config.label, config.icon);