diff --git a/docs/administrator/admin/admin_ui.md b/docs/administrator/admin/admin_ui.md deleted file mode 100644 index ae90bb9738..0000000000 --- a/docs/administrator/admin/admin_ui.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -sidebar_position: 1 -slug: /admin_ui -sidebar_custom_props: { - categoryIcon: LucidePalette -} ---- -# Admin UI - -The RAGFlow Admin UI is a web-based interface that provides comprehensive system status monitoring and user management capabilities. - - -## Accessing the Admin UI - -To access the RAGFlow admin UI, append `/admin` to the web UI's address, e.g. `http://[RAGFLOW_WEB_UI_ADDR]/admin`, replace `[RAGFLOW_WEB_UI_ADDR]` with real RAGFlow web UI address. - -### Default Credentials -| Username | Password | -|--------------------|----------| -| `admin@ragflow.io` | `admin` | - -## Admin UI Overview - -### Service status - -The service status page displays of all services within the RAGFlow system. - -- **Service List**: View all services in a table. -- **Filtering**: Use the filter button to filter services by **Service Type**. -- **Search**: Use the search bar to quickly find services by **Name** or **Service Type**. -- **Actions** (hover over a row to see action buttons): - - **Extra Info**: Display additional configuration information of a service in a dialog. - - **Service Details**: Display detailed status information of a service in a dialog. According to service's type, a service's status information could be displayed as a plain text, a key-value data list, a data table or a bar chart. - -### User management - -The user management page provides comprehensive tools for managing all users in the RAGFlow system. - -- **User List**: View all users in a table. -- **Search Users**: Use the search bar to find users by email or nickname. -- **Filter Users**: Click the filter icon to filter by **Status**. -- Click the **"New User"** button to create a new user account in a dialog. -- Activate or deactivate a user by using the switch toggle in **Enable** column, changes take effect immediately. -- **Actions** (hover over a row to see action buttons): - - **View Details**: Navigate to the user detail page to see comprehensive user information. - - **Change Password**: Force reset the user's password. - - **Delete User**: Remove the user from the system with confirmation. - - -### User detail - -The user detail page displays a user's detailed information and all resources created or owned by the user, categorized by type (e.g. Dataset, Agent). \ No newline at end of file diff --git a/docs/administrator/admin/admin_ui/_category_.json b/docs/administrator/admin/admin_ui/_category_.json new file mode 100644 index 0000000000..342c355628 --- /dev/null +++ b/docs/administrator/admin/admin_ui/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Admin UI", + "link": { + "type": "generated-index", + "description": "Admin UI." + }, + "position": 1, + "customProps": { + "categoryIcon": "LucidePalette" + } +} diff --git a/docs/administrator/admin/admin_ui/before_you_begin.md b/docs/administrator/admin/admin_ui/before_you_begin.md new file mode 100644 index 0000000000..88e871e8f2 --- /dev/null +++ b/docs/administrator/admin/admin_ui/before_you_begin.md @@ -0,0 +1,33 @@ +--- +sidebar_position: 1 +sidebar_label: "Before You Begin" +--- + +# Before You Begin + +## Access the Admin UI + +System administrators can access the RAGFlow Admin UI in a browser. The current Admin UI entry point is `/admin`, for example `http://192.168.1.5/admin`. + +After entering the Admin UI, administrators can perform service health checks, maintain user accounts, configure sandboxes, control registration, manage roles and permissions, configure system settings, and configure identity providers. The Admin UI should be exposed only to trusted administrators. + +![Enter The Admin Console](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/enter_the_admin_console.jpg) + +Regular users do not need to enter the Admin UI when they use business features such as knowledge bases, chat, Agent, files, and model providers. + +## Initial Administrator Account + +After the first deployment, you can log in with the default administrator account: + +| Field | Value | +| --- | --- | +| Username | `admin@ragflow.io` | +| Default password | `admin` | + +This account is used to initialize the system and create subsequent administrator accounts. It is not recommended as a long-term shared daily operations account. + +After the first login, reset the default password as soon as possible and create separate accounts for different administrators. In daily administration, grant the `Superuser` identity only to users who actually need Admin UI responsibilities. + +## Change the Admin Account Password + +This feature is not available yet. diff --git a/docs/administrator/admin/admin_ui/check_system_status.md b/docs/administrator/admin/admin_ui/check_system_status.md new file mode 100644 index 0000000000..8649c2a92f --- /dev/null +++ b/docs/administrator/admin/admin_ui/check_system_status.md @@ -0,0 +1,46 @@ +--- +sidebar_position: 2 +sidebar_label: "Check System Status" +--- + +# Check System Status + +## Check Whether Services Are Running Normally + +After entering the Admin UI, open the **Service status** page to view the runtime status of RAGFlow and its dependent services. The page displays each service's name, service type, host, port, and current status, so administrators can confirm whether all system components are running normally. + +![Check Whether Services Are Normal](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/check_whether_services_are_normal.jpg) + +When **Status** is `Alive`, the service is running normally. Any other status may affect the corresponding features. + +![System Status](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/system_status.jpg) + +| Service name | Main purpose | Possible issues when abnormal | Affected features | +| --- | --- | --- | --- | +| RAGFlow Server | Core system service responsible for the Web UI, APIs, knowledge bases, Q&A, Agent, and other business features. | The system cannot be accessed, login fails, pages report errors, or all features become unavailable. | Login, knowledge base management, knowledge applications, Agent, model management, system management, and all other features. | +| MySQL | Stores business data such as users, knowledge bases, model configurations, and system configurations. | Login fails, knowledge base data cannot be read, configurations cannot be saved, or business data becomes abnormal. | User management, knowledge base management, model configuration, system configuration, and business data reads and writes. | +| MinIO | Stores uploaded documents, images, and other object files. | File upload fails, documents cannot be opened, parsing fails, or images cannot be displayed. | File upload, document management, document parsing, file preview, and download. | +| Elasticsearch | Builds full-text and vector indexes and provides knowledge retrieval capabilities. | Documents cannot be retrieved, searches return no results, Q&A cannot cite knowledge, or knowledge recall is abnormal. | Full-text retrieval, vector retrieval, hybrid retrieval, knowledge Q&A, and knowledge citation. | +| Redis (Valkey) | Provides cache and task status management to improve system runtime efficiency. | Pages respond slowly, sessions become abnormal, or some features run abnormally. | System cache, session management, task status management, and some backend features. | +| RabbitMQ | Manages backend asynchronous tasks and sends tasks to executors. | Documents remain in `Waiting for processing`, or backend tasks cannot start. | Asynchronous task scheduling for document parsing, knowledge compilation, Embedding, and index building. | +| Task Executor | Executes backend tasks such as document parsing, OCR, Embedding, and index building. | Documents remain in `Parsing`, knowledge cannot be imported, or indexes cannot be built. | OCR, document parsing, Embedding, knowledge ingestion, index building, and other backend processing tasks. | + +## View Service Details + +On the **Service status** page, administrators can view the service `ID`, `Name`, `Service type`, `Host`, `Port`, and `Status`. When `Status` is `Alive`, the service is currently alive. + +Administrators can open service details from **Actions**. Different services display different details. For example, the `mysql` service details show current database connection and process information, including `command`, `db`, `host`, `id`, `info`, `state`, `time`, and `user`. Administrators can use this information to determine whether there are long-running connections, waiting states, or abnormal queries. + +![View Service Details](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/view_service_details_1.jpg) + +![View Service Details](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/view_service_details_2.jpg) + +Some services also provide an **Extra information** dialog that displays supplementary configuration information. For example, an object storage service may display information such as `store_type` and `user`. This information is mainly used to confirm service configuration. + +![View Service Details](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/view_service_details_3.jpg) + +![View Service Details](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/view_service_details_4.jpg) + +If a service's `Status` is not `Alive`, first record its `ID`, `Name`, `Service type`, `Host`, `Port`, and any abnormal information visible in the details dialog or **Extra information**. + +The Admin UI is mainly used to view service status. It does not provide direct troubleshooting entry points for containers, processes, networks, or logs. For further handling, check the corresponding deployment environment, including service runtime status, port connectivity, service logs, and related configurations. After identifying the cause, restart services, adjust configurations, or perform other recovery operations according to your operations process. diff --git a/docs/administrator/admin/admin_ui/configure_code_execution_sandbox.md b/docs/administrator/admin/admin_ui/configure_code_execution_sandbox.md new file mode 100644 index 0000000000..7f4a1e4bdb --- /dev/null +++ b/docs/administrator/admin/admin_ui/configure_code_execution_sandbox.md @@ -0,0 +1,153 @@ +--- +sidebar_position: 4 +sidebar_label: "Configure Code Execution Sandbox" +--- + +# Configure Code Execution Sandbox + +## Select a Sandbox Provider + +If your organization uses the **Code** component in Agent, administrators must configure the code execution sandbox in **Sandbox settings**. + +The current page supports the following `Provider` options: + +| Provider | Description | +| --- | --- | +| `Local` | Execute code directly in the current host process. | +| `Self-Managed` | Use Daytona or Docker for localized deployment. | +| `SSH` | Execute code on a remote machine through SSH. | +| `AliyunCodeInterpreter` | Use Alibaba Cloud Function Compute Code Interpreter. | +| `E2B` | Use E2B Cloud Code Execution Sandboxes. | + +After selecting a `Provider`, the page displays the corresponding configuration area. + +![Select Sandbox Provider](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/select_sandbox_provider.jpg) + +**Caution:** Sandbox configuration affects not only connection availability, but also code isolation, network access, file access, and runtime resource limits. In production environments, prefer `Self-Managed`, cloud, or independent remote execution solutions with isolation capabilities. Direct use of `Local` is not recommended. + +| Provider | Applicable scenario | Main characteristics | Recommendation | +| --- | --- | --- | --- | +| `Local` | Local development and functional debugging | Runs code directly on the current host and is easy to configure. | Recommended only for controlled development and test environments. | +| `Self-Managed` | Enterprise intranet and private deployment | Uses a self-managed sandbox service to execute code. Data and runtime environments can be controlled independently. | Suitable for production environments and scenarios with high data security requirements. | +| `SSH` | Existing independent execution servers | Executes code on a remote host through SSH. | Suitable for reusing existing servers or custom runtime environments. | +| `AliyunCodeInterpreter` | Alibaba Cloud-related services | Uses a cloud service to provide the code execution environment, making elastic scaling easier. | Suitable for organizations already using the corresponding cloud service. | +| `E2B` | Fast access to a cloud sandbox | Executes code in an isolated environment provided by E2B. | Suitable for scenarios that need quick use without deployment. | + +## Test and Save Configuration + +When configuring a sandbox, first fill in the connection information and runtime parameters required by the selected `Provider`, then use **Test connection** to verify availability. After the test succeeds, click **Save**. + +## Local Runtime Configuration + +`Local configuration` configures the local code execution environment. The system uses the following configuration when executing code tasks such as Python and Node.js. + +1. Go to **Local Configuration**. +2. Configure each parameter according to the actual runtime environment. +3. Click **Test connection** to test whether the configuration is correct. +4. After the test succeeds, click **Save**. + +| Parameter | Description | Recommendation | +| --- | --- | --- | +| `Working Directory` | Working directory used during code execution, for temporary files generated during runtime. | Keep the default, or configure a local directory with read and write permissions. | +| `Python Binary` | Python executable name or path. | Usually `python3`. If using a virtual environment, enter the full Python path. | +| `Node.js Binary` | Node.js executable name or path. | Usually `node`. If installed elsewhere, enter the full path. | +| `Max Artifact Size (bytes)` | Maximum allowed size for a single generated file. | Configure according to business needs. The default usually satisfies common use. | +| `Max Artifacts` | Maximum number of files allowed in one run. | Keep the default to avoid generating too many temporary files. | +| `Max Memory (MB)` | Maximum memory available to a single code run. | Configure according to server resources. Increase it when resources are sufficient. | +| `Max Output (bytes)` | Maximum length of console output. | Keep the default to avoid oversized output. | +| `Timeout (seconds)` | Maximum runtime for a single code execution. | Set according to the business scenario. The task is terminated automatically after timeout. | + +If Python or Node.js is not installed, or the executable path is wrong, the connection test fails. + +## Self-Managed Configuration + +`Self-Managed` configuration connects to a deployed `SandboxExecutorManager` service for remote sandbox execution. If the code execution service is deployed on an independent server or in a container, complete this configuration. + +1. Go to **Self-Managed Configuration**. +2. Configure the code execution service connection information. +3. Click **Test connection** to test whether the connection is normal. +4. After the test succeeds, click **Save**. + +| Parameter | Description | Recommendation | +| --- | --- | --- | +| `Executor Manager Endpoint` | Access address of the `SandboxExecutorManager` service. | Enter the HTTP address of the code execution service, such as `http://sandbox-executor-manager:9385` or `http://:9385`. Make sure RAGFlow can access this address. | +| `Request Timeout (seconds)` | Timeout for requests to the code execution service. | Configure according to the network environment and code execution duration. The default 30 seconds is sufficient for most cases; increase it for large tasks. | + +`Executor Manager Endpoint` must be the address of a deployed and normally running `SandboxExecutorManager` service. + +`Deployment Defaults` displays the current default deployment parameters of `SandboxExecutorManager`. + +## SSH Configuration + +`SSH` configuration connects to a remote Linux host and executes Python, Node.js, and other code tasks on the remote server. After configuration, the system logs in to the specified server through SSH and executes code in the remote working directory. + +1. Go to **System management > Model service > SSH Configuration**. +2. Fill in the remote server connection information. +3. Select the authentication method: password authentication or private-key authentication. +4. Configure the remote code runtime environment. +5. Click **Test connection** to test whether the connection is normal. +6. After the test succeeds, click **Save**. + +### SSH Connection Configuration + +| Parameter | Description | Recommendation | +| --- | --- | --- | +| `SSH Host` | Remote server IP address or host name. | For example, `192.168.1.10` or `server.example.com`. | +| `SSH Username` | User name used to log in to the remote server. | Enter a user with code execution permissions, such as `root`, `ubuntu`, or `ragflow`. | +| `SSH Port` | Port on which the SSH service listens. | The default is `22`. If the server uses another SSH port, enter the actual port. | + +### Authentication + +The system supports `Password` and `PrivateKey` authentication. + +| Authentication method | Description | Recommendation | +| --- | --- | --- | +| `Password` | Uses the SSH user password for authentication. | Fill in `SSH Password`. | +| `PrivateKey` | Uses an SSH private key for authentication. | Fill in the SSH private key content. If the private key has a password, also fill in the corresponding `Passphrase`. Private-key authentication is recommended in production. | + +### Execution + +| Parameter | Description | Recommendation | +| --- | --- | --- | +| `Remote Workspace Root` | Working directory on the remote server for temporary files generated during code runs. | Configure a directory with read and write permissions, such as `/tmp` or `/home/ragflow/workspace`. | +| `Python Binary` | Python executable name or full path. | Usually `python3`. If using a virtual environment, enter the full Python path. | +| `Node.js Binary` | Node.js executable name or full path. | Usually `node`. If installed elsewhere, enter the full path. | +| `Max Artifact Bytes` | Maximum allowed size for a single generated file. | Keep the default or adjust according to business needs. | +| `Max Artifacts` | Maximum number of files allowed in one run. | Keep the default configuration. | +| `Max Output Bytes` | Maximum size of console output. | Keep the default. Output exceeding the limit is truncated. | +| `Timeout (seconds)` | Maximum runtime for a single code execution. | The default is 30 seconds. Increase it when execution takes longer. | + +Make sure the remote server has SSH enabled and allows the current user to log in. The configured user must have read and write permissions on the remote working directory and be able to execute Python, Node.js, and other runtime environments. When using private-key authentication, make sure the private key matches the server configuration. + +## Alibaba Cloud CodeInterpreter Configuration + +Alibaba Cloud `CodeInterpreter` configuration connects to Alibaba Cloud CodeInterpreter. The system executes code tasks through this service. + +1. Go to **AliyunCodeInterpreter Configuration**. +2. Fill in the connection information for Alibaba Cloud CodeInterpreter. +3. Click **Test connection** to test whether the connection is normal. +4. After the test succeeds, click **Save**. + +| Parameter | Description | Recommendation | +| --- | --- | --- | +| `AccessKeyID` | Alibaba Cloud account `AccessKeyID` for authentication. | Enter an `AccessKeyID` with access to the CodeInterpreter service. | +| `AccessKeySecret` | Secret corresponding to `AccessKeyID`. | Enter the corresponding `AccessKeySecret` and keep it secure to avoid leakage. | +| `AccountID` | Alibaba Cloud account ID. | Enter the current Alibaba Cloud account ID. | +| `Region` | Region where the CodeInterpreter service is located. | Enter the actual deployment region, such as `cn-hangzhou`. | +| `TemplateName` | Template name used by CodeInterpreter. | Enter the created template name, such as `my-interpreter`. | +| `ExecutionTimeout (seconds)` | Maximum runtime allowed for a single code execution. | The default is 30 seconds. Adjust according to business needs. | + +## E2B Configuration + +`E2B` configuration connects to the E2B Cloud code execution service. After configuration, the system executes code tasks through the E2B cloud sandbox. + +1. Go to **E2B**. +2. Fill in the E2B service connection information. +3. Click **Test connection** to test whether the connection is normal. +4. After the test succeeds, click **Save**. + +| Parameter | Description | Recommendation | +| --- | --- | --- | +| `API Key` | API key provided by E2B Cloud for authentication. | Log in to the E2B platform, create the corresponding API key, and enter it. | +| `Region` | Region where the E2B service is located. | Enter the actual region, such as `us`. | +| `Request Timeout (seconds)` | Timeout for requests to the E2B service. | The default is 30 seconds. Increase it if the network is slow or execution takes longer. | diff --git a/docs/administrator/admin/admin_ui/configure_user_roles_and_permissions_enterprise.md b/docs/administrator/admin/admin_ui/configure_user_roles_and_permissions_enterprise.md new file mode 100644 index 0000000000..6d2c7558ce --- /dev/null +++ b/docs/administrator/admin/admin_ui/configure_user_roles_and_permissions_enterprise.md @@ -0,0 +1,30 @@ +--- +sidebar_position: 6 +sidebar_label: "Configure User Roles and Permissions (Enterprise Edition)" +--- + +# Configure User Roles and Permissions (Enterprise Edition) + +## Maintain Roles + +Enterprise Edition maintains roles and permissions through the **Roles** page. Administrators can view existing roles on this page and create new roles through **New role**. + +The current page displays a permission matrix under each role. Visible resources include `Dataset`, `Chat`, `Agent`, `Search`, `File`, `Team`, `Memory`, and `Model provider`. Visible actions include `Enable`, `Read`, `Write`, and `Share`. + +Administrators should configure roles according to user responsibilities and should not grant ordinary users resource permissions beyond what their work requires. + +![Maintain Roles](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/maintain_roles.jpg) + +![Role Management](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/role_management.jpg) + +**Note:** Modifying role permissions affects users' access scope for knowledge bases, chat, Agent, search, files, teams, memory, model providers, and other resources. + +## Assign Roles to Users + +In Enterprise Edition, a user's `Role` can be assigned on the **User management** page. Administrators can click the target user's current `Role` and select a new role from the role list. + +1. Go to the **User management** page. +2. Find the target user and open the role dropdown in the `Role` column. +3. Select the new role. + +![Assign Roles To Users](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/assign_roles_to_users.jpg) diff --git a/docs/administrator/admin/admin_ui/control_registration_and_system_settings_enterprise.md b/docs/administrator/admin/admin_ui/control_registration_and_system_settings_enterprise.md new file mode 100644 index 0000000000..bef3a915e2 --- /dev/null +++ b/docs/administrator/admin/admin_ui/control_registration_and_system_settings_enterprise.md @@ -0,0 +1,35 @@ +--- +sidebar_position: 5 +sidebar_label: "Control Registration and System Settings (Enterprise Edition)" +--- + +# Control Registration and System Settings (Enterprise Edition) + +## Enable the Registration Whitelist + +Enterprise Edition can restrict which users are allowed to register through the registration whitelist. To use the registration whitelist, first go to **Settings** and enable **Enable module** in the **Registration whitelist** module. After enabling it, return to **Registration whitelist** to maintain allowed email addresses or rules. + +![Enable Registration Whitelist](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/enable_registration_whitelist_1.jpg) + +![Enable Registration Whitelist](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/enable_registration_whitelist_2.jpg) + +## Manage the Registration Whitelist + +Enterprise Edition uses **Registration whitelist** to control which email addresses can register for RAGFlow. When the system needs to restrict the registration scope, administrators can maintain allowed email addresses in **Registration whitelist**. After the whitelist is enabled, email addresses that are not in the whitelist cannot complete registration directly. + +After entering the **Registration whitelist** page, the page displays **Whitelist management**. Administrators can view email addresses that have already been added to the whitelist, along with each record's creation time and update time. The list fields include `Email`, `Create date`, `Update date`, and `Actions`. + +The top of the page provides common maintenance operations: + +| Operation | Description | +| --- | --- | +| `Search` | Search whitelist records by email address. | +| `New user` | Add a single email address. | +| `Import Excel` | Import whitelist records in batches. | +| `Export Excel` | Export the current whitelist data. | + +The lower-right corner of the page displays the current total number of records, pagination, and page size. To add a single email address, click **New user**, fill in the email address as prompted, and save it. For batch maintenance, prepare an Excel file first and then import it through **Import Excel**. After importing, use search to spot-check whether key email addresses appear in the list. + +![Manage Registration Whitelist](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/manage_registration_whitelist.jpg) + +![Whitelist](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/whitelist.jpg) diff --git a/docs/administrator/admin/admin_ui/manage_system_settings_enterprise.md b/docs/administrator/admin/admin_ui/manage_system_settings_enterprise.md new file mode 100644 index 0000000000..9e9c2fa316 --- /dev/null +++ b/docs/administrator/admin/admin_ui/manage_system_settings_enterprise.md @@ -0,0 +1,84 @@ +--- +sidebar_position: 7 +sidebar_label: "Manage System Settings (Enterprise Edition)" +--- + +# Manage System Settings (Enterprise Edition) + +## Manage Licenses + +Enterprise Edition system settings include the **License** module, which is used to manage licenses and confirm that the system remains available. The current page displays the license `ID`, `Start time`, `Expiry time`, and `Status`, and provides **Add license**. + +Administrators should regularly check license status and expiration time to avoid license expiration affecting Enterprise Edition capabilities. After adding or updating a license, confirm that `Status` is normal. + +![Manage Licenses](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/manage_licenses.jpg) + +## Configure System Email + +`SMTP` (Simple Mail Transfer Protocol) configures the system email sending service. After successful configuration, the system can send verification codes, password reset emails, notification emails, and other email messages. + +| Configuration item | Required | Description | Example or recommendation | +| --- | --- | --- | --- | +| `Server` | Yes | SMTP mail server address. | `smtp.example.com` | +| `Port` | Yes | SMTP service port. Keep it consistent with the SSL/TLS configuration. | SSL: `465`; TLS: `587`; no encryption: `25` (generally not recommended). | +| `Timeout (seconds)` | Yes | SMTP connection timeout, in seconds. | Keep the default value `10`. | +| `Username` | Yes | Email account used for sending mail. | `your-email@example.com` | +| `Password` | Yes | Email login password or SMTP authorization code. Some email providers require an authorization code instead of the login password. | Fill in according to your email provider's requirements. | +| `Default sender` | Yes | Sender email address displayed when the system sends email. It is recommended to keep it consistent with `Username`. | `noreply@example.com` | +| `SSL` | As needed | Whether to enable SSL encrypted connection. | Usually enabled when using port `465`. | +| `TLS` | As needed | Whether to enable TLS (STARTTLS) encrypted connection. | Usually enabled when using port `587`. | +| `Test connection` | Recommended | After configuration, click **Test connection** to verify that the SMTP service can connect normally. | Save the configuration only after the test succeeds. | + +Different email providers use different server addresses, ports, and authentication methods. Configure SMTP according to the parameters provided by your email provider. Usually, you only need to enable either SSL or TLS. Fill in the configuration according to the email provider's guidance. + +![Configure System Email](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/configure_system_email.jpg) + +## Configure System Notifications + +`Notification` manages system notification content and enablement status. Administrators can enter notification content in `Content` and use `Enable` to control whether the notification takes effect. This feature applies to system announcements, maintenance notices, downtime notices, or other information that needs to be displayed uniformly to users. + +1. Go to the **Settings** page. +2. Find the **Notification** area. +3. Enter the content to display in `Content`. +4. Turn on the `Enable` switch. +5. Click **Save**. + +![Configure System Notifications](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/configure_system_notifications.jpg) + +## Set Model Provider Page Visibility Scope + +`ExposeModelProvider` controls whether the model provider page is displayed to non-administrator users. When enabled, non-administrator users can also see the `Model Provider` page entry. When disabled, the page is visible only to users with corresponding management permissions. + +1. Go to the **Settings** page. +2. Find the **ExposeModelProvider** area. +3. Turn the `Enable` switch on or off according to the enterprise permission policy. +4. Click **Save**. + +![Set Model Provider Page Visibility Scope](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/set_model_provider_page_visibility_scope.jpg) + +## Enable Email Verification + +`EmailVerification` controls the registration email verification code feature. When enabled, the system sends a verification code from the default email account to the user's registration email address to verify that the registration email is genuine. + +1. Go to the **Settings** page. +2. Confirm that SMTP has been configured correctly and that **Test connection** passed. +3. Find the **EmailVerification** area. +4. Turn on the `Enable` switch. +5. Click **Save**. + +![Enable Email Verification](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/enable_email_verification.jpg) + +## Configure SSO Identity Providers + +`SSO provider` selects a unified login identity provider for the organization. Administrators can choose one identity provider mode from `None`, `Cloud IDP`, and `LDAP`. + +`Cloud IDP` configures a third-party cloud identity provider. The current page provides `Google`, `GitHub`, and `Feishu`. `LDAP` configures an enterprise directory identity provider and is suitable for organizations that use internal directory services. + +1. Go to the **SSO provider** page. +2. Select `None`, `Cloud IDP`, or `LDAP` according to the organization's identity management method. +3. If you select `Cloud IDP`, enable the corresponding identity provider from `Google`, `GitHub`, and `Feishu`. +4. If you select `LDAP`, enable the default LDAP configuration or click **Add** to add a new LDAP configuration. +5. Click the settings button on the right side of the corresponding identity provider and fill in the identity provider parameters as required by the page. +6. After configuration, verify the login flow with a test account before switching to production use. + +**Note:** Before switching the production identity provider, make sure at least one administrator login method remains available. Otherwise, a configuration error may prevent administrators from entering the Admin UI. diff --git a/docs/administrator/admin/admin_ui/manage_user_accounts.md b/docs/administrator/admin/admin_ui/manage_user_accounts.md new file mode 100644 index 0000000000..10032332a2 --- /dev/null +++ b/docs/administrator/admin/admin_ui/manage_user_accounts.md @@ -0,0 +1,110 @@ +--- +sidebar_position: 3 +sidebar_label: "Manage User Accounts" +--- + +# Manage User Accounts + +## View and Search Users + +User accounts are managed on the **User management** page. Administrators can view the user list, including `Email`, `Nickname`, `Status`, `User type`, and `Last login time`. The current Enterprise Edition page also displays `Role`. + +![User Management](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/user_management_1.jpg) + +![User Management](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/user_management_2.jpg) + +![User Management](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/user_management_3.jpg) + +Use the search box in the upper-right corner to search users by `Email` or `Nickname`. You can also filter `Active` or `Inactive` users by `Status`. In Enterprise Edition, you can also filter users by `Role`. + +![View And Search Users](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/view_and_search_users_1.jpg) + +![View And Search Users](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/view_and_search_users_2.jpg) + +## Create a New User + +To create an account for a new member, go to **User management** and click **New user**. In the dialog, fill in `Email`, `Password`, and `Confirm password`. The current Enterprise Edition page also allows you to select a `Role` when creating a user. + +1. Go to the **User management** page. +2. Click **New user**. +3. Enter the user's `Email`. +4. Enter the initial password. +5. Enter the same password again in `Confirm password`. +6. In Enterprise Edition, select a `Role` according to the user's responsibilities. +7. Click **Confirm** to create the account. + +![Create A New User](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/create_a_new_user_1.jpg) + +![Create A New User](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/create_a_new_user_2.jpg) + +After creation, return to the user list and confirm that the account appears, and that its status and role match expectations. Then send the login information to the user through a secure channel. + +**Caution:** `Email` must use a valid email format. After email verification is enabled, users must complete email verification before they can use the account normally. If email verification is not enabled, the system only validates the email format. + +When creating a new user, the password and confirmation password must match. The frontend validation for the current create-user form requires at least 6 characters. Password reset requires a new password of at least 8 characters. In production environments, use a stronger unified password policy. In Enterprise Edition, `Role` affects the resources and operations a user can access, so confirm role permissions before creating the account. + +## Disable or Restore an Account + +The `Status` field in the user list controls whether an account can log in to the system. + +| Status | Meaning | +| --- | --- | +| `Active` | The account is enabled and can log in and use the system normally. | +| `Inactive` | The account is disabled. The user cannot log in, but the account and related data are retained. | + +1. Go to the **User management** page and find the target user in the user list. +2. In the `Status` column of that user's row, click the current status dropdown and select `Active` or `Inactive` as needed. + +![Disable Or Restore Accounts](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/disable_or_restore_accounts.jpg) + +**Caution:** The currently logged-in administrator cannot disable their own account. Disabling an account does not delete user data; it only prevents the user from logging in. If you need to permanently remove a user, confirm that the account no longer needs to be retained before deleting it. + +## Set Backend Administrator Identity + +`User type` distinguishes `Normal` from `Superuser`. `Normal` is a regular user type. `Superuser` can enter the Admin UI and perform system-level management operations. + +1. Find the target user on the **User management** page. +2. Open the selector in the `User type` column. +3. Select `Normal` or `Superuser`. +4. Wait for the system to submit the change and refresh the user list. + +![Set Backend Administrator Identity](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/set_backend_administrator_identity.jpg) + +**Caution:** The currently logged-in administrator cannot modify their own `Superuser` type in the list. + +## Reset User Passwords + +When a user forgets their password or must be forced to change it, administrators can reset another user's password from **Actions** in the user list. After the reset-password dialog opens, the page displays the target user's `Email` and requires `New password` and `Confirm new password`. + +1. Find the target user on the **User management** page. Hover over the user row to display **Actions**, then click the reset-password button. +2. Confirm that the `Email` in the dialog is the target user. +3. Enter the new password and confirm it again. +4. Click **Change password**. + +![Reset User Passwords](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/reset_user_passwords_1.jpg) + +![Reset User Passwords](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/reset_user_passwords_2.jpg) + +**Caution:** The currently logged-in administrator cannot reset their own password through list **Actions**. + +## Delete Users + +When a user no longer needs system access and related resources have been handed over, administrators can delete the user from **Actions** in the user list. Before deletion, the page displays a confirmation dialog and shows the `Email` of the user to be deleted. + +1. Find the target user on the **User management** page. Hover over the user row to display **Actions**, then click the delete button. +2. Check the user's `Email` in the confirmation dialog. +3. Click **Delete** to delete the user. + +![Delete Users](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/delete_users.jpg) + +**Caution:** The currently logged-in administrator cannot delete their own account through list **Actions**. + +Deleting a user is a high-risk operation. Before doing it, confirm whether the user's related data, knowledge bases, Agents, files, API keys, and business responsibilities have been handed over. If you only need to temporarily prevent login, change the account status to `Inactive` first. + +## View User Details and Resource Impact + +Click the detail button in **Actions** on the user list to enter the user detail page. The detail page displays the user's `Email`, account status, Enterprise Edition role, `Last login time`, `Create time`, `Last update time`, `Language`, `Is anonymous`, and `Is superuser`. + +The current Enterprise Edition detail page also displays the user's associated `Dataset` and `Agent` resources by resource type. Before disabling, deleting, downgrading `Superuser`, or adjusting an Enterprise Edition role, administrators should check the detail page to confirm whether the user still has important resources or recent login activity. + +![View User Details And Resource Impact](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/view_user_details_and_resource_impact.jpg) diff --git a/docs/administrator/admin/admin_ui/view_monitoring_dashboard_enterprise.md b/docs/administrator/admin/admin_ui/view_monitoring_dashboard_enterprise.md new file mode 100644 index 0000000000..76d911b5cb --- /dev/null +++ b/docs/administrator/admin/admin_ui/view_monitoring_dashboard_enterprise.md @@ -0,0 +1,68 @@ +--- +sidebar_position: 8 +sidebar_label: "View Monitoring Dashboard (Enterprise Edition)" +--- + +# View Monitoring Dashboard (Enterprise Edition) + +## Use Monitoring to View System Monitoring + +Enterprise Edition provides a **Monitoring** page in the Admin UI for viewing system monitoring data and alert status. Administrators can query metrics, view alert rules, check target collection status, and view Prometheus runtime information on this page. + +![Use Monitoring To View System Monitoring](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/use_monitoring_to_view_system_monitoring.jpg) + +## Query Monitoring Metrics + +Select **Query** at the top of the **Monitoring** page to enter the metric query page. The page provides an expression input box. Administrators can enter a Prometheus query expression and click **Execute**. + +Query results can be viewed through **Table**, **Graph**, and **Explain**: + +| View | Description | +| --- | --- | +| `Table` | View query results in table form. | +| `Graph` | View trend charts. | +| `Explain` | View an explanation of the query expression. | + +The page also provides `Evaluation time`, which is used to view or adjust the query evaluation time. To query multiple expressions at the same time, click **Add query** to add a new query area. + +1. Go to the **Monitoring** page. +2. Select **Query**. +3. Enter the query expression in the input box. +4. Click **Execute**. +5. Switch between **Table**, **Graph**, and **Explain** as needed to view results. +6. To add query conditions, click **Add query**. + +![Query Monitoring Metrics](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/query_monitoring_metrics_1.jpg) + +![Query Monitoring Metrics](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/query_monitoring_metrics_2.jpg) + +**Note:** The **Query** page is used to query monitoring metrics, not to modify business data. Query expressions must comply with Prometheus query rules. Complex queries may bring computing overhead, so avoid frequently running high-cost queries in production environments. + +## View Alert Rules and Alert Status + +Select **Alerts** to view alert rules currently configured in Prometheus. The page supports filtering alert groups by `rule group state` and searching rules by `rule name` or `labels`. + +The alerts page displays content by rule group. Each rule group shows the rule group name, rule file path, and current status statistics, such as `INACTIVE` or `FIRING`. Administrators can expand a specific rule to check whether it is currently triggered. + +![View Alert Rules And Alert Status](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/view_alert_rules_and_alert_status.jpg) + +**Note:** The **Alerts** page displays alert rules loaded by Prometheus in the current deployment. `INACTIVE` means the rule is not currently triggered. `FIRING` means the rule is currently triggered, and administrators need to further troubleshoot with service status, logs, and the deployment environment. Query expressions must comply with Prometheus query rules. Complex queries may bring computing overhead, so avoid frequently running high-cost queries in production environments. + +## View Prometheus Monitoring Status + +Prometheus provides rich status pages. Administrators can use the **Status** menu to view collection targets, service discovery, rule execution, the time-series database, system configuration, and runtime status. This helps quickly confirm whether the monitoring service is running normally and assists in locating monitoring configuration or collection exceptions. + +| Menu | Function | Main content | Administrator use | Notes | +| --- | --- | --- | --- | --- | +| `Target health` | View the health status of Prometheus collection targets. | Displays collection targets by `Job`, including `Endpoint`, `Labels`, `Last Scrape`, `State`, and other information. `State` is `UP` when target collection is normal. | Confirm whether Elasticsearch, MySQL, Redis, MinIO, RabbitMQ, Prometheus, and other components can be monitored normally. | `Target Health` only indicates metric collection status and does not fully represent business service status. If the status is `DOWN`, check the exporter, network connectivity, scrape address, and Prometheus configuration. | +| `Rule health` | View the runtime status of alerting rules and recording rules. | Displays rule groups, rule files, recent execution time (`Last Run`), execution duration (`Took`), execution period (`Every`), and rule status. | Confirm whether rules run at the expected interval and troubleshoot rule exceptions or invalid rules. | `OK` means the latest rule evaluation succeeded. | +| `Service discovery` | View Prometheus service discovery results. | Displays each job's `Discovered Labels` and `Target Labels`, and supports viewing the relabeling process. | Troubleshoot abnormal target discovery, incorrect label configuration, or abnormal metric classification. | When a new monitoring target does not take effect, check this page first. | +| `Runtime & build information` | View Prometheus runtime environment and build information. | Includes `Version`, `Build Date`, `Go Version`, `Start Time`, `Hostname`, `Storage Retention`, `Configuration Reload`, and other information. | Confirm the current runtime version, startup time, configuration loading status, and storage retention policy. | Commonly used to troubleshoot Prometheus service runtime status. | +| `TSDB status` | View the runtime status of the Prometheus time-series database (TSDB). | Includes `Series`, `Chunks`, `Label Pairs`, time range, labels, metrics, memory usage, and other statistics. | View monitoring data scale, storage status, and database runtime status. | The page provides operations such as `Delete Series` and `Clean Tombstones`. It is recommended only for status viewing. Do not execute delete or cleanup operations casually, or historical monitoring data may be lost. | +| `Command-line flags` | View the current Prometheus startup parameters. | Displays the configuration file path, listen address, storage path, retention time, query parameters, and other startup parameters. | Check whether the actual Prometheus startup parameters match deployment expectations. | Suitable for troubleshooting configuration file paths, data directories, listen ports, and similar issues. | +| `Configuration` | View the currently loaded Prometheus configuration. | Includes complete configuration content such as `global`, `scrape_configs`, `rule_files`, and `alerting`. | Confirm whether scrape jobs, scrape intervals, alert rules, and scrape configurations have been loaded correctly. | This page is for viewing only and does not support online modification. Reload or restart Prometheus after modifying the configuration. | +| `Alertmanager discovery` | View Alertmanager instances discovered by Prometheus. | Displays Alertmanager service addresses and connection status. | Confirm whether Prometheus has successfully connected to Alertmanager. | If Alertmanager is not configured, this page may be empty. | + +![View Prometheus Monitoring Status](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/view_prometheus_monitoring_status_1.jpg) + +![View Prometheus Monitoring Status](https://raw.githubusercontent.com/Yannnnnnny/ragflow-docs/main/images/view_prometheus_monitoring_status_2.jpg) diff --git a/docs/guides/agent/agent_component_reference/_category_.json b/docs/guides/agent/agent_component_reference/_category_.json deleted file mode 100644 index 34669a6b76..0000000000 --- a/docs/guides/agent/agent_component_reference/_category_.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "label": "Components", - "position": 20, - "link": { - "type": "generated-index", - "description": "A complete reference for RAGFlow's agent components." - }, - "customProps": { - "categoryIcon": "RagAiAgent" - } -} diff --git a/docs/guides/agent/agent_component_reference/agent.mdx b/docs/guides/agent/agent_component_reference/agent.mdx deleted file mode 100644 index e3d6e46a1e..0000000000 --- a/docs/guides/agent/agent_component_reference/agent.mdx +++ /dev/null @@ -1,235 +0,0 @@ ---- -sidebar_position: 2 -slug: /agent_component -sidebar_custom_props: { - categoryIcon: RagAiAgent -} ---- -# Agent component - -The component equipped with reasoning, tool usage, and multi-agent collaboration capabilities. - ---- - -An **Agent** component fine-tunes the LLM and sets its prompt. From v0.20.5 onwards, an **Agent** component is able to work independently and with the following capabilities: - -- Autonomous reasoning with reflection and adjustment based on environmental feedback. -- Use of tools or subagents to complete tasks. - -## Scenarios - -An **Agent** component is essential when you need the LLM to assist with summarizing, translating, or controlling various tasks. - -## Prerequisites - -1. Ensure you have a chat model properly configured: - - ![Set default models](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_default_models.jpg) - -2. If your Agent involves dataset retrieval, ensure you [have properly configured your target dataset(s)](../../dataset/configure_knowledge_base.md). - -## Quickstart - -### 1. Click on an **Agent** component to show its configuration panel - -The corresponding configuration panel appears to the right of the canvas. Use this panel to define and fine-tune the **Agent** component's behavior. - -### 2. Select your model - -Click **Model**, and select a chat model from the dropdown menu. - -:::tip NOTE -If no model appears, check if your have added a chat model on the **Model providers** page. -::: - -### 3. Update system prompt (Optional) - -The system prompt typically defines your model's role. You can either keep the system prompt as is or customize it to override the default. - - -### 4. Update user prompt - -The user prompt typically defines your model's task. You will find the `sys.query` variable auto-populated. Type `/` or click **(x)** to view or add variables. - -In this quickstart, we assume your **Agent** component is used standalone (without tools or sub-Agents below), then you may also need to specify retrieved chunks using the `formalized_content` variable: - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/standalone_user_prompt_variable.jpg) - -### 5. Skip Tools and Agent - -The **+ Add tools** and **+ Add agent** sections are used *only* when you need to configure your **Agent** component as a planner (with tools or sub-Agents beneath). In this quickstart, we assume your **Agent** component is used standalone (without tools or sub-Agents beneath). - -### 6. Choose the next component - -When necessary, click the **+** button on the **Agent** component to choose the next component in the workflow from the dropdown list. - -## Connect to an MCP server as a client - -:::danger IMPORTANT -In this section, we assume your **Agent** will be configured as a planner, with a Tavily tool beneath it. -::: - -### 1. Navigate to the MCP configuration page - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/mcp_page.jpg) - -### 2. Configure your Tavily MCP server - -Update your MCP server's name, URL (including the API key), server type, and other necessary settings. When configured correctly, the available tools will be displayed. - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/edit_mcp_server.jpg) - -### 3. Navigate to your Agent's editing page - -### 4. Connect to your MCP server - -1. Click **+ Add tools**: - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/add_tools.jpg) - -2. Click **MCP** to show the available MCP servers. - -3. Select your MCP server: - - *The target MCP server appears below your Agent component, and your Agent will autonomously decide when to invoke the available tools it offers.* - - ![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/choose_tavily_mcp_server.jpg) - -### 5. Update system prompt to specify trigger conditions (Optional) - -To ensure reliable tool calls, you may specify within the system prompt which tasks should trigger each tool call. - -### 6. View the available tools of your MCP server - -On the canvas, click the newly-populated Tavily server to view and select its available tools: - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/tavily_mcp_server.jpg) - - -## Configurations - -### Model - -Click the dropdown menu of **Model** to show the model configuration window. - -- **Model**: The chat model to use. - - Ensure you set the chat model correctly on the **Model providers** page. - - You can use different models for different components to increase flexibility or improve overall performance. -- **Creativity**: A shortcut to **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty** settings, indicating the freedom level of the model. From **Improvise**, **Precise**, to **Balance**, each preset configuration corresponds to a unique combination of **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty**. - This parameter has three options: - - **Improvise**: Produces more creative responses. - - **Precise**: (Default) Produces more conservative responses. - - **Balance**: A middle ground between **Improvise** and **Precise**. -- **Temperature**: The randomness level of the model's output. - Defaults to 0.1. - - Lower values lead to more deterministic and predictable outputs. - - Higher values lead to more creative and varied outputs. - - A temperature of zero results in the same output for the same prompt. -- **Top P**: Nucleus sampling. - - Reduces the likelihood of generating repetitive or unnatural text by setting a threshold *P* and restricting the sampling to tokens with a cumulative probability exceeding *P*. - - Defaults to 0.3. -- **Presence penalty**: Encourages the model to include a more diverse range of tokens in the response. - - A higher **presence penalty** value results in the model being more likely to generate tokens not yet been included in the generated text. - - Defaults to 0.4. -- **Frequency penalty**: Discourages the model from repeating the same words or phrases too frequently in the generated text. - - A higher **frequency penalty** value results in the model being more conservative in its use of repeated tokens. - - Defaults to 0.7. -- **Max tokens**: - - The maximum context size of the model. - -:::tip NOTE -- It is not necessary to stick with the same model for all components. If a specific model is not performing well for a particular task, consider using a different one. -- If you are uncertain about the mechanism behind **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty**, simply choose one of the three options of **Creativity**. -::: - -### System prompt - -Typically, you use the system prompt to describe the task for the LLM, specify how it should respond, and outline other miscellaneous requirements. We do not plan to elaborate on this topic, as it can be as extensive as prompt engineering. However, please be aware that the system prompt is often used in conjunction with keys (variables), which serve as various data inputs for the LLM. - -An **Agent** component relies on keys (variables) to specify its data inputs. Its immediate upstream component is *not* necessarily its data input, and the arrows in the workflow indicate *only* the processing sequence. Keys in a **Agent** component are used in conjunction with the system prompt to specify data inputs for the LLM. Use a forward slash `/` or the **(x)** button to show the keys to use. - -#### Advanced usage - -From v0.20.5 onwards, four framework-level prompt blocks are available in the **System prompt** field, enabling you to customize and *override* prompts at the framework level. Type `/` or click **(x)** to view them; they appear under the **Framework** entry in the dropdown menu. - -- `task_analysis` prompt block - - This block is responsible for analyzing tasks — either a user task or a task assigned by the lead Agent when the **Agent** component is acting as a Sub-Agent. - - Reference design: [analyze_task_system.md](https://github.com/infiniflow/ragflow/blob/main/rag/prompts/analyze_task_system.md) and [analyze_task_user.md](https://github.com/infiniflow/ragflow/blob/main/rag/prompts/analyze_task_user.md) - - Available *only* when this **Agent** component is acting as a planner, with either tools or sub-Agents under it. - - Input variables: - - `agent_prompt`: The system prompt. - - `task`: The user prompt for either a lead Agent or a sub-Agent. The lead Agent's user prompt is defined by the user, while a sub-Agent's user prompt is defined by the lead Agent when delegating tasks. - - `tool_desc`: A description of the tools and sub_Agents that can be called. - - `context`: The operational context, which stores interactions between the Agent, tools, and sub-agents; initially empty. -- `plan_generation` prompt block - - This block creates a plan for the **Agent** component to execute next, based on the task analysis results. - - Reference design: [next_step.md](https://github.com/infiniflow/ragflow/blob/main/rag/prompts/next_step.md) - - Available *only* when this **Agent** component is acting as a planner, with either tools or sub-Agents under it. - - Input variables: - - `task_analysis`: The analysis result of the current task. - - `desc`: A description of the tools or sub-Agents currently being called. - - `today`: The date of today. -- `reflection` prompt block - - This block enables the **Agent** component to reflect, improving task accuracy and efficiency. - - Reference design: [reflect.md](https://github.com/infiniflow/ragflow/blob/main/rag/prompts/reflect.md) - - Available *only* when this **Agent** component is acting as a planner, with either tools or sub-Agents under it. - - Input variables: - - `goal`: The goal of the current task. It is the user prompt for either a lead Agent or a sub-Agent. The lead Agent's user prompt is defined by the user, while a sub-Agent's user prompt is defined by the lead Agent. - - `tool_calls`: The history of tool calling - - `call.name`:The name of the tool called. - - `call.result`:The result of tool calling -- `citation_guidelines` prompt block - - Reference design: [citation_prompt.md](https://github.com/infiniflow/ragflow/blob/main/rag/prompts/citation_prompt.md) - -*The screenshots below show the framework prompt blocks available to an **Agent** component, both as a standalone and as a planner (with a Tavily tool below):* - -![standalone](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/standalone_agent_framework_block.jpg) - -![planner](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/planner_agent_framework_blocks.jpg) - -### User prompt - -The user-defined prompt. Defaults to `sys.query`, the user query. As a general rule, when using the **Agent** component as a standalone module (not as a planner), you usually need to specify the corresponding **Retrieval** component’s output variable (`formalized_content`) here as part of the input to the LLM. - - -### Tools - -You can use an **Agent** component as a collaborator that reasons and reflects with the aid of other tools; for instance, **Retrieval** can serve as one such tool for an **Agent**. - -### Agent - -You use an **Agent** component as a collaborator that reasons and reflects with the aid of subagents or other tools, forming a multi-agent system. - -### Message window size - -An integer specifying the number of previous dialogue rounds to input into the LLM. For example, if it is set to 12, the tokens from the last 12 dialogue rounds will be fed to the LLM. This feature consumes additional tokens. - -:::tip IMPORTANT -This feature is used for multi-turn dialogue *only*. -::: - -### Max retries - -Defines the maximum number of attempts the agent will make to retry a failed task or operation before stopping or reporting failure. - -### Delay after error - -The waiting period in seconds that the agent observes before retrying a failed task, helping to prevent immediate repeated attempts and allowing system conditions to improve. Defaults to 1 second. - -### Max reflection rounds - -Defines the maximum number reflection rounds of the selected chat model. Defaults to 1 round. - -:::tip NOTE -Increasing this value will significantly extend your agent's response time. -::: - -### Output - -The global variable name for the output of the **Agent** component, which can be referenced by other components in the workflow. - -## Frequently asked questions - -### Why does it take so long for my Agent to respond? - -See [here](../best_practices/accelerate_agent_question_answering.md) for details. \ No newline at end of file diff --git a/docs/guides/agent/agent_component_reference/await_response.mdx b/docs/guides/agent/agent_component_reference/await_response.mdx deleted file mode 100644 index f47da3cbd3..0000000000 --- a/docs/guides/agent/agent_component_reference/await_response.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -sidebar_position: 5 -slug: /await_response -sidebar_custom_props: { - categoryIcon: LucideMessageSquareDot -} ---- -# Await response component - -A component that halts the workflow and awaits user input. - ---- - -An **Await response** component halts the workflow, initiating a conversation and collecting key information via predefined forms. - -## Scenarios - -An **Await response** component is essential where you need to display the agent's responses or require user-computer interaction. - -## Configurations - -### Guiding question - -Whether to show the message defined in the **Message** field. - -### Message - -The static message to send out. - -Click **+ Add message** to add message options. When multiple messages are supplied, the **Message** component randomly selects one to send. - -### Input - -You can define global variables within the **Await response** component, which can be either mandatory or optional. Once set, users will need to provide values for these variables when engaging with the agent. Click **+** to add a global variable, each with the following attributes: - -- **Name**: _Required_ - A descriptive name providing additional details about the variable. -- **Type**: _Required_ - The type of the variable: - - **Single-line text**: Accepts a single line of text without line breaks. - - **Paragraph text**: Accepts multiple lines of text, including line breaks. - - **Dropdown options**: Requires the user to select a value for this variable from a dropdown menu. And you are required to set _at least_ one option for the dropdown menu. - - **file upload**: Requires the user to upload one or multiple files. - - **Number**: Accepts a number as input. - - **Boolean**: Requires the user to toggle between on and off. -- **Key**: _Required_ - The unique variable name. -- **Optional**: A toggle indicating whether the variable is optional. - -:::tip NOTE -To pass in parameters from a client, call: - -- HTTP method [Converse with agent](../../../references/http_api_reference.md#converse-with-agent), or -- Python method [Converse with agent](../../../references/python_api_reference.md#converse-with-agent). - ::: - -:::danger IMPORTANT -If you set the key type as **file**, ensure the token count of the uploaded file does not exceed your model provider's maximum token limit; otherwise, the plain text in your file will be truncated and incomplete. -::: \ No newline at end of file diff --git a/docs/guides/agent/agent_component_reference/begin.md b/docs/guides/agent/agent_component_reference/begin.md deleted file mode 100644 index 1368efebdb..0000000000 --- a/docs/guides/agent/agent_component_reference/begin.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -sidebar_position: 1 -slug: /begin_component -sidebar_custom_props: { - categoryIcon: LucideHome -} ---- -# Begin component - -The starting component in a workflow. - ---- - -The **Begin** component sets an opening greeting or accepts inputs from the user. It is automatically populated onto the canvas when you create an agent, whether from a template or from scratch (from a blank template). There should be only one **Begin** component in the workflow. - -## Scenarios - -A **Begin** component is essential in all cases. Every agent includes a **Begin** component, which cannot be deleted. - -## Configurations - -Click the component to display its **Configuration** window. Here, you can set an opening greeting and the input parameters (global variables) for the agent. - -### Mode - -Mode defines how the workflow is triggered. - -- Conversational: The agent is triggered from a conversation. -- Task: The agent starts without a conversation. -- Webhook: Receive external HTTP requests via webhooks, enabling automated triggers and workflow initiation. - *When selected, a unique Webhook URL is generated for the current agent.* - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/webhook_mode.png) - -### Methods - -The supported HTTP methods. Available only when **Webhook** is selected as **Mode**. - - -### Security - -The authentication method to choose, available *only* when **Webhook** is selected as **Mode**. Including: - -- **token**: Token-based authentication. -- **basic**: Basic authentication. -- **jwt**: JWT authentication. - -### Schema - -The schema defines the data structure for HTTP requests received by the system in **Webhook** mode. It configurations include: - -- Content type: - - `application/json` - - `multipart/form-data` - - `application/x-www-form-urlencoded` - - `text-plain` - - `application/octet-stream` -- Query parameters -- Header parameters -- Request body parameters - -### Response - -Available only when **Webhook** is selected as **Mode**. - -The response mode of the workflow, i.e., how the workflow respond to external HTTP requests. Supported options: - -- **Accepted response**: When an HTTP request is validated, a success response is returned immediately, and the workflow runs asynchronously in the background. - - When selected, you configure the corresponding HTTP status code and message in the **Begin** component. - - The HTTP status code to return is in the range of `200-399`. -- **Final response**: The system returns the final processing result only after the entire workflow completes. - - When selected, you configure the corresponding HTTP status code and message in the [message](./message.md) component. - - The HTTP status code to return is in the range of `200-399`. - -### Opening greeting - -**Conversational mode only.** - -An agent in conversational mode begins with an opening greeting. It is the agent's first message to the user in conversational mode, which can be a welcoming remark or an instruction to guide the user forward. - -### Global variables - -You can define global variables within the **Begin** component, which can be either mandatory or optional. Once set, users will need to provide values for these variables when engaging with the agent. Click **+ Add variable** to add a global variable, each with the following attributes: - -- **Name**: _Required_ - A descriptive name providing additional details about the variable. -- **Type**: _Required_ - The type of the variable: - - **Single-line text**: Accepts a single line of text without line breaks. - - **Paragraph text**: Accepts multiple lines of text, including line breaks. - - **Dropdown options**: Requires the user to select a value for this variable from a dropdown menu. And you are required to set _at least_ one option for the dropdown menu. - - **file upload**: Requires the user to upload one or multiple files. - - **Number**: Accepts a number as input. - - **Boolean**: Requires the user to toggle between on and off. -- **Key**: _Required_ - The unique variable name. -- **Optional**: A toggle indicating whether the variable is optional. - -:::tip NOTE -To pass in parameters from a client, call: - -- HTTP method [Converse with agent](../../../references/http_api_reference.md#converse-with-agent), or -- Python method [Converse with agent](../../../references/python_api_reference.md#converse-with-agent). - ::: - -:::danger IMPORTANT -If you set the key type as **file**, ensure the token count of the uploaded file does not exceed your model provider's maximum token limit; otherwise, the plain text in your file will be truncated and incomplete. -::: - -:::note -You can tune document parsing and embedding efficiency by setting the environment variables `DOC_BULK_SIZE` and `EMBEDDING_BATCH_SIZE`. -::: - -## Frequently asked questions - -### Is the uploaded file in a dataset? - -No. Files uploaded to an agent as input are not stored in a dataset and hence will not be processed using RAGFlow's built-in OCR, DLR or TSR models, or chunked using RAGFlow's built-in chunking methods. - -### File size limit for an uploaded file - -There is no _specific_ file size limit for a file uploaded to an agent. However, note that model providers typically have a default or explicit maximum token setting, which can range from 8196 to 128k: The plain text part of the uploaded file will be passed in as the key value, but if the file's token count exceeds this limit, the string will be truncated and incomplete. - -:::tip NOTE -The variables `MAX_CONTENT_LENGTH` in `/docker/.env` and `client_max_body_size` in `/docker/nginx/nginx.conf` set the file size limit for each upload to a dataset or RAGFlow's File system. These settings DO NOT apply in this scenario. -::: diff --git a/docs/guides/agent/agent_component_reference/categorize.mdx b/docs/guides/agent/agent_component_reference/categorize.mdx deleted file mode 100644 index 57cd14ea7b..0000000000 --- a/docs/guides/agent/agent_component_reference/categorize.mdx +++ /dev/null @@ -1,111 +0,0 @@ ---- -sidebar_position: 8 -slug: /categorize_component -sidebar_custom_props: { - categoryIcon: LucideSwatchBook -} ---- -# Categorize component - -A component that classifies user inputs and applies strategies accordingly. - ---- - -A **Categorize** component is usually the downstream of the **Interact** component. - -## Scenarios - -A **Categorize** component is essential when you need the LLM to help you identify user intentions and apply appropriate processing strategies. - -## Configurations - -### Query variables - -*Mandatory* - -Select the source for categorization. - -The **Categorize** component relies on query variables to specify its data inputs (queries). All global variables defined before the **Categorize** component are available in the dropdown list. - - -### Input - -The **Categorize** component relies on input variables to specify its data inputs (queries). Click **+ Add variable** in the **Input** section to add the desired input variables. There are two types of input variables: **Reference** and **Text**. - -- **Reference**: Uses a component's output or a user input as the data source. You are required to select from the dropdown menu: - - A component ID under **Component Output**, or - - A global variable under **Begin input**, which is defined in the **Begin** component. -- **Text**: Uses fixed text as the query. You are required to enter static text. - -### Model - -Click the dropdown menu of **Model** to show the model configuration window. - -- **Model**: The chat model to use. - - Ensure you set the chat model correctly on the **Model providers** page. - - You can use different models for different components to increase flexibility or improve overall performance. -- **Creativity**: A shortcut to **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty** settings, indicating the freedom level of the model. From **Improvise**, **Precise**, to **Balance**, each preset configuration corresponds to a unique combination of **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty**. - This parameter has three options: - - **Improvise**: Produces more creative responses. - - **Precise**: (Default) Produces more conservative responses. - - **Balance**: A middle ground between **Improvise** and **Precise**. -- **Temperature**: The randomness level of the model's output. - Defaults to 0.1. - - Lower values lead to more deterministic and predictable outputs. - - Higher values lead to more creative and varied outputs. - - A temperature of zero results in the same output for the same prompt. -- **Top P**: Nucleus sampling. - - Reduces the likelihood of generating repetitive or unnatural text by setting a threshold *P* and restricting the sampling to tokens with a cumulative probability exceeding *P*. - - Defaults to 0.3. -- **Presence penalty**: Encourages the model to include a more diverse range of tokens in the response. - - A higher **presence penalty** value results in the model being more likely to generate tokens not yet been included in the generated text. - - Defaults to 0.4. -- **Frequency penalty**: Discourages the model from repeating the same words or phrases too frequently in the generated text. - - A higher **frequency penalty** value results in the model being more conservative in its use of repeated tokens. - - Defaults to 0.7. -- **Max tokens**: - This sets the maximum length of the model's output, measured in the number of tokens (words or pieces of words). It is disabled by default, allowing the model to determine the number of tokens in its responses. - -:::tip NOTE -- It is not necessary to stick with the same model for all components. If a specific model is not performing well for a particular task, consider using a different one. -- If you are uncertain about the mechanism behind **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty**, simply choose one of the three options of **Creativity**. -::: - -### Message window size - -An integer specifying the number of previous dialogue rounds to input into the LLM. For example, if it is set to 12, the tokens from the last 12 dialogue rounds will be fed to the LLM. This feature consumes additional tokens. - -Defaults to 1. - -:::tip IMPORTANT -This feature is used for multi-turn dialogue *only*. If your **Categorize** component is not part of a multi-turn dialogue (i.e., it is not in a loop), leave this field as-is. -::: - -### Category name - -A **Categorize** component must have at least two categories. This field sets the name of the category. Click **+ Add Item** to include the intended categories. - -:::tip NOTE -You will notice that the category name is auto-populated. No worries. Each category is assigned a random name upon creation. Feel free to change it to a name that is understandable to the LLM. -::: - -#### Description - -Description of this category. - -You can input criteria, situation, or information that may help the LLM determine which inputs belong in this category. - -#### Examples - -Additional examples that may help the LLM determine which inputs belong in this category. - -:::danger IMPORTANT -Examples are more helpful than the description if you want the LLM to classify particular cases into this category. -::: - -Once a new category is added, navigate to the **Categorize** component on the canvas, find the **+** button next to the case, and click it to specify the downstream component(s). - - -#### Output - -The global variable name for the output of the component, which can be referenced by other components in the workflow. Defaults to `category_name`. \ No newline at end of file diff --git a/docs/guides/agent/agent_component_reference/chunker_title.md b/docs/guides/agent/agent_component_reference/chunker_title.md deleted file mode 100644 index 8350f3e992..0000000000 --- a/docs/guides/agent/agent_component_reference/chunker_title.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -sidebar_position: 31 -slug: /chunker_title_component -sidebar_custom_props: { - categoryIcon: LucideBlocks -} ---- -# Title chunker component - -A component that splits texts into chunks by heading level. - ---- - -A **Token chunker** component is a text splitter that uses specified heading level as delimiter to define chunk boundaries and create chunks. - -## Scenario - -A **Title chunker** component is optional, usually placed immediately after **Parser**. - -:::caution WARNING -Placing a **Title chunker** after a **Token chunker** is invalid and will cause an error. Please note that this restriction is not currently system-enforced and requires your attention. -::: - -## Configurations - -### Hierarchy or Group - -Select how a document is split: - -- Hierarchy: Construct a heading tree and produce self-contained chunks, each carrying its full ancestral path (e.g. Part 1 › Chapter 3 › Section 2 + body text). Best for highly structured texts — such as legal statutes, regulations, contracts, and technical specs — where each chunk must be identifiable by its position in the hierarchy. -- Group: Split the document flat at a chosen heading level, merging adjacent small sections to ensure semantic flow. Chunks exclude ancestral path. Best for documents with flowing, contextually connected content — such as books, manuals, reports, and articles — where narrative coherence depends on keeping adjacent paragraphs together. - -#### Separate parent-heading content - -:::tip NOTE -Available only when **Hierarchy** is selected. -::: - -When enabled, chunks include only their heading path and content; content immediately following a parent heading is kept as a separate chunk. - -#### Set first chunk as global context - -:::tip NOTE -Available only when **Hierarchy** is selected. -::: - -Treats the first split as a global heading to maintain consistent context across the document hierarchy. Ideal for resumes where the first section identifies the subject. - -#### H3 - -Specifies the heading level to define chunk boundaries: - -- H1 -- H2 -- H3 (Default) -- H4 -- H5 - -Click **+ Add regular expressions** to add heading levels here or update the corresponding **Regular Expressions** fields for custom heading patterns. - -### Output - -The global variable name for the output of the **Title chunker** component, which can be referenced by subsequent components in the ingestion pipeline. - -- Default: `chunks` -- Type: `Array` \ No newline at end of file diff --git a/docs/guides/agent/agent_component_reference/chunker_token.md b/docs/guides/agent/agent_component_reference/chunker_token.md deleted file mode 100644 index ee0c1e79a0..0000000000 --- a/docs/guides/agent/agent_component_reference/chunker_token.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -sidebar_position: 32 -slug: /chunker_token_component -sidebar_custom_props: { - categoryIcon: LucideBlocks -} ---- -# Token chunker component - -A component that splits texts into chunks, respecting a maximum token limit and using delimiters to find optimal breakpoints. - ---- - -A **Token chunker** component is a text splitter that creates chunks by respecting a recommended maximum token length, using delimiters to ensure logical chunk breakpoints. It splits long texts into appropriately-sized, semantically related chunks. - - -## Scenario - -A **Token chunker** component is optional, usually placed immediately after **Parser** or **Title chunker**. - -## Configurations - -### Recommended chunk size - -The recommended maximum token limit for each created chunk. The **Token chunker** component creates chunks at specified delimiters. If this token limit is reached before a delimiter, a chunk is created at that point. - -### Overlapped percent (%) - -This defines the overlap percentage between chunks. An appropriate degree of overlap ensures semantic coherence without creating excessive, redundant tokens for the LLM. - -- Default: 0 -- Maximum: 30% - - -### Delimiters - -Defaults to `\n`. Click the right-hand **Recycle bin** button to remove it, or click **+ Add** to add a delimiter. - - -### Output - -The global variable name for the output of the **Token chunker** component, which can be referenced by subsequent components in the ingestion pipeline. - -- Default: `chunks` -- Type: `Array` \ No newline at end of file diff --git a/docs/guides/agent/agent_component_reference/code.mdx b/docs/guides/agent/agent_component_reference/code.mdx deleted file mode 100644 index fa1de1caab..0000000000 --- a/docs/guides/agent/agent_component_reference/code.mdx +++ /dev/null @@ -1,269 +0,0 @@ ---- -sidebar_position: 13 -slug: /code_component -sidebar_custom_props: { - categoryIcon: LucideCodeXml -} ---- -# Code component - -A component that enables users to integrate Python or JavaScript codes into their Agent for dynamic data processing. - ---- - -## Scenarios - -A **Code** component is essential when you need to integrate complex code logic (Python or JavaScript) into your Agent for dynamic data processing. - -## Prerequisites - -### 1. Ensure gVisor is properly installed - -We use gVisor to isolate code execution from the host system. Please follow [the official installation guide](https://gvisor.dev/docs/user_guide/install/) to install gVisor, ensuring your operating system is compatible before proceeding. - -### 2. Ensure Sandbox is properly installed - -RAGFlow Sandbox is a secure, pluggable code execution backend. It serves as the code executor for the **Code** component. Please follow the [instructions here](https://github.com/infiniflow/ragflow/tree/main/agent/sandbox) to install RAGFlow Sandbox. - -:::note Docker client version -The executor manager image now bundles Docker CLI `29.1.0` (API 1.44+). Older images shipped Docker 24.x and will fail against newer Docker daemons with `client version 1.43 is too old`. Pull the latest `infiniflow/sandbox-executor-manager:latest` or rebuild it in `./sandbox/executor_manager` if you encounter this error. -::: - -:::tip NOTE -If your RAGFlow Sandbox is not working, please be sure to consult the [Troubleshooting](#troubleshooting) section in this document. We assure you that it addresses 99.99% of the issues! -::: - -### 3. (Optional) Install necessary dependencies - -If you need to import your own Python or JavaScript packages into Sandbox, please follow the commands provided in the [How to import my own Python or JavaScript packages into Sandbox?](#how-to-import-my-own-python-or-javascript-packages-into-sandbox) section to install the additional dependencies. - -### 4. Enable Sandbox-specific settings in RAGFlow - -Ensure all Sandbox-specific settings are enabled in **ragflow/docker/.env**. - -### 5. Restart the service after making changes - -Any changes to the configuration or environment *require* a full service restart to take effect. - -## Configurations - -### Input - -You can specify multiple input sources for the **Code** component. Click **+ Add variable** in the **Input variables** section to include the desired input variables. - -### Code - -This field allows you to enter and edit your source code. - -:::danger IMPORTANT -If your code implementation includes defined variables, whether input or output variables, ensure they are also specified in the corresponding **Input** or **Output** sections. -::: - -#### A Python code example - -```Python - def main(arg1: str, arg2: str) -> dict: - return { - "result": arg1 + arg2, - } -``` - -#### A JavaScript code example - -```JavaScript - - const axios = require('axios'); - async function main(args) { - try { - const response = await axios.get('https://github.com/infiniflow/ragflow'); - console.log('Body:', response.data); - } catch (error) { - console.error('Error:', error.message); - } - } -``` - -### Return values - -You define the output variable(s) of the **Code** component here. - -:::danger IMPORTANT -If you define output variables here, ensure they are also defined in your code implementation; otherwise, their values will be `null`. The following are two examples: - - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_object_output.jpg) - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_nested_object_output.png) -::: - -### Output - -The output is split into two parts: - -- **Business**: the business output defined in **Return Value** -- **System**: runtime fields that are populated automatically, such as `content`, `actual_type`, and `attachments` - -For example, the following code generates a simple line chart: - -```Python -def main() -> dict: - from pathlib import Path - - import matplotlib - matplotlib.use("Agg") - import matplotlib.pyplot as plt - - artifacts_dir = Path("artifacts") - artifacts_dir.mkdir(parents=True, exist_ok=True) - - x = [1, 2, 3, 4, 5] - y = [2, 4, 6, 8, 10] - - output_path = artifacts_dir / "simple_plot.png" - - plt.figure(figsize=(6, 4)) - plt.plot(x, y, marker="o") - plt.title("Simple Line Chart") - plt.xlabel("X") - plt.ylabel("Y") - plt.grid(True) - plt.tight_layout() - plt.savefig(output_path) - plt.close() - - return { - "result": "plot generated successfully", - "file_path": str(output_path), - } -``` -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/codeexec_output1.jpg) - -Business Output shows the return value you defined, while System Output shows the generated `content`, the inferred `actual_type`, and the collected `attachments`. - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/codeexec_output2.jpg) - -## Troubleshooting - -### `HTTPConnectionPool(host='sandbox-executor-manager', port=9385): Read timed out.` - -**Root cause** - -- You did not properly install gVisor and `runsc` was not recognized as a valid Docker runtime. -- You did not pull the required base images for the runners and no runner was started. - -**Solution** - -For the gVisor issue: - -1. Install [gVisor](https://gvisor.dev/docs/user_guide/install/). -2. Restart Docker. -3. Run the following to double check: - - ```bash - docker run --rm --runtime=runsc hello-world - ``` - -For the base image issue, pull the required base images: - -```bash -docker pull infiniflow/sandbox-base-nodejs:latest -docker pull infiniflow/sandbox-base-python:latest -``` - -### `docker: Error response from daemon: client version 1.43 is too old. Minimum supported API version is 1.44` - -**Root cause** - -Your executor manager image includes Docker CLI 24.x (API 1.43), but the host Docker daemon, e.g., Docker 25+ / 29.x, now requires API 1.44+. - -**Solution** - -Pull the latest executor manager image or rebuild it in `./sandbox/executor_manager` to upgrade the built-in Docker client: - -```bash -docker pull infiniflow/sandbox-executor-manager:latest -# or -docker build -t sandbox-executor-manager:latest ./sandbox/executor_manager -``` - -### `HTTPConnectionPool(host='none', port=9385): Max retries exceeded.` - -**Root cause** - -`sandbox-executor-manager` is not mapped in `/etc/hosts`. - -**Solution** - -Add a new entry to `/etc/hosts`: - -`127.0.0.1 es01 infinity mysql minio redis sandbox-executor-manager` - -### `Container pool is busy` - -**Root cause** - -All runners are currently in use, executing tasks. - -**Solution** - -Please try again shortly or increase the pool size in the configuration to improve availability and reduce waiting times. - - -## Frequently asked questions - -### How to import my own Python or JavaScript packages into Sandbox? - -To import your Python packages, update **sandbox_base_image/python/requirements.txt** to install the required dependencies. For example, to add the `openpyxl` package, proceed with the following command lines: - -```bash {4,6} -(ragflow) ➜ ragflow/sandbox main ✓ pwd # make sure you are in the right directory -/home/infiniflow/workspace/ragflow/sandbox - -(ragflow) ➜ ragflow/sandbox main ✓ echo "openpyxl" >> sandbox_base_image/python/requirements.txt # add the package to the requirements.txt file - -(ragflow) ➜ ragflow/sandbox main ✗ cat sandbox_base_image/python/requirements.txt # make sure the package is added -numpy -pandas -requests -openpyxl # here it is - -(ragflow) ➜ ragflow/sandbox main ✗ make # rebuild the docker image, this command will rebuild the image and start the service immediately. To build image only, using `make build` instead. - -(ragflow) ➜ ragflow/sandbox main ✗ docker exec -it sandbox_python_0 /bin/bash # entering container to check if the package is installed - - -# in the container -nobody@ffd8a7dd19da:/workspace$ python # launch python shell -Python 3.11.13 (main, Aug 12 2025, 22:46:03) [GCC 12.2.0] on linux -Type "help", "copyright", "credits" or "license" for more information. ->>> import openpyxl # import the package to verify installation ->>> -# That's okay! -``` - -To import your JavaScript packages, navigate to `sandbox_base_image/nodejs` and use `npm` to install the required packages. For example, to add the `lodash` package, run the following commands: - -```bash -(ragflow) ➜ ragflow/sandbox main ✓ pwd -/home/infiniflow/workspace/ragflow/sandbox - -(ragflow) ➜ ragflow/sandbox main ✓ cd sandbox_base_image/nodejs - -(ragflow) ➜ ragflow/sandbox/sandbox_base_image/nodejs main ✓ npm install lodash - -(ragflow) ➜ ragflow/sandbox/sandbox_base_image/nodejs main ✓ cd ../.. # go back to sandbox root directory - -(ragflow) ➜ ragflow/sandbox main ✗ make # rebuild the docker image, this command will rebuild the image and start the service immediately. To build image only, using `make build` instead. - -(ragflow) ➜ ragflow/sandbox main ✗ docker exec -it sandbox_nodejs_0 /bin/bash # entering container to check if the package is installed - -# in the container -nobody@dd4bbcabef63:/workspace$ npm list lodash # verify via npm list -/workspace -`-- lodash@4.17.21 extraneous - -nobody@dd4bbcabef63:/workspace$ ls node_modules | grep lodash # or verify via listing node_modules -lodash - -# That's okay! -``` diff --git a/docs/guides/agent/agent_component_reference/execute_sql.md b/docs/guides/agent/agent_component_reference/execute_sql.md deleted file mode 100644 index c08b73ffbb..0000000000 --- a/docs/guides/agent/agent_component_reference/execute_sql.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -sidebar_position: 25 -slug: /execute_sql -sidebar_custom_props: { - categoryIcon: RagSql -} ---- -# Execute SQL tool - -A tool that execute SQL queries on a specified relational database. - ---- - -The **Execute SQL** tool enables you to connect to a relational database and run SQL queries, whether entered directly or generated by the system’s Text2SQL capability via an **Agent** component. - -## Prerequisites - -- A database instance properly configured and running. -- The database must be one of the following types: - - MySQL - - PostgreSQL - - MariaDB - - Microsoft SQL Server - -## Examples - -You can pair an **Agent** component with the **Execute SQL** tool, with the **Agent** generating SQL statements and the **Execute SQL** tool handling database connection and query execution. An example of this setup can be found in the **Text-to-SQL data expert** Agent template shown below: - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/exeSQL.jpg) - -## Configurations - -### SQL statement - -This text input field allows you to write static SQL queries, such as `SELECT * FROM my_table`, and dynamic SQL queries using variables. - -:::tip NOTE -Click **(x)** or type `/` to insert variables. -::: - -For dynamic SQL queries, you can include variables in your SQL queries, such as `SELECT * FROM /sys.query`; if an **Agent** component is paired with the **Execute SQL** tool to generate SQL tasks (see the [Examples](#examples) section), you can directly insert that **Agent**'s output, `content`, into this field. - -### Database type - -The supported database type. Currently, the following database types are available: - -- MySQL -- PostgreSQL -- MariaDB -- Microsoft SQL Server (Mssql) - -### Database - -Appears only when you select **Split** as method. - -### Username - -The username with access privileges to the database. - -### Host - -The IP address of the database server. - -### Port - -The port number on which the database server is listening. - -### Password - -The password for the database user. - -### Max records - -The maximum number of records returned by the SQL query to control response size and improve efficiency. Defaults to `1024`. - -### Output - -The **Execute SQL** tool provides two output variables: - -- `formalized_content`: A string. If you reference this variable in a **Message** component, the returned records are displayed as a table. -- `json`: An object array. If you reference this variable in a **Message** component, the returned records will be presented as key-value pairs. \ No newline at end of file diff --git a/docs/guides/agent/agent_component_reference/http.md b/docs/guides/agent/agent_component_reference/http.md deleted file mode 100644 index 66ee8067ab..0000000000 --- a/docs/guides/agent/agent_component_reference/http.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -sidebar_position: 30 -slug: /http_request_component -sidebar_custom_props: { - categoryIcon: RagHTTP -} ---- -# HTTP request component - -A component that calls remote services. - ---- - -An **HTTP request** component lets you access remote APIs or services by providing a URL and an HTTP method, and then receive the response. You can customize headers, parameters, proxies, and timeout settings, and use common methods like GET and POST. It’s useful for exchanging data with external systems in a workflow. - -## Prerequisites - -- An accessible remote API or service. -- Add a Token or credentials to the request header, if the target service requires authentication. - -## Configurations - -### Url - -*Required*. The complete request address, for example: http://api.example.com/data. - -### Method - -The HTTP request method to select. Available options: - -- GET -- POST -- PUT - -### Timeout - -The maximum waiting time for the request, in seconds. Defaults to `60`. - -### Headers - -Custom HTTP headers can be set here, for example: - -```http -{ - "Accept": "application/json", - "Cache-Control": "no-cache", - "Connection": "keep-alive" -} -``` - -### Proxy - -Optional. The proxy server address to use for this request. - -### Clean HTML - -`Boolean`: Whether to remove HTML tags from the returned results and keep plain text only. - -### Parameter - -*Optional*. Parameters to send with the HTTP request. Supports key-value pairs: - -- To assign a value using a dynamic system variable, set it as Variable. -- To override these dynamic values under certain conditions and use a fixed static value instead, Value is the appropriate choice. - - -:::tip NOTE -- For GET requests, these parameters are appended to the end of the URL. -- For POST/PUT requests, they are sent as the request body. -::: - -#### Example setting - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/http_settings.png) - -#### Example response - -```html -{ "args": { "App": "RAGFlow", "Query": "How to do?", "Userid": "241ed25a8e1011f0b979424ebc5b108b" }, "headers": { "Accept": "/", "Accept-Encoding": "gzip, deflate, br, zstd", "Cache-Control": "no-cache", "Host": "httpbin.org", "User-Agent": "python-requests/2.32.2", "X-Amzn-Trace-Id": "Root=1-68c9210c-5aab9088580c130a2f065523" }, "origin": "185.36.193.38", "url": "https://httpbin.org/get?Userid=241ed25a8e1011f0b979424ebc5b108b&App=RAGFlow&Query=How+to+do%3F" } -``` - -### Output - -The global variable name for the output of the HTTP request component, which can be referenced by other components in the workflow. - -- `Result`: `string` The response returned by the remote service. - -## Example - -This is a usage example: a workflow sends a GET request from the **Begin** component to `https://httpbin.org/get` via the **HTTP Request_0** component, passes parameters to the server, and finally outputs the result through the **Message_0** component. - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/http_usage.PNG) \ No newline at end of file diff --git a/docs/guides/agent/agent_component_reference/indexer.md b/docs/guides/agent/agent_component_reference/indexer.md deleted file mode 100644 index 22596773b1..0000000000 --- a/docs/guides/agent/agent_component_reference/indexer.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -sidebar_position: 40 -slug: /indexer_component -sidebar_custom_props: { - categoryIcon: LucideListPlus -} ---- -# Indexer component - -A component that defines how chunks are indexed. - ---- - -An **Indexer** component indexes chunks and configures their storage formats in the document engine. - -## Scenario - -An **Indexer** component is the mandatory ending component for all ingestion pipelines. - -## Configurations - -### Search method - -This setting configures how chunks are stored in the document engine: as full-text, embeddings, or both. - -### Filename embedding weight - -This setting defines the filename's contribution to the final embedding, which is a weighted combination of both the chunk content and the filename. Essentially, a higher value gives the filename more influence in the final *composite* embedding. - -- 0.1: Filename contributes 10% (chunk content 90%) -- 0.5 (maximum): Filename contributes 50% (chunk content 90%) \ No newline at end of file diff --git a/docs/guides/agent/agent_component_reference/iteration.mdx b/docs/guides/agent/agent_component_reference/iteration.mdx deleted file mode 100644 index 051b923eef..0000000000 --- a/docs/guides/agent/agent_component_reference/iteration.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -sidebar_position: 7 -slug: /iteration_component -sidebar_custom_props: { - categoryIcon: LucideRepeat2 -} ---- -# Iteration component - -A component that splits text input into text segments and iterates a predefined workflow for each one. - ---- - -An **Interaction** component can divide text input into text segments and apply its built-in component workflow to each segment. - - -## Scenario - -An **Iteration** component is essential when a workflow loop is required and the loop count is *not* fixed but depends on number of segments created from the output of specific agent components. - -- If, for instance, you plan to feed several paragraphs into an LLM for content generation, each with its own focus, and feeding them to the LLM all at once could create confusion or contradictions, then you can use an **Iteration** component, which encapsulates a **Generate** component, to repeat the content generation process for each paragraph. -- Another example: If you wish to use the LLM to translate a lengthy paper into a target language without exceeding its token limit, consider using an **Iteration** component, which encapsulates a **Generate** component, to break the paper into smaller pieces and repeat the translation process for each one. - -## Internal components - -### IterationItem - -Each **Iteration** component includes an internal **IterationItem** component. The **IterationItem** component serves as both the starting point and input node of the workflow within the **Iteration** component. It manages the loop of the workflow for all text segments created from the input. - -:::tip NOTE -The **IterationItem** component is visible *only* to the components encapsulated by the current **Iteration** components. -::: - -### Build an internal workflow - -You are allowed to pull other components into the **Iteration** component to build an internal workflow, and these "added internal components" are no longer visible to components outside of the current **Iteration** component. - -:::danger IMPORTANT -To reference the created text segments from an added internal component, simply add a **Reference** variable that equals **IterationItem** within the **Input** section of that internal component. There is no need to reference the corresponding external component, as the **IterationItem** component manages the loop of the workflow for all created text segments. -::: - -:::tip NOTE -An added internal component can reference an external component when necessary. -::: - -## Configurations - -### Input - -The **Iteration** component uses input variables to specify its data inputs, namely the texts to be segmented. You are allowed to specify multiple input sources for the **Iteration** component. Click **+ Add variable** in the **Input** section to include the desired input variables. There are two types of input variables: **Reference** and **Text**. - -- **Reference**: Uses a component's output or a user input as the data source. You are required to select from the dropdown menu: - - A component ID under **Component Output**, or - - A global variable under **Begin input**, which is defined in the **Begin** component. -- **Text**: Uses fixed text as the query. You are required to enter static text. - -### Delimiter - -The delimiter to use to split the text input into segments: - -- Comma (Default) -- Line break -- Tab -- Underline -- Forward slash -- Dash -- Semicolon \ No newline at end of file diff --git a/docs/guides/agent/agent_component_reference/message.md b/docs/guides/agent/agent_component_reference/message.md deleted file mode 100644 index f7254dfdfb..0000000000 --- a/docs/guides/agent/agent_component_reference/message.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -sidebar_position: 4 -slug: /message_component -sidebar_custom_props: { - categoryIcon: LucideMessageSquareReply -} ---- -# Message component - -A component that sends out a static or dynamic message. - ---- - -As the final component of the workflow, a Message component returns the workflow’s ultimate data output accompanied by predefined message content. The system selects one message at random if multiple messages are provided. - -## Configurations - -### Status - -The HTTP status code (`200` ~ `399`) to return when the entire workflow completes. Available *only* when you select **Final response** as **Execution mode** in the [Begin](./begin.md) component. - -### Messages - -The message to send out. Click `(x)` or type `/` to quickly insert variables. - -Click **+ Add message** to add message options. When multiple messages are supplied, the **Message** component randomly selects one to send. - -### Save to memory - -Save the conversation to specified memories. Expand the dropdown list to either select all available memories or specified memories: - - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/save_to_memory.png) - -### User ID - -Enabled by default, indicates whether to link the conversations with the agent app via a user ID. Once activated, you can target specific memories associated with that ID during retrieval. - -:::tip NOTE -RAGFlow allows multiple users to share memory. This feature is therefore associated with **Save to memory**. -::: \ No newline at end of file diff --git a/docs/guides/agent/agent_component_reference/parser.md b/docs/guides/agent/agent_component_reference/parser.md deleted file mode 100644 index e036432f9c..0000000000 --- a/docs/guides/agent/agent_component_reference/parser.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -sidebar_position: 30 -slug: /parser_component -sidebar_custom_props: { - categoryIcon: LucideFilePlay -} ---- -# Parser component - -A component that sets the parsing rules for your dataset. - ---- - -A **Parser** component is autopopulated on the ingestion pipeline canvas and required in all ingestion pipeline workflows. Just like the **Extract** stage in the traditional ETL process, a **Parser** component in an ingestion pipeline defines how various file types are parsed into structured data. Click the component to display its configuration panel. In this configuration panel, you set the parsing rules for various file types. - -## Configurations - -Within the configuration panel, you can add multiple parsers and set the corresponding parsing rules or remove unwanted parsers. Please ensure your set of parsers covers all required file types; otherwise, an error would occur when you select this ingestion pipeline on your dataset's **Files** page. - -The **Parser** component supports parsing the following file types: - -| File type | File format | -|---------------|--------------------------| -| PDF | PDF | -| Spreadsheet | XLSX, XLS, CSV | -| Image | PNG, JPG, JPEG, GIF, TIF | -| Email | EML | -| Text & Markup | TXT, MD, MDX, HTML, JSON | -| Word | DOCX | -| PowerPoint | PPTX, PPT | -| Audio | MP3, WAV | -| Video | MP4, AVI, MKV | - -### Detect multi-column layout - -Optimizes the parser to detect and reorder multi-column pages into a logical sequence. Ideal for PDF documents with two-column or newspaper-style layouts. - -### Remove original table of contents - -Strips the original table of contents from PDF files. Once enabled, the table of contents is not chunked or parsed for retrieval. - -### PDF parser - -The output of a PDF parser is `json`. In the PDF parser, you select the parsing method that works best with your PDFs. - -- DeepDoc: (Default) The default visual model performing OCR, TSR, and DLR tasks on complex PDFs, but can be time-consuming. -- Naive: Skip OCR, TSR, and DLR tasks if *all* your PDFs are plain text. -- [MinerU](https://github.com/opendatalab/MinerU): (Experimental) An open-source tool that converts PDF into machine-readable formats. -- [Docling](https://github.com/docling-project/docling): (Experimental) An open-source document processing tool for gen AI. -- A third-party visual model from a specific model provider. - -:::danger IMPORTANT -Starting from v0.22.0, RAGFlow includes MinerU (≥ 2.6.3) as an optional PDF parser of multiple backends. Please note that RAGFlow acts only as a *remote client* for MinerU, calling the MinerU API to parse documents and reading the returned files. To use this feature: -::: - -1. Prepare a reachable MinerU API service (FastAPI server). -2. In the **.env** file or from the **Model providers** page in the UI, configure RAGFlow as a remote client to MinerU: - - `MINERU_APISERVER`: The MinerU API endpoint (e.g., `http://mineru-host:8886`). - - `MINERU_BACKEND`: The MinerU backend: - - `"pipeline"` (default) - - `"vlm-http-client"` - - `"vlm-transformers"` - - `"vlm-vllm-engine"` - - `"vlm-mlx-engine"` - - `"vlm-vllm-async-engine"` - - `"vlm-lmdeploy-engine"`. - - `MINERU_SERVER_URL`: (optional) The downstream vLLM HTTP server (e.g., `http://vllm-host:30000`). Applicable when `MINERU_BACKEND` is set to `"vlm-http-client"`. - - `MINERU_OUTPUT_DIR`: (optional) The local directory for holding the outputs of the MinerU API service (zip/JSON) before ingestion. - - `MINERU_DELETE_OUTPUT`: Whether to delete temporary output when a temporary directory is used: - - `1`: Delete. - - `0`: Retain. -3. In the web UI, navigate to your dataset's **Configuration** page and find the **Ingestion pipeline** section: - - If you decide to use a chunking method from the **Built-in** dropdown, ensure it supports PDF parsing, then select **MinerU** from the **PDF parser** dropdown. - - If you use a custom ingestion pipeline instead, select **MinerU** in the **PDF parser** section of the **Parser** component. - -To use an external Docling Serve instance (instead of local in-process Docling), set: - -- `DOCLING_SERVER_URL`: The Docling Serve API endpoint (for example, `http://docling-host:5001`). - -When `DOCLING_SERVER_URL` is set, RAGFlow sends PDF content to Docling Serve (`/v1/convert/source`, with fallback to `/v1alpha/convert/source`) and ingests the returned markdown/text. If the variable is not set, RAGFlow keeps using local Docling (`USE_DOCLING=true` + installed package) behavior. - -:::note -All MinerU environment variables are optional. When set, these values are used to auto-provision a MinerU OCR model for the tenant on first use. To avoid auto-provisioning, skip the environment variable settings and only configure MinerU from the **Model providers** page in the UI. -::: - -:::caution WARNING -Third-party visual models are marked **Experimental**, because we have not fully tested these models for the aforementioned data extraction tasks. -::: - -### Spreadsheet parser - -A spreadsheet parser outputs `html`, preserving the original layout and table structure. You may remove this parser if your dataset contains no spreadsheets. - -### Image parser - -An Image parser uses a native OCR model for text extraction by default. You may select an alternative VLM model, provided that you have properly configured it on the **Model provider** page. - -### Email parser - -With the Email parser, you select the fields to parse from Emails, such as **subject** and **body**. The parser will then extract text from these specified fields. - -### Text&Markup parser - -A Text&Markup parser automatically removes all formatting tags (e.g., those from HTML and Markdown files) to output clean, plain text only. - -### Word parser - -A Word parser outputs `json`, preserving the original document structure information, including titles, paragraphs, tables, headers, and footers. - -### PowerPoint (PPT) parser - -A PowerPoint parser extracts content from PowerPoint files into `json`, processing each slide individually and distinguishing between its title, body text, and notes. - -### Audio parser - -An Audio parser transcribes audio files to text. To use this parser, you must first configure an ASR model on the **Model provider** page. - -### Video parser - -A Video parser transcribes video files to text. To use this parser, you must first configure a VLM model on the **Model provider** page. - -## Output - -The global variable names for the output of the **Parser** component, which can be referenced by subsequent components in the ingestion pipeline. - -| Variable name | Type | -|---------------|-----------------| -| `markdown` | `string` | -| `text` | `string` | -| `html` | `string` | -| `json` | `Array` | diff --git a/docs/guides/agent/agent_component_reference/retrieval.mdx b/docs/guides/agent/agent_component_reference/retrieval.mdx deleted file mode 100644 index 910369c577..0000000000 --- a/docs/guides/agent/agent_component_reference/retrieval.mdx +++ /dev/null @@ -1,152 +0,0 @@ ---- -sidebar_position: 3 -slug: /retrieval_component -sidebar_custom_props: { - categoryIcon: LucideFolderSearch -} ---- -# Retrieval component - -A component that retrieves information from specified datasets. - -## Scenarios - -A **Retrieval** component is essential in most RAG scenarios, where information is extracted from designated datasets before being sent to the LLM for content generation. A **Retrieval** component can operate either as a standalone workflow module or as a tool for an **Agent** component. In the latter role, the **Agent** component has autonomous control over when to invoke it for query and retrieval. - -The following screenshot shows a reference design using the **Retrieval** component, where the component serves as a tool for an **Agent** component. You can find it from the **Report Agent Using Knowledge Base** Agent template. - -![retrieval_reference_design](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/retrieval_reference_design.jpg) - -## Prerequisites - -Ensure you [have properly configured your target dataset(s)](../../dataset/configure_knowledge_base.md). - -## Quickstart - -### 1. Click on a **Retrieval** component to show its configuration panel - -The corresponding configuration panel appears to the right of the canvas. Use this panel to define and fine-tune the **Retrieval** component's search behavior. - -### 2. Input query variable(s) - -The **Retrieval** component depends on query variables to specify its queries. - -:::caution IMPORTANT -- If you use the **Retrieval** component as a standalone workflow module, input query variables in the **Input Variables** text box. -- If it is used as a tool for an **Agent** component, input the query variables in the **Agent** component's **User prompt** field. -::: - -By default, you can use `sys.query`, which is the user query and the default output of the **Begin** component. All global variables defined before the **Retrieval** component can also be used as query statements. Use the `(x)` button or type `/` to show all the available query variables. - -### 3. Select dataset(s) to query - -You can specify one or multiple datasets to retrieve data from. If selecting multiple, ensure they use the same embedding model. - -### 4. Expand **Advanced Settings** to configure the retrieval method - -By default, a combination of weighted keyword similarity and weighted vector cosine similarity is used for retrieval. If a rerank model is selected, a combination of weighted keyword similarity and weighted reranking score will be used instead. - -As a starter, you can skip this step to stay with the default retrieval method. - -:::caution WARNING -Using a rerank model will *significantly* increase the system's response time. -::: - -### 5. Enable cross-language search - -If your user query is different from the languages of the datasets, you can select the target languages in the **Cross-language search** dropdown menu. The model will then translates queries to ensure accurate matching of semantic meaning across languages. - - -### 6. Test retrieval results - -Click the **Run** button on the top of canvas to test the retrieval results. - -### 7. Choose the next component - -When necessary, click the **+** button on the **Retrieval** component to choose the next component in the workflow from the dropdown list. - - -## Configurations - -### Query variables - -*Mandatory* - -Select the query source for retrieval. Defaults to `sys.query`, which is the default output of the **Begin** component. - -The **Retrieval** component relies on query variables to specify its queries. All global variables defined before the **Retrieval** component can also be used as queries. Use the `(x)` button or type `/` to show all the available query variables. - -### Retrieval from - -Select the dataset(s) or memory to retrieve data from. - -- If you select multiple datasets, you must ensure that the datasets you select use the same embedding model; otherwise, an error message would occur. -- If you select **Memory**, configure either of the following: - - **Memory**: Retrieve from specific existing memories. - - **User ID**: Retrieve from conversations associated with a User ID. See [User ID](./message.md#user-id) for further details. - -### Similarity threshold - -RAGFlow employs a combination of weighted keyword similarity and weighted vector cosine similarity during retrieval. This parameter sets the threshold for similarities between the user query and chunks stored in the datasets. Any chunk with a similarity score below this threshold will be excluded from the results. - -Defaults to 0.2. - -### Vector similarity weight - -This parameter sets the weight of vector similarity in the composite similarity score. The total of the two weights must equal 1.0. Its default value is 0.3, which means the weight of keyword similarity in a combined search is 1 - 0.3 = 0.7. - -### Top N - -This parameter selects the "Top N" chunks from retrieved ones and feed them to the LLM. - -Defaults to 8. - - -### Rerank model - -*Optional* - -If a rerank model is selected, a combination of weighted keyword similarity and weighted reranking score will be used for retrieval. - -:::caution WARNING -Using a rerank model will *significantly* increase the system's response time. -::: - -### Empty response - -- Set this as a response if no results are retrieved from the dataset(s) for your query, or -- Leave this field blank to allow the chat model to improvise when nothing is found. - -:::caution WARNING -If you do not specify a dataset, you must leave this field blank; otherwise, an error would occur. -::: - -### Cross-language search - -Select one or more languages for cross‑language search. If no language is selected, the system searches with the original query. - -### Use knowledge graph - -:::caution IMPORTANT -Before enabling this feature, ensure you have properly [constructed a knowledge graph from each target dataset](../../dataset/advanced/construct_knowledge_graph.md). -::: - -Whether to use knowledge graph(s) in the specified dataset(s) during retrieval for multi-hop question answering. When enabled, this would involve iterative searches across entity, relationship, and community report chunks, greatly increasing retrieval time. - -### PageIndex - -Whether to use the page index structure generated by the large model to enhance retrieval. This approach mimics human information-searching behavior in books. - -### Output - -The global variable name for the output of the **Retrieval** component, which can be referenced by other components in the workflow. - - -## Frequently asked questions - -### How to reduce response time? - -Go through the checklist below for best performance: - -- Leave the **Rerank model** field empty to disable rerank. -- Disable **Use knowledge graph**. diff --git a/docs/guides/agent/agent_component_reference/switch.mdx b/docs/guides/agent/agent_component_reference/switch.mdx deleted file mode 100644 index d98ca82c00..0000000000 --- a/docs/guides/agent/agent_component_reference/switch.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -sidebar_position: 6 -slug: /switch_component -sidebar_custom_props: { - categoryIcon: LucideSplit -} ---- -# Switch component - -A component that evaluates whether specified conditions are met and directs the follow of execution accordingly. - ---- - -A **Switch** component evaluates conditions based on the output of specific components, directing the flow of execution accordingly to enable complex branching logic. - -## Scenarios - -A **Switch** component is essential for condition-based direction of execution flow. While it shares similarities with the [Categorize](./categorize.mdx) component, which is also used in multi-pronged strategies, the key distinction lies in their approach: the evaluation of the **Switch** component is rule-based, whereas the **Categorize** component involves AI and uses an LLM for decision-making. - -## Configurations - -### Case n - -A **Switch** component must have at least one case, each with multiple specified conditions. When multiple conditions are specified for a case, you must set the logical relationship between them to either AND or OR. - -Once a new case is added, navigate to the **Switch** component on the canvas, find the **+** button next to the case, and click it to specify the downstream component(s). - - -#### Condition - -Evaluates whether the output of specific components meets certain conditions - -:::danger IMPORTANT -When you have added multiple conditions for a specific case, a **Logical operator** field appears, requiring you to set the logical relationship between these conditions as either AND or OR. -::: - -- **Operator**: The operator required to form a conditional expression. - - Equals (default) - - Not equal - - Greater than - - Greater equal - - Less than - - Less equal - - Contains - - Not contains - - Starts with - - Ends with - - Is empty - - Not empty -- **Value**: A single value, which can be an integer, float, or string. - - Delimiters, multiple values, or expressions are *not* supported. - diff --git a/docs/guides/agent/agent_component_reference/text_processing.mdx b/docs/guides/agent/agent_component_reference/text_processing.mdx deleted file mode 100644 index 7ecfa19e14..0000000000 --- a/docs/guides/agent/agent_component_reference/text_processing.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -sidebar_position: 15 -slug: /text_processing -sidebar_custom_props: { - categoryIcon: LucideType -} ---- -# Text processing component - -A component that merges or splits texts. - ---- - -A **Text processing** component merges or splits texts. - -## Configurations - -### Method - -- Split: Split the text -- Merge: Merge the text - -### Split_ref - -Appears only when you select **Split** as method. - -The variable to be split. Type `/` to quickly insert variables. - -### Script - -Template for the merge. Appears only when you select **Merge** as method. Type `/` to quickly insert variables. - -### Delimiters - -The delimiter(s) used to split or merge the text. - -### Output - -The global variable name for the output of the component, which can be referenced by other components in the workflow. - diff --git a/docs/guides/agent/agent_component_reference/transformer.md b/docs/guides/agent/agent_component_reference/transformer.md deleted file mode 100644 index 6d64c8f19a..0000000000 --- a/docs/guides/agent/agent_component_reference/transformer.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -sidebar_position: 37 -slug: /transformer_component -sidebar_custom_props: { - categoryIcon: LucideFileStack -} ---- -# Transformer component - -A component that uses an LLM to extract insights from the chunks. - ---- - -A **Transformer** component indexes chunks and configures their storage formats in the document engine. It *typically* precedes the **Indexer** in the ingestion pipeline, but you can also chain multiple **Transformer** components in sequence. - -## Scenario - -A **Transformer** component is essential when you need the LLM to extract new information, such as keywords, questions, metadata, and summaries, from the original chunks. - -## Configurations - -### Model - -Click the dropdown menu of **Model** to show the model configuration window. - -- **Model**: The chat model to use. - - Ensure you set the chat model correctly on the **Model providers** page. - - You can use different models for different components to increase flexibility or improve overall performance. -- **Creativity**: A shortcut to **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty** settings, indicating the freedom level of the model. From **Improvise**, **Precise**, to **Balance**, each preset configuration corresponds to a unique combination of **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty**. - This parameter has three options: - - **Improvise**: Produces more creative responses. - - **Precise**: (Default) Produces more conservative responses. - - **Balance**: A middle ground between **Improvise** and **Precise**. -- **Temperature**: The randomness level of the model's output. - Defaults to 0.1. - - Lower values lead to more deterministic and predictable outputs. - - Higher values lead to more creative and varied outputs. - - A temperature of zero results in the same output for the same prompt. -- **Top P**: Nucleus sampling. - - Reduces the likelihood of generating repetitive or unnatural text by setting a threshold *P* and restricting the sampling to tokens with a cumulative probability exceeding *P*. - - Defaults to 0.3. -- **Presence penalty**: Encourages the model to include a more diverse range of tokens in the response. - - A higher **presence penalty** value results in the model being more likely to generate tokens not yet been included in the generated text. - - Defaults to 0.4. -- **Frequency penalty**: Discourages the model from repeating the same words or phrases too frequently in the generated text. - - A higher **frequency penalty** value results in the model being more conservative in its use of repeated tokens. - - Defaults to 0.7. -- **Max tokens**: - - The maximum context size of the model. - -:::tip NOTE -- It is *not* necessary to stick with the same model for all components. If a specific model is not performing well for a particular task, consider using a different one. -- If you are uncertain about the mechanism behind **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty**, simply choose one of the three options of **Creativity**. -::: - -### Result destination - -Select the type of output to be generated by the LLM: - -- Summary -- Keywords -- Questions -- Metadata - -### System prompt - -Typically, you use the system prompt to describe the task for the LLM, specify how it should respond, and outline other miscellaneous requirements. We do not plan to elaborate on this topic, as it can be as extensive as prompt engineering. - -:::tip NOTE -The system prompt here automatically updates to match your selected **Result destination**. -::: - -### User prompt - -The user-defined prompt. For example, you can type `/` or click **(x)** to insert variables of preceding components in the ingestion pipeline as the LLM's input. - -### Output - -The global variable name for the output of the **Transformer** component, which can be referenced by subsequent **Transformer** components in the ingestion pipeline. - -- Default: `chunks` -- Type: `Array` \ No newline at end of file diff --git a/docs/guides/agent/agent_introduction.md b/docs/guides/agent/agent_introduction.md deleted file mode 100644 index 8e05ab7889..0000000000 --- a/docs/guides/agent/agent_introduction.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -sidebar_position: 1 -slug: /agent_introduction -sidebar_custom_props: { - categoryIcon: LucideBookOpenText -} ---- -# Introduction - -Key concepts, basic operations, a quick view of the agent editor. - ---- - -:::danger DEPRECATED! -A new version is coming soon. -::: - -## Key concepts - -Agents and RAG are complementary techniques, each enhancing the other’s capabilities in business applications. RAGFlow v0.8.0 introduces an agent mechanism, featuring a no-code workflow editor on the front end and a comprehensive graph-based task orchestration framework on the back end. This mechanism is built on top of RAGFlow's existing RAG solutions and aims to orchestrate search technologies such as query intent classification, conversation leading, and query rewriting to: - -- Provide higher retrievals and, -- Accommodate more complex scenarios. - -## Create an agent - -:::tip NOTE - -Before proceeding, ensure that: - -1. You have properly set the LLM to use. See the guides on [Configure your API key](../models/llm_api_key_setup.md) or [Deploy a local LLM](../models/deploy_local_llm.mdx) for more information. -2. You have a dataset configured and the corresponding files properly parsed. See the guide on [Configure a dataset](../dataset/configure_knowledge_base.md) for more information. - -::: - -Click the **Agent** tab in the middle top of the page to show the **Agent** page. As shown in the screenshot below, the cards on this page represent the created agents, which you can continue to edit. - -![Agent_list](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/agent_list.jpg) - -We also provide templates catered to different business scenarios. You can either generate your agent from one of our agent templates or create one from scratch: - -1. Click **+ Create agent** to show the **agent template** page: - - ![agent_template](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/agent_template_list.jpg) - -2. To create an agent from scratch, click **Create Agent**. Alternatively, to create an agent from one of our templates, click the desired card, such as **Deep research**, name your agent in the pop-up dialogue, and click **OK** to confirm. - - *You are now taken to the **no-code workflow editor** page.* - - ![add_component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/add_component.jpg) - -3. Click the **+** button on the **Begin** component to select the desired components in your workflow. -4. Click **Save** to apply changes to your agent. diff --git a/docs/guides/agent/agent_overview/_category_.json b/docs/guides/agent/agent_overview/_category_.json new file mode 100644 index 0000000000..2e330eb1a2 --- /dev/null +++ b/docs/guides/agent/agent_overview/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Agent Overview", + "position": 2, + "link": { + "type": "generated-index", + "description": "Agent Overview" + }, + "customProps": { + "categoryIcon": "RagAiAgent" + } +} diff --git a/docs/guides/agent/agent_overview/purpose_of_agent.md b/docs/guides/agent/agent_overview/purpose_of_agent.md new file mode 100644 index 0000000000..82daa289c2 --- /dev/null +++ b/docs/guides/agent/agent_overview/purpose_of_agent.md @@ -0,0 +1,17 @@ +--- +sidebar_position: 1 +slug: /purpose_of_agent +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Purpose of Agent +Agent is the business workflow orchestration capability in RAGFlow. Users can add components on a no-code canvas and define execution order via connections. Components can be executed sequentially, or enter different paths according to conditional branches, classification results or loop logic. + +Agents are commonly used in the following scenarios: +- Answering user questions based on knowledge bases. +- Identifying user intents and routing to different processing flows. +- Calling HTTP interfaces, databases, MCP tools or custom code. +- Splitting and batch processing long texts. +- Saving session memory or exporting processing results. diff --git a/docs/guides/agent/agent_overview/relationship_between_agent_and_knowledge_base_qa.md b/docs/guides/agent/agent_overview/relationship_between_agent_and_knowledge_base_qa.md new file mode 100644 index 0000000000..b237535cb0 --- /dev/null +++ b/docs/guides/agent/agent_overview/relationship_between_agent_and_knowledge_base_qa.md @@ -0,0 +1,15 @@ +--- +sidebar_position: 2 +slug: /relationship_between_agent_and_knowledge_base_qa +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Relationship Between Agent and Knowledge Base Q&A +- **Chat**: Suitable for applications mainly based on knowledge base Q&A and multi-turn dialogue. +- **Agent**: Suitable for business workflows requiring conditional branching, tool calling, data processing or multi-step orchestration. + +The `Retrieval` component can be used inside an Agent to query knowledge bases. Retrieval can also be used as a tool under the Agent component, allowing the LLM to autonomously decide when to perform retrieval. + +For example, an after-sales Agent can first use `Categorize` to judge the type of user questions, then use `Retrieval` to query product materials. If the user requests installation reservation, an HTTP request is used to call the external work order system. Finally, the `Message` component outputs the result. diff --git a/docs/guides/agent/agent_quickstarts/_category_.json b/docs/guides/agent/agent_quickstarts/_category_.json deleted file mode 100644 index fc5ce9c0ac..0000000000 --- a/docs/guides/agent/agent_quickstarts/_category_.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "label": "Quickstarts", - "position": 2, - "link": { - "type": "generated-index", - "description": "Agent-specific quickstart" - }, - "customProps": { - "categoryIcon": "LucideRocket" - } -} diff --git a/docs/guides/agent/agent_quickstarts/build_ecommerce_customer_support_agent.md b/docs/guides/agent/agent_quickstarts/build_ecommerce_customer_support_agent.md deleted file mode 100644 index 93e66ba3de..0000000000 --- a/docs/guides/agent/agent_quickstarts/build_ecommerce_customer_support_agent.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -sidebar_position: 3 -slug: /ecommerce_customer_support_agent -sidebar_custom_props: { - categoryIcon: LucideStethoscope -} ---- - -# Build Ecommerce customer support agent - -This quickstart guides you through building an intelligent e‑commerce customer support agent. The agent uses RAGFlow’s workflow and Agent framework to automatically handle common customer requests such as product comparisons, usage instructions, and installation bookings—providing fast, accurate, and context-aware responses. In the following sections, we will walk you through the process of building an Ecommerce customer support Agent as shown below: - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/ecommerce_cs_agent_entirety.PNG) - -## Prerequisites - -- Sample datasets (available from [Hugging Face](https://huggingface.co/datasets/InfiniFlow/Ecommerce-Customer-Service-Workflow)). - -## Procedures - -### Prepare datasets - -1. Ensure that the above-mentioned sample datasets are downloaded. -2. Create two datasets: - - Product Information - - User Guide -3. Upload the corresponding documents to each dataset. -4. On the configurations page of both datasets, choose **Manual** as chunking method. - *RAGFlow preserves content integrity by splitting documents at the “smallest heading” level, keeping text and related graphics together.* - -### Create an Agent app - -1. Navigate to the **Agent** page, create an Agent app to enter the Agent canvas. - _A **Begin** component will appear on the canvas._ -2. Configure a greeting message in the **Begin** component, for example: - - ``` - Hi! What can I do for you? - ``` -### Add Categorize component - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/add_categorize.png) - -This **Categorize** component uses an LLM to recognize user intent and route the conversation to the correct workflow. - -### Build a product feature comparison workflow - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/feature_comparison_workflow.png) - -1. Add a **Retrieval** component named “Feature Comparison Knowledge Base" and connect it to the “Product Information” dataset. -2. Add an **Agent** component named “Feature Comparison Agent” after the **Retrieval** component. -3. Configure the Agent’s System Prompt: - ``` - You are a product specification comparison assistant. Help the user compare products by confirming the models and presenting differences clearly in a structured format. - ``` -4. Configure the User Prompt: - ``` - User's query is /(Begin Input) sys.query - Schema is /(Feature Comparison Knowledge Base) formalized_content - ``` - -### Build a product user guide workflow - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/product_user_guide_workflow.png) - -1. Add a **Retrieval** component named “Usage Guide Knowledge Base” and link it to the “User Guide” dataset. -2. Add an Agent component named “Usage Guide Agent.” -3. Set its System Prompt: - ``` - You are a product usage guide assistant. Provide step‑by‑step instructions for setup, operation, and troubleshooting. - ``` -4. Set the User Prompt: - ``` - User's query is /(Begin Input) sys.query - Schema is /(Usage Guide Knowledge Base) formalized_content - ``` - -### Build an installation booking assistant - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/installation_booking_assistant.png) - -1. Add an **Agent** component named “Installation Booking Agent.” -2. Configure its System Prompt to collect three details: - - Contact number - - Preferred installation time - - Installation address - - *Once all three are collected, the agent should confirm them and notify the user that a technician will call.* - -3. Set the User Prompt: - ``` - User's query is /(Begin Input) sys.query - -4. Connect a **Message** component after the three Agent branches. - *This component displays the final response to the user.* - - ![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/reply_message.png) - -5. Click **Save** → **Run** to view execution results and verify that each query is correctly routed and answered. -6. You can test the workflow by asking: - - Product comparison questions - - Usage guidance questions - - Installation booking requests - - diff --git a/docs/guides/agent/agent_quickstarts/ingestion_pipeline_quickstart.md b/docs/guides/agent/agent_quickstarts/ingestion_pipeline_quickstart.md deleted file mode 100644 index 452463e8cd..0000000000 --- a/docs/guides/agent/agent_quickstarts/ingestion_pipeline_quickstart.md +++ /dev/null @@ -1,133 +0,0 @@ ---- -sidebar_position: 5 -slug: /ingestion_pipeline_quickstart -sidebar_custom_props: { - categoryIcon: LucideRoute -} ---- - -# Ingestion pipeline quickstart - -RAGFlow's ingestion pipeline is a customizable, step-by-step workflow that prepares your documents for high-quality AI retrieval and answering. You can think of it as building blocks: you connect different processing "components" to create a pipeline tailored to your specific documents and needs. - ---- - -RAGFlow is an open-source RAG platform with strong document processing capabilities. Its built-in module, DeepDoc, uses intelligent parsing to split documents for accurate retrieval. To handle diverse real-world needs—like varied file sources, complex layouts, and richer semantics—RAGFlow now introduces the *ingestion pipeline*. - -The ingestion pipeline lets you customize every step of document processing: - -- Apply different parsing and splitting rules per scenario -- Add preprocessing like summarization or keyword extraction -- Connect to cloud drives and online data sources -- Use advanced layout-aware models for tables and mixed content - -This flexible pipeline adapts to your data, improving answer quality in RAG. - -## 1. Understand the core pipeline components - -- **Parser** component: Reads and understands your files (PDFs, images, emails, etc.), extracting text and structure. -- **Transformer** component: Enhances text by using AI to add summaries, keywords, or questions to improve search. -- **Chunker** component: Splits long text into optimal-sized segments ("chunks") for better AI retrieval. -- **Indexer** component: The final step. Sends the processed data to the document engine (supports hybrid full-text and vector search). - -## 2. Create an ingestion pipeline - -1. Go to the **Agent** page. -2. Click **Create agent** and start from a blank canvas or a pre-built template (recommended for beginners). -3. On the canvas, drag and connect components from the right-side panel to design your flow (e.g., Parser → Chunker → Transformer → Indexer). - -*Now let's build a typical ingestion pipeline!* - -## 3. Configure Parser component - -A **Parser** component converts your files into structured text while preserving layout, tables, headers, and other formatting. Its supported files 8 categories, 23+ formats including PDF, Image, Audio, Video, Email, Spreadsheet (Excel), Word, PPT, HTML, and Markdown. The following are some key configurations: - -- For PDF files, choose one of the following: - - **DeepDoc** (Default): RAGFlow's built-in model. Best for scanned documents or complex layouts with tables. - - **MinerU**: Industry-leading for complex elements like mathematical formulas and intricate layouts. - - **Naive**: Simple text extraction. Use for clean, text-based PDFs without complex elements. -- For image files: Default uses OCR. Can also configure Vision Language Models (VLMs) for advanced visual understanding. -- For Email Files: Select specific fields to parse (e.g., "subject", "body") for precise extraction. -- For Spreadsheets: Outputs in HTML format, preserving row/column structure. -- For Word/PPT: Outputs in JSON format, retaining document hierarchy (titles, paragraphs, slides). -- For Text & Markup (HTML/MD): Automatically strips formatting tags, outputting clean text. - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/parser1.png) -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/parser2.png) - -## 4. Configure Chunker component - -The chunker component splits text intelligently. It's goal is to prevent AI context window overflow and improve semantic accuracy in hybrid search. There are two core methods (Can be used sequentially): - -- By Tokens (Default): - - Chunk Size: Default is 512 tokens. Balance between retrieval quality and model compatibility. - - Overlap: Set **Overlapped percent** to duplicate end of one chunk into start of next. Improves semantic continuity. - - Separators: Default uses `\n` (newlines) to split at natural paragraph boundaries first, avoiding mid-sentence cuts. -- By Title (Hierarchical): - - Best for structured documents like manuals, papers, legal contracts. - - System splits document by chapter/section structure. Each chunk represents a complete structural unit. - -:::caution IMPORTANT -In the current design, if using both Token and Title methods, connect the **Token chunker** component first, then **Title chunker** component. Connecting **Title chunker** directly to **Parser** may cause format errors for Email, Image, Spreadsheet, and Text files. -::: - -## 5. Configure Transformer component - -A **Transformer** component is designed to bridge the "Semantic Gap". Generally speaking, it uses AI models to add semantic metadata, making your content more discoverable during retrieval. It has four generation types: - -- Summary: Create concise overviews. -- Keywords: Extract key terms. -- Questions: Generate questions each text chunk can answer. -- Metadata: Custom metadata extraction. - -If you have multiple **Transformers**, ensure that you separate **Transformer** components for each function (e.g., one for Summary, another for Keywords). - -The following are some key configurations: - -- Model modes: (choose one) - - Improvise: More creative, good for question generation. - - Precise: Strictly faithful to text, good for Summary/Keyword extraction. - - Balance: Middle ground for most scenarios. -- Prompt engineering: System prompts for each generation type are open and customizable. -- Connection: **Transformer** can connect after **Parser** (processes whole document) OR after **Chunker** (processes each chunk). -- Variable referencing: The node doesn't auto-acquire content. In the User prompt, manually reference upstream variables by typing `/` and selecting the specific output (e.g., `/{Parser.output}` or `/{Chunker.output}`). -- Series connection: When chaining **Transformers**, the second **Transformer** component will process the output of the first (e.g., generate Keywords from a Summary) if variables are correctly referenced. - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/transformer1.png) -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/transformer2.png) -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/transformer3.png) - -## 6. Configure Indexer component - -The **Indexer** component indexes for optimal retrieval. It is the final step writes processed data to the search engine (such as Infinity, Elasticsearch, OpenSearch). The following are some key configurations: - -- Search methods: - - Full-text: Keyword search for exact matches (codes, names). - - Embedding: Semantic search using vector similarity. - - Hybrid (Recommended): Both methods combined for best recall. -- Retrieval Strategy: - - Processed text (Default): Indexes the chunked text. - - Questions: Indexes generated questions. Often yields higher similarity matching than text-to-text. - - Augmented context: Indexes summaries instead of raw text. Good for broad topic matching. -- Filename weight: Slider to include document filename as semantic information in retrieval. -- Embedding model: Automatically uses the model set when creating the dataset. - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/indexer.png) - -:::caution IMPORTANT -To search across multiple datasets simultaneously, all selected datasets must use the same embedding model. -::: - -## 7. Test run - -Click **Run** on your pipeline canvas to upload a sample file and see the step-by-step results. - -## 8. Connect pipeline to a dataset - -1. When creating or editing a dataset, find the **Ingestion pipeline** section. -2. Click **Choose pipeline** and select your saved pipeline. - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/dataset_ingestion_settings.png) - -*Now, any files uploaded to this dataset will be processed by your custom pipeline.* - diff --git a/docs/guides/agent/agent_workflow/_category_.json b/docs/guides/agent/agent_workflow/_category_.json new file mode 100644 index 0000000000..41c63fdf19 --- /dev/null +++ b/docs/guides/agent/agent_workflow/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Agent Workflow", + "position": 7, + "link": { + "type": "generated-index", + "description": "Agent Workflow" + }, + "customProps": { + "categoryIcon": "RagAiAgent" + } +} diff --git a/docs/guides/agent/agent_workflow/basic_component_configuration.md b/docs/guides/agent/agent_workflow/basic_component_configuration.md new file mode 100644 index 0000000000..a1ad36fcfe --- /dev/null +++ b/docs/guides/agent/agent_workflow/basic_component_configuration.md @@ -0,0 +1,160 @@ +--- +sidebar_position: 1 +slug: /basic_component_configuration +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Basic Component Configuration +## Begin Component +`Begin` is the start of the Agent workflow, used to set trigger mode, opening greeting and global input variables. Every Agent must contain exactly one Begin component. + +### Trigger Modes +- **Conversational**: Triggered via dialogue, suitable for regular chat Agents. +- **Task**: Started as a task, suitable for non-dialog automated workflows. +- **Webhook**: Triggered by external HTTP requests, suitable for system integration, automation tasks and third-party callbacks. +When Webhook mode is selected, the system generates the Agent Webhook URL. You can further configure request method, security authentication, request Schema and response mode. + +### Opening Greeting +In Conversational mode, set the first message sent by the Agent in Opening greeting. The greeting should clearly describe supported capabilities instead of lengthy introductions. + +Example: +> Hello, I can help you query product materials, compare models and generate installation suggestions. +> Please describe your question or upload files for analysis. + +### Input Variables +Input defines parameters users need to provide before dialogue starts. After configuration, subsequent components can reference these inputs via variables. + +On the Input section of the Begin configuration panel, click the `+` button to add new input variables. + +Common fields: +- **Name**: Display name of variable +- **Type**: Variable type +- **Key**: Variable key referenced by downstream components +- **Optional**: Whether this input is optional + +Variable Types: +| Type | Description | +| ---- | ---- | +| Single-line text | Short text input: names, keywords, serial numbers | +| Paragraph text | Long content: requirement descriptions, prompts, problem details | +| Dropdown options | Predefined selection list, suitable for fixed options such as language, department | +| File upload | Allow users to upload files as workflow input for document analysis and image processing. Uploaded files will NOT be automatically saved to knowledge bases and are only used within the current workflow. | +| Number | Numeric input: quantity, threshold, Top K value, maximum return entries | +| Boolean | Toggle (True/False) to enable functions or confirm execution branches | + +:::tip NOTE +Files uploaded through the Begin component are only used as workflow input. They will not be automatically saved to knowledge bases, nor use knowledge base parsing, OCR or chunking capabilities. File content can be passed to subsequent components as variables and limited by model context length. +::: + +![Begin Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/begin_component_1.jpg) + +![Begin Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/begin_component_2.jpg) + +## Agent Component +The Agent component invokes LLMs for reasoning, content generation, task planning and tool calling. It can process user questions independently or cooperate with retrieval, HTTP requests, code, databases and sub-agents to complete multi-step tasks. + +Capabilities: +- Reason, reflect and adjust logic based on context and execution results +- Call tools or sub-agents to complete tasks +- Control reply style, task boundaries and output format via system & user prompts + +### Basic Configuration Steps +1. Click the Agent component to open the right configuration panel. +2. Select a chat model in Model. +3. Adjust Creativity or keep Precise by default. +4. Define role, constraints and output format in System prompt. +5. Write task instructions in User prompt and insert variables by typing `/`. +6. Add Tools or sub-Agents if retrieval, SQL, HTTP, MCP or nested agents are required. +7. Set output variable name. +8. Save and run tests. + +### Prompt Configuration +- **System Prompt**: Define model role and behavior boundaries. +- **User Prompt**: Define current task and input data. + +If the Agent component follows a Retrieval component, usually reference `formalized_content` in User Prompt to make the model answer based on retrieved documents. + +Example: +> Please answer `/Retrieval_0.formalized_content` according to `/sys.query`. If retrieval results are insufficient, clearly state that confirmation cannot be obtained from the knowledge base and do not fabricate answers. + +### Tools & Sub-Agents +When tools or sub-Agents are attached under an Agent component, the current Agent acts as a planner to judge when to invoke these capabilities. Tools include Retrieval, Execute SQL, HTTP Request, MCP Server and other available components. Sub-Agents split complex tasks for multi-role collaboration. + +It is recommended to specify trigger conditions in system prompts: +> Retrieve knowledge base when questions involve product documents; call HTTP interface when querying order status. + +:::tip NOTE +Tool calling, sub-agents, reflection rounds and larger message window size will increase response latency. Prioritize simple pipelines for regular Q&A; enable planning logic only when necessary. +::: +### Advanced Settings +Advanced settings control context management, exception handling and output format during runtime. Keep default values in most cases; adjust when optimizing effect or adapting to business requirements. + +| Parameter | Description | Suggestion | +| ---- | ---- | ---- | +| Message window size | Number of historical messages retained during LLM reasoning. Larger windows provide more context but consume more tokens. | Keep default; increase for multi-turn dialogue, decrease for single-turn tasks | +| Citation | Whether to return source citations in answers when using knowledge bases. | Enable for knowledge Q&A scenarios | +| Max retries | Maximum retry attempts after Agent execution failure. | Keep default; increase under unstable network | +| Delay after error | Waiting time (seconds) before each retry to avoid continuous failed requests. | Keep default | +| Exception handling method | Execution policy when exceptions occur. | Adjust based on business requirements | + +### Output Configuration +Two output types are supported: +1. **content**: Default natural language text returned by Agent +2. **structured**: Structured data output. After enabling Structured output, define the format with JSON Schema to standardize returned fields for Code, HTTP Request, SQL and conditional judgment nodes. + +![Agent Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/agent_component_1.jpg) + +![Agent Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/agent_component_2.jpg) + +![Agent Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/agent_component_3.jpg) + +![Agent Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/agent_component_4.jpg) + + +## Retrieval Component +The Retrieval component fetches relevant content from specified knowledge bases or memory. It can be used as an independent workflow component or as a tool inside an Agent component. + +Configuration Steps: +1. Click the Retrieval component. +2. Select query source for Query variable (commonly `sys.query`). +3. Select one or more knowledge bases or Memory as retrieval source. +4. Adjust similarity threshold, keyword similarity weight and Top N. +5. Enable Cross-language search for multilingual scenarios. +6. Enable Use knowledge graph for multi-hop graph Q&A. +7. Run and test retrieval results. + +Parameter Explanation: +- **Similarity threshold**: Filter low-relevance chunks. Higher values enforce stricter matching but may omit useful content. +- **Keyword similarity weight**: Control vector weight in comprehensive similarity. All knowledge bases used together must share the same embedding model. +- **Top N**: Number of chunks passed to downstream components. Too few leads to insufficient information; too many increases latency and token usage. +- **Rerank model**: Improve sorting of retrieved results, adds latency. Disable for latency-sensitive Agents. + +Initial Configuration Reference: +| Parameter | Suggested Value | Scenario | Description | +| ---- | ---- | ---- | ---- | +| Top N | 3~5 | FAQ, short knowledge entries | Faster response for clear answers | +| Top N | 5~10 | Product documentation, help center | Default recommended range | +| Top N | 10~20 | Legal contracts, long document analysis | More context, higher token consumption | +| Similarity threshold | 0.2 | Loose recall | Questions with diverse expression patterns | +| Similarity threshold | 0.5 | General Q&A | Default starting value | +| Similarity threshold | 0.8 | Strict precise matching | Scenarios requiring exact terminology matching | + +![Knowledge Retrieval Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/knowledge_retrieval_component_1.jpg) + +![Knowledge Retrieval Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/knowledge_retrieval_component_2.jpg) + + +## Message Component +The Message component outputs static or dynamic content to users, usually as the final component of a workflow. It supports fixed text and variable insertion. Multiple message entries can be configured; the system randomly selects one to send. + +When Begin uses Webhook mode with Final response as response method, the Message component can set HTTP status codes (200 ~ 399). + +**Save to Memory**: Enable this option to store dialogue sessions into specified memory. Bind User ID to associate conversations with users; subsequent retrieval can query memory filtered by user ID. + +Applicable scenarios: Output final answers, branch hints, fallback replies or display intermediate processing results. Output content will be sent to dialogue windows, webhook responses or embedded pages. + +![Reply Message Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/reply_message_component_1.jpg) + +![Reply Message Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/reply_message_component_2.jpg) diff --git a/docs/guides/agent/agent_workflow/data_manipulation_components.md b/docs/guides/agent/agent_workflow/data_manipulation_components.md new file mode 100644 index 0000000000..6c88a93ad9 --- /dev/null +++ b/docs/guides/agent/agent_workflow/data_manipulation_components.md @@ -0,0 +1,107 @@ +--- +sidebar_position: 3 +slug: /data_manipulation_components +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Data Manipulation Components +## Code Component +The Code component executes Python or JavaScript code for complex data processing, format conversion, calculation, file generation and custom logic. + +Prerequisite: The Code component depends on a secure sandbox environment. The deployment environment needs to install and enable gVisor, RAGFlow sandbox and related environment variables. Restart the service after dependency changes. + +Configuration: +1. **Input**: Define parameters passed into code; variables can be directly referenced inside scripts. +2. **Code**: Select Python or JavaScript and write business logic. +3. **Return Value**: Define output data returned to downstream components. + +![Code Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/code_component.jpg) + + +## Text Processing Component +Text Processing splits or merges text. Used to split long upstream text by separators or combine multiple variables into one template. + +Processing Modes: +- **Merge**: Concatenate content sequentially +- **Split**: Split text by specified delimiters (comma, line break, space etc.) + +Configure script content with variables inserted via `/`. Output results can be referenced by subsequent nodes. + +![Text Processing Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/text_processing_component.jpg) + + +## Data Operation Component +Data Operation processes structured objects returned by upstream tools, code or database nodes to clean data for downstream usage. + +Configuration Steps: +1. Add and select the Data Operation component on canvas. +2. Select target data variables in Query variables. +3. Click `+` to add multiple input variables. Query variables are mandatory. +4. Select processing operation in Operations and fill corresponding configurations. +5. Save and run tests. + +Output: Processed data stored in variable `result`. + +Supported Operations: +| Operation | Function | Scenario | +| ---- | ---- | ---- | +| Select keys | Keep only specified fields | Extract required fields for downstream nodes | +| Literal eval | Convert string-formatted list/dict/bool/number into actual data types | Parse serialized structured strings | +| Combine | Merge multiple objects into one | Aggregate outputs from multiple upstream nodes | +| Filter values | Filter data matching conditions | Filter array/object collections | +| Append or update | Add new fields or overwrite existing field values | Supplement or modify object attributes | +| Remove keys | Delete specified fields | Remove unnecessary sensitive or unused fields | +| Rename keys | Rename object field keys | Unify field naming standards | + +![Data Operation Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/data_operation_component.jpg) + + +## Variable Assignor Component +Variable Assignor writes or updates variables during workflow execution. It can save upstream results to target variables and support overwrite, clear, append and arithmetic operations for numbers, arrays and objects. + +Configuration: +Add variable rules. Select target variable, choose operation type, and fill constant or reference variable as value if required. Multiple rules execute sequentially. + +Supported Operations: +| Operation | Requires Value | Description | +| ---- | ---- | ---- | +| Overwritten by | Yes | Overwrite target variable with another variable's value | +| Set | Yes | Assign fixed constant value to target variable | +| Clear | No | Empty the target variable | + +![Variable Assigner Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/variable_assigner_component.jpg) + + +## List Operation Component +List Operation processes array data, supporting element extraction, head/tail fetching, filtering, sorting and deduplication. Suitable for array outputs from Begin, HTTP Request, Code and SQL. + +Configuration: +1. Select array variable in Query variables. +2. Choose operation in Operations and fill parameters. +3. Optional: Enable Strict mode. + +Strict Mode: +- Enabled: Return error when input data format is abnormal +- Disabled: Handle abnormal data with default tolerance + +Supported Operations: +- Nth: Get element at specified index (starting from 0) +- Head: Get first N elements +- Tail: Get last N elements +- Filter: Filter array by conditions +- Sort: Sort array by specified field (asc/desc) +- Drop duplicates: Remove duplicate entries + +## Variable Aggregator Component +Variable Aggregator combines multiple independent variables into one output group for unified reference by downstream nodes. Widely used in multi-branch conditional workflows to collect data from different branches. + +Configuration: +1. Select variables and add into variable groups (default Group0). +2. Click `+` to create new variable groups; delete groups via remove button. +3. Save configuration and run tests. + +Output: Variables inside each group can be referenced via group name such as `Group0`. + +![Variable Aggregation Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/variable_aggregation_component.jpg) diff --git a/docs/guides/agent/agent_workflow/flow_control_components.md b/docs/guides/agent/agent_workflow/flow_control_components.md new file mode 100644 index 0000000000..88e27de8be --- /dev/null +++ b/docs/guides/agent/agent_workflow/flow_control_components.md @@ -0,0 +1,70 @@ +--- +sidebar_position: 2 +slug: /flow_control_components +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Flow Control Components +## Await Response Component +Await Response pauses the workflow and waits for users to supplement information. Suitable for multi-turn dialogue, form collection, confirmation operations or file upload requirements. + +Configuration: +Define prompt messages to guide users. Input supports the same variable types as Begin: single-line text, paragraph text, dropdown options, file upload, number and boolean. + +Recommendations: +- Dropdown options: Select business categories +- Paragraph text: Collect detailed requirement descriptions +- File upload: Receive contracts, reports or screenshots +- Boolean: Confirm continue/cancel operations + +![User Input Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/user_input_component.jpg) + + +## Switch (Conditional) Component +Switch executes rule-based judgment and routes workflows to different downstream paths according to results. + +Configuration: +At least one Case must be defined. Each Case can contain multiple conditions combined by AND / OR. +Supported operators: Equals, Not equal, Greater than, Greater equal, Less than, Less equal, Contains, Not contains, Starts with, Ends with, Is empty, Not empty. + +:::tip NOTE +Switch is rule-based judgment for structured data and clear conditions. Categorize uses LLM-based classification for natural language intent recognition. +::: + +![Condition Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/condition_component.jpg) + +## Iteration Component +Iteration splits text into fragments and executes the same set of internal components for each fragment. Suitable for long-text translation, paragraph-wise summarization, batch generation and item-by-item list processing. + +Internal Workflow: +Iteration contains built-in `Loop Item`. Components dragged inside Iteration can only be accessed within the loop. Reference `Loop Item` to obtain current fragment data. + +Configuration Parameters: +- **Loop variables**: Variables used during iteration; support read and update inside the loop +- **Loop termination condition**: Exit condition to stop iteration +- **Maximum loop count**: Prevent infinite iteration + +:::tip NOTE +Configure both termination condition and maximum loop count to avoid long-running infinite loops. +::: + +![Loop Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/loop_component.jpg) + +## Categorize Component +Categorize uses LLM to judge user intent or input category and branch the workflow based on classification results. + +Configuration Steps: +1. Select content to classify in Query variable / Input. +2. Select model and Creativity. +3. Configure message window size (keep default for single-turn classification). +4. Add at least two Categories. +5. Fill clear Name, Description and Examples for each category. +6. Connect downstream components for each classification result on the canvas. + +Classification Recommendations: +Use easy-to-understand category names, e.g. Product Consultation, Installation Reservation, After-sales Fault, Other Questions. +Examples improve classification stability; provide 2~3 typical samples for each category. + +![Question Classification Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/question_classification_component.jpg) diff --git a/docs/guides/agent/agent_workflow/tool_components.md b/docs/guides/agent/agent_workflow/tool_components.md new file mode 100644 index 0000000000..f1f1541b97 --- /dev/null +++ b/docs/guides/agent/agent_workflow/tool_components.md @@ -0,0 +1,565 @@ +--- +sidebar_position: 4 +slug: /tool_components +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Tool Components + +Tool components extend an Agent's ability to retrieve information, query data, call external systems and generate deliverables. Select tools according to the business scenario and configure only the parameters required by the workflow. + +## Tool Selection Suggestions + +- Use web search or extraction tools when the Agent needs public web information. +- Use academic retrieval tools when the Agent needs papers, medical literature or research references. +- Use SQL and financial query tools when the Agent needs structured data or market information. +- Use HTTP Request and Email for communication with external systems. +- Use Document Generator and Browser for content generation and automation tasks. + +## Web Page and Information Retrieval + +### Tavily Search (TavilySearch) + +Tavily Search retrieves web results through Tavily. It is suitable for public web search, news search and supplementing knowledge base retrieval with external information. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Search keywords or question. | +| `topic` | string | No | `general` | Search topic. Common values are `general` and `news`. | +| `search_depth` | string | No | `basic` | Search depth. Common values are `basic` and `advanced`. | +| `top_n` | integer | No | 10 | Maximum number of returned results. | + +#### Supported Parameter Values + +- `topic`: `general`, `news` +- `search_depth`: `basic`, `advanced` + +#### Configuration Example + +```json +{ + "query": "RAGFlow open source", + "topic": "general", + "search_depth": "basic" +} +``` + +#### Output Result + +The component returns search result items, including titles, URLs, snippets and related metadata. Downstream Agent or Message components can reference the result content for answer generation. + +![Tavily Search](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/tavily_search.jpg) + + +### Tavily Extract (TavilyExtract) + +Tavily Extract extracts content from specified web pages. It is suitable for reading known URLs, article pages, documentation pages or web pages found by a previous search step. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `urls` | array/string | Yes | Empty | One or more URLs to extract. | +| `extract_depth` | string | No | `basic` | Extraction depth. Common values are `basic` and `advanced`. | +| `format` | string | No | `markdown` | Output format, such as `text` or `markdown`. | + +#### Supported Parameter Values + +- `extract_depth`: `basic`, `advanced` +- `format`: `text`, `markdown` + +#### Configuration Example + +```json +{ + "urls": ["https://ragflow.io/docs"], + "extract_depth": "basic", + "format": "markdown" +} +``` + +#### Output Result + +The component returns extracted page text and metadata. The extracted text can be passed to Agent, Text Processing or Data Operation components. + +![Tavily Extract](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/tavily_extract.jpg) + + +### Google Search (Google) + +Google Search retrieves public web results through Google. It is suitable for broad web search scenarios where a Google-compatible search capability has been configured. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Search keywords. | +| `top_n` | integer | No | 10 | Maximum number of returned results. | + +#### Configuration Example + +```json +{ + "query": "RAGFlow Agent workflow" +} +``` + +#### Output Result + +The component returns search result titles, URLs and summaries for downstream processing. + +![Google Search](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/google_search.jpg) + + +### DuckDuckGo (DuckDuckGo) + +DuckDuckGo is a privacy-focused search engine component. It does not require a separate API key and can be used for general web and news retrieval. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Search keywords. | +| `channel` | string | No | `general` | Channel exposed by tool metadata, such as `general` or `news`. | +| `top_n` | integer | No | 10 | Maximum number of returned results. | + +#### Configuration Example + +```json +{ + "query": "RAGFlow open source", + "channel": "general" +} +``` + +#### Output Result + +The component returns web search result items. Confirm parameter mapping in the current version before using news retrieval. + +![Duckduckgo](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/duckduckgo_1.jpg) + +![Duckduckgo](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/duckduckgo_2.jpg) + + +### SearXNG (SearXNG) + +SearXNG searches through a configured SearXNG instance. It is suitable for teams that need self-hosted or privacy-oriented meta-search. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Search keywords. | +| `top_n` | integer | No | 10 | Maximum number of returned results. | +| `base_url` | string | Yes | Empty | SearXNG service address. | + +#### Configuration Example + +```json +{ + "query": "retrieval augmented generation", + "base_url": "https://searxng.example.com" +} +``` + +#### Output Result + +The component returns normalized search results from the configured SearXNG service. + +### Keenable (KeenableSearch) + +Keenable Search retrieves information through the configured Keenable service. Use it when the workflow requires that search provider. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Search keywords. | +| `top_n` | integer | No | 10 | Maximum number of returned results. | + +#### Configuration Example + +```json +{ + "query": "enterprise RAG deployment" +} +``` + +#### Output Result + +The component returns search results that can be used by downstream Agent or Message components. + +![Keenable Search](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/keenable_search.jpg) + + +### Wikipedia (Wikipedia) + +Wikipedia searches encyclopedia entries and extracts summaries. It is suitable for querying clear entities, concepts and historical events. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Specific entry topic or keyword. | +| `top_n` | integer | No | 10 | Maximum number of entries. | +| `language` | string | No | `en` | Wikipedia language code, such as `zh`, `en` or `ja`. | + +#### Configuration Example + +```json +{ + "query": "culture" +} +``` + +#### Output Result + +The component returns matching entries, summaries and related metadata. + +![Wikipedia](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/wikipedia.jpg) + + +## Academic Literature Retrieval + +### Google Scholar (GoogleScholar) + +Google Scholar retrieves papers, theses, books, abstracts and other academic materials. It is suitable for preliminary literature discovery and should not replace verification of original papers and citation details. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Paper topic or keywords. | +| `top_n` | integer | No | 12 | Maximum number of papers. | +| `sort_by` | string | No | `relevance` | Sort method: `date` or `relevance`. | +| `year_low` | integer/null | No | `null` | Earliest publication year. | +| `year_high` | integer/null | No | `null` | Latest publication year. | +| `patents` | boolean | No | `true` | Whether to include patents. | + +#### Configuration Example + +```json +{ + "query": "retrieval augmented generation evaluation" +} +``` + +#### Output Result + +The component returns paper titles, authors, abstracts, links and related metadata when available. + +![Google Scholar](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/google_scholar.jpg) + + +### ArXiv (ArXiv) + +ArXiv retrieves preprints from arXiv. It is suitable for computer science, mathematics, physics and related research scenarios. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Paper topic or keywords. | +| `top_n` | integer | No | 10 | Maximum number of returned papers. | + +#### Configuration Example + +```json +{ + "query": "large language model agents" +} +``` + +#### Output Result + +The component returns paper metadata such as title, authors, abstract, publication time and URL. + +![Arxiv](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/arxiv.jpg) + + +### PubMed (PubMed) + +PubMed retrieves biomedical and life science literature. It is suitable for medical, pharmaceutical and biological literature searches. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Biomedical literature query. | +| `top_n` | integer | No | 10 | Maximum number of returned papers. | + +#### Configuration Example + +```json +{ + "query": "diabetes treatment guideline" +} +``` + +#### Output Result + +The component returns PubMed records, abstracts and publication metadata when available. + +![Pubmed](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/pubmed.jpg) + + +### BGPT (BGPT) + +BGPT is used for literature or biomedical-related retrieval scenarios supported by the configured BGPT service. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Query content. | +| `top_n` | integer | No | 10 | Maximum number of returned results. | + +#### Configuration Example + +```json +{ + "query": "gene therapy review" +} +``` + +#### Output Result + +The component returns retrieval results from the BGPT service for downstream reference. + +![Bgpt](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/bgpt.jpg) + + +## Data and Financial Queries + +### Execute SQL (ExeSQL) + +Execute SQL runs SQL queries against configured databases. It is suitable for structured data query, report generation and business data analysis. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | Empty | SQL statement or natural-language query converted into SQL by the workflow. | +| `db_type` | string | No | Empty | Database type. | +| `database` | string | No | Empty | Target database or connection name. | + +#### Supported Values + +Supported database types depend on the current deployment and configured connections. + +#### Configuration Example + +```json +{ + "query": "select count(*) from orders" +} +``` + +#### Output Result + +The component returns query results, error information or structured rows for downstream components. + +![Execute SQL](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/execute_sql.jpg) + + +### Yahoo Finance (YahooFinance) + +Yahoo Finance queries market and financial information. It is suitable for stocks, funds, indexes and other market data supported by the service. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `ticker` | string | Yes | Empty | Stock, fund or index symbol. | +| `query` | string | No | `{sys.query}` | Natural-language financial query. | +| `top_n` | integer | No | 10 | Maximum number of returned results. | + +#### Supported Values + +Symbols and markets depend on Yahoo Finance data availability. + +#### Configuration Example + +```json +{ + "ticker": "AAPL" +} +``` + +#### Output Result + +The component returns financial data, market summaries or related metadata. + +### WenCai (WenCai) + +WenCai performs financial data screening through natural-language conditions, covering stocks, indexes, funds, Hong Kong stocks, U.S. stocks, futures and other query types. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `query` | string | Yes | `{sys.query}` | Stock selection or financial condition, such as "A-shares with P/E ratio below 20". | +| `top_n` | integer | No | 10 | Maximum number of results. | +| `query_type` | string | No | `stock` | Query type. | + +#### Supported Query Types + +`stock`, `zhishu`, `fund`, `hkstock`, `usstock`, `threeboard`, `conbond`, `insurance`, `futures`, `lccp`, `foreign_exchange`. + +#### Configuration Example + +```json +{ + "query": "A-shares with P/E ratio below 20 and net profit growth above 20%" +} +``` + +#### Output Result + +The component returns matched financial instruments and related fields. In some versions, the runtime may return an empty report if the actual WenCai call is disabled. + +## Communication and External Systems + +### Email + +The Email component sends emails through configured mail service parameters. It is suitable for notification, approval, report delivery and workflow result distribution. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `to` | string/list | Yes | Empty | Recipient address or addresses. | +| `subject` | string | Yes | Empty | Email subject. | +| `content` | string | Yes | Empty | Email body. | +| `attachments` | array | No | Empty | Attachment variables or file references. | + +#### Configuration Example + +```json +{ + "to": "user@example.com", + "subject": "Workflow result", + "content": "Please check the generated result." +} +``` + +#### Output Result + +The component returns send status and error information when sending fails. + +![Email](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/email.jpg) + + +### HTTP Request (Invoke) + +HTTP Request calls external HTTP interfaces. It is suitable for querying order status, writing work orders, triggering third-party services and integrating business systems. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `url` | string | Yes | Empty | Request URL. | +| `method` | string | No | `GET` | HTTP method. | +| `headers` | string/object | No | `{}` | Request headers. | +| `variables` | array | No | Empty | Variables passed into the request. | +| `timeout` | integer | No | 60 | Request timeout in seconds. | +| `proxy` | string | No | Empty | Optional HTTP/HTTPS proxy address. | +| `clean_html` | boolean | No | `false` | Whether to clean HTML tags from the response. | +| `datatype` | string | No | `json` | Python request body type: `json` or `formdata`. | +| `body` | string | No | Empty | Raw request body supported by the Go runtime. | +| `content_type` | string | No | Empty | Content-Type in the Go runtime; POST/PUT defaults to `application/json`. | + +#### Supported Values + +- `method`: `GET`, `POST`, `PUT`, `DELETE`, `PATCH` +- `datatype`: `json`, `formdata` + +#### Configuration Example + +```json +{ + "url": "https://1.1.1.1/cdn-cgi/trace", + "method": "GET", + "timeout": 30, + "headers": "{}", + "proxy": "", + "clean_html": false, + "datatype": "json", + "variables": [] +} +``` + +#### Output Result + +The component returns HTTP response content, status information and error details for downstream processing. + +![HTTP Request](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/http_request.jpg) + + +## Content Generation and Automation + +### Document Generator (DocGenerator) + +Document Generator creates documents from workflow inputs and templates. It is suitable for reports, contracts, summaries and structured document output. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `content` | string | Yes | Empty | Document content or template-filled content. | +| `output_format` | string | No | Empty | Output file format. | +| `filename` | string | No | Empty | Generated file name. | + +#### Supported Values + +Supported output formats depend on the current deployment and component configuration. + +#### Configuration Example + +```json +{ + "content": "Generate a weekly report based on the workflow result.", + "output_format": "docx", + "filename": "weekly_report" +} +``` + +#### Output Result + +The component returns generated file information and downloadable output variables. + +![Document Generator](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/document_generator.jpg) + + +### Browser (Browser) + +Browser performs browser-based automation tasks. It is suitable for opening pages, collecting page information and executing browser workflows that require visual interaction. + +#### Parameter Description + +| Parameter | Type | Required | Default | Description | +| ---- | ---- | ---- | ---- | ---- | +| `task` | string | Yes | Empty | Browser automation task description. | +| `url` | string | No | Empty | Initial page URL. | +| `timeout` | integer | No | Empty | Task timeout. | + +#### Supported Values + +Supported browser actions depend on the current deployment and browser automation capability. + +#### Configuration Example + +```json +{ + "url": "https://example.com", + "task": "Open the page and extract the main content." +} +``` + +#### Output Result + +The component returns browser execution results, extracted content or error information. diff --git a/docs/guides/agent/best_practices/_category_.json b/docs/guides/agent/best_practices/_category_.json deleted file mode 100644 index 63edea2af6..0000000000 --- a/docs/guides/agent/best_practices/_category_.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "label": "Best practices", - "position": 40, - "link": { - "type": "generated-index", - "description": "Best practices on Agent configuration." - }, - "customProps": { - "categoryIcon": "LucideStar" - } -} diff --git a/docs/guides/agent/best_practices/accelerate_agent_question_answering.md b/docs/guides/agent/best_practices/accelerate_agent_question_answering.md deleted file mode 100644 index 8099051983..0000000000 --- a/docs/guides/agent/best_practices/accelerate_agent_question_answering.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -sidebar_position: 1 -slug: /accelerate_agent_question_answering ---- - -# Accelerate answering - -A checklist to speed up question answering. - ---- - -Please note that some of your settings may consume a significant amount of time. If you often find that your question answering is time-consuming, here is a checklist to consider: - -## Balance task complexity with an Agent’s performance and speed? - -An Agent’s response time generally depends on many factors, e.g., the LLM’s capabilities and the prompt, the latter reflecting task complexity. When using an Agent, you should always balance task demands with the LLM’s ability. - -- For simple tasks, such as retrieval, rewriting, formatting, or structured data extraction, use concise prompts, remove planning or reasoning instructions, enforce output length limits, and select smaller or Turbo-class models. This significantly reduces latency and cost with minimal impact on quality. - -- For complex tasks, like multistep reasoning, cross-document synthesis, or tool-based workflows, maintain or enhance prompts that include planning, reflection, and verification steps. - -- In multi-Agent orchestration systems, delegate simple subtasks to sub-Agents using smaller, faster models, and reserve more powerful models for the lead Agent to handle complexity and uncertainty. - -:::tip KEY INSIGHT -Focus on minimizing output tokens — through summarization, bullet points, or explicit length limits — as this has far greater impact on reducing latency than optimizing input size. -::: - -## Disable Reasoning - -Disabling the **Reasoning** toggle will reduce the LLM's thinking time. For a model like Qwen3, you also need to add `/no_think` to the system prompt to disable reasoning. - -## Disable Rerank model - -- Leaving the **Rerank model** field empty (in the corresponding **Retrieval** component) will significantly decrease retrieval time. -- When using a rerank model, ensure you have a GPU for acceleration; otherwise, the reranking process will be *prohibitively* slow. - -:::tip NOTE -Please note that rerank models are essential in certain scenarios. There is always a trade-off between speed and performance; you must weigh the pros against cons for your specific case. -::: - -## Check the time taken for each task - -Click the light bulb icon above the *current* dialogue and scroll down the popup window to view the time taken for each task: - - - -| Item name | Description | -|-------------------|-----------------------------------------------------------------------------------------------| -| Total | Total time spent on this conversation round, including chunk retrieval and answer generation. | -| Check LLM | Time to validate the specified LLM. | -| Create retriever | Time to create a chunk retriever. | -| Bind embedding | Time to initialize an embedding model instance. | -| Bind LLM | Time to initialize an LLM instance. | -| Tune question | Time to optimize the user query using the context of the multi-turn conversation. | -| Bind reranker | Time to initialize an reranker model instance for chunk retrieval. | -| Generate keywords | Time to extract keywords from the user query. | -| Retrieval | Time to retrieve the chunks. | -| Generate answer | Time to generate the answer. | diff --git a/docs/guides/agent/chapter_overview.md b/docs/guides/agent/chapter_overview.md new file mode 100644 index 0000000000..8c291d4632 --- /dev/null +++ b/docs/guides/agent/chapter_overview.md @@ -0,0 +1,14 @@ +--- +sidebar_position: 1 +slug: /chapter_overview +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Chapter Overview +This chapter introduces the creation, configuration, debugging and publishing methods of RAGFlow Agent. You can connect models, knowledge bases, tools and workflow control components through a visual canvas to build intelligent agent applications such as knowledge Q&A, business query, content processing and automated execution. + +:::tip NOTE +Before using an Agent, please confirm that at least one available chat model has been configured. If the workflow needs to query knowledge bases, you also need to create knowledge bases in advance, upload files and complete parsing. +::: diff --git a/docs/guides/agent/creation_and_management/_category_.json b/docs/guides/agent/creation_and_management/_category_.json new file mode 100644 index 0000000000..30bc394191 --- /dev/null +++ b/docs/guides/agent/creation_and_management/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Creation and Management", + "position": 3, + "link": { + "type": "generated-index", + "description": "Creation and Management" + }, + "customProps": { + "categoryIcon": "RagAiAgent" + } +} diff --git a/docs/guides/agent/creation_and_management/access_agent_page.md b/docs/guides/agent/creation_and_management/access_agent_page.md new file mode 100644 index 0000000000..43e107c5fb --- /dev/null +++ b/docs/guides/agent/creation_and_management/access_agent_page.md @@ -0,0 +1,10 @@ +--- +sidebar_position: 1 +slug: /access_agent_page +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Access Agent Page +After logging into RAGFlow, click **Agent** in the top navigation bar to enter the Agent page. Created Agents are displayed as cards. Click an existing card to continue editing; click the creation entry to create a new Agent. diff --git a/docs/guides/agent/creation_and_management/create_from_blank_agent.md b/docs/guides/agent/creation_and_management/create_from_blank_agent.md new file mode 100644 index 0000000000..372f8a361d --- /dev/null +++ b/docs/guides/agent/creation_and_management/create_from_blank_agent.md @@ -0,0 +1,30 @@ +--- +sidebar_position: 3 +slug: /create_from_blank_agent +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Create from Blank Agent +When creating a blank Agent, the canvas contains a default `Begin` component. Users can click the plus sign next to the Begin component or other components to add downstream components. + +Steps: +1. Enter the Agent page. +2. Click **Create agent**. +3. Select blank creation. +4. Enter the Agent name and select the agent type. +5. Enter the canvas. +6. Click the plus sign next to the `Begin` component, and add components according to business processes. +7. Configure each component. +8. Click **Save**. + +:::tip NOTE +The `Begin` component is the start of the workflow. Each Agent can only have one Begin component and it cannot be deleted. After creation, configure Begin first, then configure subsequent components. +::: + +![Create An Agent From Blank](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/create_an_agent_from_blank_1.jpg) + +![Create An Agent From Blank](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/create_an_agent_from_blank_2.jpg) + +![Create An Agent From Blank](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/create_an_agent_from_blank_3.jpg) diff --git a/docs/guides/agent/creation_and_management/create_from_template.md b/docs/guides/agent/creation_and_management/create_from_template.md new file mode 100644 index 0000000000..953b98d831 --- /dev/null +++ b/docs/guides/agent/creation_and_management/create_from_template.md @@ -0,0 +1,26 @@ +--- +sidebar_position: 2 +slug: /create_from_template +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Create from Template +RAGFlow provides Agent templates for different business scenarios. When creating from a template, the system presets common components and connections. Users only need to modify models, knowledge bases, prompts, interface addresses or output content. + +Steps: +1. Enter the Agent page. +2. Click **Create agent**. +3. Select an appropriate template on the template page, such as Deep Research, Knowledge Base Q&A, Data Analysis or E-commerce Customer Service template. +4. Enter the Agent name. +5. Click **OK**. +6. After entering the canvas, check the configuration of each component and save. + +![Create From A Template](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/create_from_a_template_1.jpg) + +![Create From A Template](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/create_from_a_template_2.jpg) + +![Create From A Template](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/create_from_a_template_3.jpg) + +![Create From A Template](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/create_from_a_template_4.jpg) diff --git a/docs/guides/agent/creation_and_management/save_agent.md b/docs/guides/agent/creation_and_management/save_agent.md new file mode 100644 index 0000000000..09c1271ff1 --- /dev/null +++ b/docs/guides/agent/creation_and_management/save_agent.md @@ -0,0 +1,10 @@ +--- +sidebar_position: 5 +slug: /save_agent +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Save Agent +Click **Save** in time after editing the canvas. Saving only records the current configuration. Whether it immediately affects published or embedded Agents depends on the version publishing mechanism and deployment strategy. Re-run tests before external usage. diff --git a/docs/guides/agent/creation_and_management/search_copy_and_delete_agent.md b/docs/guides/agent/creation_and_management/search_copy_and_delete_agent.md new file mode 100644 index 0000000000..7a0d661e8d --- /dev/null +++ b/docs/guides/agent/creation_and_management/search_copy_and_delete_agent.md @@ -0,0 +1,10 @@ +--- +sidebar_position: 4 +slug: /search_copy_and_delete_agent +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Search, Copy and Delete Agent +In the Agent list, you can search for target Agents by name. If copy, delete or other operation entries are available on the interface, confirm the Agent name and permission scope before operation. Deletion is usually irreversible. Please confirm whether the Agent is referenced by embedded web pages, API calls or other workflows. diff --git a/docs/guides/agent/embed_agent_into_webpage.md b/docs/guides/agent/embed_agent_into_webpage.md deleted file mode 100644 index 4676443e16..0000000000 --- a/docs/guides/agent/embed_agent_into_webpage.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_position: 30 -slug: /embed_agent_into_webpage -sidebar_custom_props: { - categoryIcon: LucideMonitorDot -} ---- -# Embed Agent into webpage - -You can use iframe to embed an agent into a third-party webpage. - -1. Before proceeding, you must [acquire an API key](../models/llm_api_key_setup.md); otherwise, an error message would appear. -2. On the **Agent** page, click an intended agent to access its editing page. -3. Click **Management > Embed into webpage** on the top right corner of the canvas to show the **Embed into webpage** dialog. -4. Configure your embed options: - - **Embed Type**: Choose between Fullscreen Chat (traditional iframe) or Floating Widget (Intercom-style) - - **Theme**: Select Light or Dark theme (for fullscreen mode) - - **Hide avatar**: Toggle avatar visibility - - **Enable Streaming Responses**: Enable streaming for widget mode - - **Locale**: Select the language for the embedded agent -5. Copy the generated iframe code and embed it into your webpage. -6. **Chat in new tab**: Click the "Chat in new tab" button to preview the agent in a separate browser tab with your configured settings. This allows you to test the agent before embedding it. - -![Embed_agent](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/embed_agent_into_webpage.jpg) \ No newline at end of file diff --git a/docs/guides/agent/embed_into_web_pages/_category_.json b/docs/guides/agent/embed_into_web_pages/_category_.json new file mode 100644 index 0000000000..3b45ddd16f --- /dev/null +++ b/docs/guides/agent/embed_into_web_pages/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Embed into Web Pages", + "position": 5, + "link": { + "type": "generated-index", + "description": "Embed into Web Pages" + }, + "customProps": { + "categoryIcon": "RagAiAgent" + } +} diff --git a/docs/guides/agent/embed_into_web_pages/embed_agent_via_webpage.md b/docs/guides/agent/embed_into_web_pages/embed_agent_via_webpage.md new file mode 100644 index 0000000000..63667bf24a --- /dev/null +++ b/docs/guides/agent/embed_into_web_pages/embed_agent_via_webpage.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 1 +slug: /embed_agent_via_webpage +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Embed Agent via Webpage +You can embed the Agent into third-party web pages using iframe. + +Prerequisite: You must obtain an API Key. In Enterprise Edition, only Admin accounts can obtain the API Key. + +Steps: +1. On the Agent page, click the target Agent to open its editing page. +2. Click **Manage > Embed Webpage** in the upper right corner of the canvas to open the iframe window. +3. Copy the iframe code and embed it into your webpage. + +![Embed An Agent Web Page](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/embed_an_agent_web_page.jpg) diff --git a/docs/guides/agent/import_and_export_agents/_category_.json b/docs/guides/agent/import_and_export_agents/_category_.json new file mode 100644 index 0000000000..bbda7e8f06 --- /dev/null +++ b/docs/guides/agent/import_and_export_agents/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Import and Export Agents", + "position": 4, + "link": { + "type": "generated-index", + "description": "Import and Export Agents" + }, + "customProps": { + "categoryIcon": "RagAiAgent" + } +} diff --git a/docs/guides/agent/import_and_export_agents/export_agent.md b/docs/guides/agent/import_and_export_agents/export_agent.md new file mode 100644 index 0000000000..d50ac0d3d0 --- /dev/null +++ b/docs/guides/agent/import_and_export_agents/export_agent.md @@ -0,0 +1,12 @@ +--- +sidebar_position: 2 +slug: /export_agent +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Export Agent +Open an Agent, click **Manage** in the upper right corner, then click export. + +![Export An Agent](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/export_an_agent.jpg) diff --git a/docs/guides/agent/import_and_export_agents/import_agent.md b/docs/guides/agent/import_and_export_agents/import_agent.md new file mode 100644 index 0000000000..f41f99acce --- /dev/null +++ b/docs/guides/agent/import_and_export_agents/import_agent.md @@ -0,0 +1,17 @@ +--- +sidebar_position: 1 +slug: /import_agent +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Import Agent +- First-time import: Upload the JSON file, fill in corresponding information, drag or click to upload the file, then save. +- Non-first-time import: Upload the JSON file, fill in corresponding information, drag or click to upload the file, then save. + +![Import An Agent](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/import_an_agent_1.jpg) + +![Import An Agent](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/import_an_agent_2.jpg) + +![Import An Agent](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/import_an_agent_3.jpg) diff --git a/docs/guides/agent/ingestion_pipeline/_category_.json b/docs/guides/agent/ingestion_pipeline/_category_.json new file mode 100644 index 0000000000..04025a1271 --- /dev/null +++ b/docs/guides/agent/ingestion_pipeline/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Ingestion Pipeline", + "position": 8, + "link": { + "type": "generated-index", + "description": "Configure and use Ingestion Pipeline in RAGFlow Agents." + }, + "customProps": { + "categoryIcon": "RagAiAgent" + } +} diff --git a/docs/guides/agent/ingestion_pipeline/configure_chunker_component.md b/docs/guides/agent/ingestion_pipeline/configure_chunker_component.md new file mode 100644 index 0000000000..399b80687c --- /dev/null +++ b/docs/guides/agent/ingestion_pipeline/configure_chunker_component.md @@ -0,0 +1,29 @@ +--- +sidebar_position: 4 +slug: /configure_chunker_component +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Configure the Chunker Component + +The Chunker component intelligently splits text. Its goal is to prevent overflow of the AI context window and improve semantic accuracy in hybrid search. + +There are two core methods, which can be used sequentially: + +Token-based chunking (default): + +- **Chunk size**: Defaults to 512 tokens, balancing retrieval quality and model compatibility. +- **Overlap**: Set the overlap percentage to copy the end of one chunk to the beginning of the next chunk, improving semantic continuity. +- **Delimiter**: Uses `\n` (line break) by default to split first at natural paragraph boundaries and avoid cutting in the middle of sentences. + +Title-based chunking (hierarchical): + +- Best suited for structured documents such as manuals, papers and legal contracts. +- The system splits documents by chapter and section structure. +- Each chunk represents a complete structural unit. + +:::caution IMPORTANT +In the current design, if both token-based and title-based methods are used, connect the **Token Chunker** component first, and then connect the **Title Chunker** component. Connecting the **Title Chunker** directly to the **Parser** may cause formatting errors for emails, images, spreadsheets and text files. +::: diff --git a/docs/guides/agent/ingestion_pipeline/configure_indexer_component.md b/docs/guides/agent/ingestion_pipeline/configure_indexer_component.md new file mode 100644 index 0000000000..1ab344ee3e --- /dev/null +++ b/docs/guides/agent/ingestion_pipeline/configure_indexer_component.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 6 +slug: /configure_indexer_component +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Configure the Indexer Component + +The **Indexer** component indexes data for optimal retrieval. It is the final step, writing processed data into search engines such as Infinity, Elasticsearch and OpenSearch. + +Key configurations: + +Search method: + +- **Full-text**: Keyword search for exact matches, such as code and names. +- **Embedding**: Semantic search using vector similarity. +- **Hybrid** (recommended): Combines both methods for the best recall. + +Retrieval strategy: + +- **Processed text** (default): Indexes chunked text. +- **Questions**: Indexes generated questions. This usually produces higher similarity matches than text-to-text matching. +- **Enhanced context**: Indexes summaries instead of raw text. Suitable for broad topic matching. + +Filename weight: + +- A slider for including the document filename as semantic information in retrieval. + +Embedding model: + +- Automatically uses the model set when creating the knowledge base. + +:::caution IMPORTANT +To search across multiple knowledge bases at the same time, all selected knowledge bases must use the same embedding model. +::: + +![Configure The Indexer Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/configure_the_indexer_component.jpg) diff --git a/docs/guides/agent/ingestion_pipeline/configure_parser_component.md b/docs/guides/agent/ingestion_pipeline/configure_parser_component.md new file mode 100644 index 0000000000..b9ee6d857f --- /dev/null +++ b/docs/guides/agent/ingestion_pipeline/configure_parser_component.md @@ -0,0 +1,46 @@ +--- +sidebar_position: 3 +slug: /configure_parser_component +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Configure the Parser Component + +The **Parser** component converts your files into structured text while preserving layout, tables, headers and other formatting. + +It supports 8 file categories and more than 23 formats, including PDF, images, audio, video, email, spreadsheets (Excel), Word, PPT, HTML and Markdown. + +Key configurations: + +For PDF files, select one of the following: + +- **DeepDoc** (default): RAGFlow's built-in model. Best suited for scanned documents or complex layouts with tables. +- **MinerU**: Industry-leading for complex elements such as mathematical formulas and complex layouts. +- **Naive**: Simple text extraction. Use it for clean, text-based PDFs without complex elements. + +For image files: + +- OCR is used by default. +- You can also configure a vision language model (VLM) for advanced visual understanding. + +For email files: + +- Select specific fields to parse, such as `subject` and `body`, for precise extraction. + +For spreadsheets: + +- Output in HTML format, preserving row and column structure. + +For Word/PPT: + +- Output in JSON format, preserving document hierarchy, such as headings, paragraphs and slides. + +For text and markup (HTML/MD): + +- Formatting tags are automatically removed and clean text is output. + +![Configure The Parser Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/configure_the_parser_component_1.jpg) + +![Configure The Parser Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/configure_the_parser_component_2.jpg) diff --git a/docs/guides/agent/ingestion_pipeline/configure_transformer_component.md b/docs/guides/agent/ingestion_pipeline/configure_transformer_component.md new file mode 100644 index 0000000000..3a4f81c9a9 --- /dev/null +++ b/docs/guides/agent/ingestion_pipeline/configure_transformer_component.md @@ -0,0 +1,50 @@ +--- +sidebar_position: 5 +slug: /configure_transformer_component +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Configure the Transformer Component + +The **Transformer** component is designed to bridge the "semantic gap". In general, it uses AI models to add semantic metadata, making your content easier to discover during retrieval. + +It has four generation types: + +- **Summary**: Creates a concise overview. +- **Keywords**: Extracts key terms. +- **Questions**: Generates questions that each text chunk can answer. +- **Metadata**: Custom metadata extraction. + +If you have multiple **Transformer** components, make sure to separate the **Transformer** component for each function, for example, one for summaries and another for keywords. + +Key configurations: + +Model mode (select one): + +- **Improvise**: More creative, suitable for question generation. +- **Precise**: Strictly faithful to the text, suitable for summary and keyword extraction. +- **Balanced**: A middle ground suitable for most scenarios. + +Prompt engineering: + +- The system prompt for each generation type is open and customizable. + +Connection: + +- The **Transformer** can be connected after the **Parser** to process the entire document, or after the **Chunker** to process each chunk. + +Variable reference: + +- Nodes do not automatically obtain content. In the user prompt, manually reference upstream variables by typing `/` and selecting a specific output, such as `/{Parser.output}` or `/{Chunker.output}`. + +Chained connection: + +- When chaining **Transformer** components, if variables are referenced correctly, the second **Transformer** component processes the output of the first one, for example, generating keywords from a summary. + +![Configure The Transformer Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/configure_the_transformer_component_1.jpg) + +![Configure The Transformer Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/configure_the_transformer_component_2.jpg) + +![Configure The Transformer Component](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/configure_the_transformer_component_3.jpg) diff --git a/docs/guides/agent/ingestion_pipeline/connect_the_pipeline_to_a_knowledge_base.md b/docs/guides/agent/ingestion_pipeline/connect_the_pipeline_to_a_knowledge_base.md new file mode 100644 index 0000000000..7e5d4407c7 --- /dev/null +++ b/docs/guides/agent/ingestion_pipeline/connect_the_pipeline_to_a_knowledge_base.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 8 +slug: /connect_the_pipeline_to_a_knowledge_base +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Connect the Pipeline to a Knowledge Base + +1. When creating or editing a knowledge base, find the parsing method section. +2. Click **Select pipeline** and choose the pipeline you saved. +3. Any file uploaded to this knowledge base will be processed by your custom Pipeline. + +![Connect The Pipeline To A Knowledge Base](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/connect_the_pipeline_to_a_knowledge_base_1.jpg) + +![Connect The Pipeline To A Knowledge Base](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/connect_the_pipeline_to_a_knowledge_base_2.jpg) + +![Connect The Pipeline To A Knowledge Base](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/connect_the_pipeline_to_a_knowledge_base_3.jpg) diff --git a/docs/guides/agent/ingestion_pipeline/create_ingestion_pipeline.md b/docs/guides/agent/ingestion_pipeline/create_ingestion_pipeline.md new file mode 100644 index 0000000000..ee05caa101 --- /dev/null +++ b/docs/guides/agent/ingestion_pipeline/create_ingestion_pipeline.md @@ -0,0 +1,15 @@ +--- +sidebar_position: 2 +slug: /create_ingestion_pipeline +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Create an Ingestion Pipeline + +1. Go to the **Agent** page. +2. Click **Create Agent** and start from a blank canvas or a prebuilt template. Templates are recommended for beginners. +3. On the canvas, drag, drop and connect components from the right panel to design your flow, for example: Parser -> Chunker -> Transformer -> Indexer. + +![Create An Ingestion Pipeline](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/create_an_ingestion_pipeline.jpg) diff --git a/docs/guides/agent/ingestion_pipeline/test_run.md b/docs/guides/agent/ingestion_pipeline/test_run.md new file mode 100644 index 0000000000..5dfe4937bb --- /dev/null +++ b/docs/guides/agent/ingestion_pipeline/test_run.md @@ -0,0 +1,13 @@ +--- +sidebar_position: 7 +slug: /test_run +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Test Run + +On the pipeline canvas, click **Run** to upload a sample file and view step-by-step results. + +![Test Run](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/test_run.jpg) diff --git a/docs/guides/agent/ingestion_pipeline/understand_core_ingestion_pipeline_components.md b/docs/guides/agent/ingestion_pipeline/understand_core_ingestion_pipeline_components.md new file mode 100644 index 0000000000..f8a63d50eb --- /dev/null +++ b/docs/guides/agent/ingestion_pipeline/understand_core_ingestion_pipeline_components.md @@ -0,0 +1,16 @@ +--- +sidebar_position: 1 +slug: /understand_core_ingestion_pipeline_components +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Understand the Core Ingestion Pipeline Components + +The Ingestion Pipeline is composed of the following core components: + +- **Parser component**: Reads and understands your files, such as PDFs, images, emails and other file types, and extracts text and structure. +- **Transformer component**: Enhances text by using AI to add summaries, keywords or questions, improving search. +- **Chunker component**: Splits long text into optimally sized fragments, or chunks, to improve AI retrieval. +- **Indexer component**: The final step. Sends the processed data to the document engine, supporting hybrid full-text and vector search. diff --git a/docs/guides/agent/understand_the_canvas/_category_.json b/docs/guides/agent/understand_the_canvas/_category_.json new file mode 100644 index 0000000000..9d90eb0c4d --- /dev/null +++ b/docs/guides/agent/understand_the_canvas/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Understand the Canvas", + "position": 6, + "link": { + "type": "generated-index", + "description": "Understand the Canvas" + }, + "customProps": { + "categoryIcon": "RagAiAgent" + } +} diff --git a/docs/guides/agent/understand_the_canvas/add_components.md b/docs/guides/agent/understand_the_canvas/add_components.md new file mode 100644 index 0000000000..6e7443137b --- /dev/null +++ b/docs/guides/agent/understand_the_canvas/add_components.md @@ -0,0 +1,13 @@ +--- +sidebar_position: 1 +slug: /add_components +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Add Components +Click the plus sign next to any component on the canvas to select the next component. Common components include: +`Begin`, `Agent`, `Retrieval`, `Message`, `Await response`, `Switch`, `Iteration`, `Categorize`, `Code`, `Text processing`, `Execute SQL`, `HTTP Request`, and pipeline-related components: `Parser`, `Title chunker`, `Token chunker`, `Transformer`, `Indexer`. + +After adding a component, click the component itself to open the configuration panel on the right. Fields in the configuration panel define input data, processing logic, output variables, and references for subsequent steps. diff --git a/docs/guides/agent/understand_the_canvas/component_connection_rules.md b/docs/guides/agent/understand_the_canvas/component_connection_rules.md new file mode 100644 index 0000000000..69b029c92d --- /dev/null +++ b/docs/guides/agent/understand_the_canvas/component_connection_rules.md @@ -0,0 +1,10 @@ +--- +sidebar_position: 4 +slug: /component_connection_rules +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Component Connection Rules +Connections define component execution order. Sequential components run along a single path. Branch components such as `Switch` and `Categorize` route workflows to different exits according to conditions. `Iteration` executes sub-processes in loops. Components not connected to the execution path will not run. Before deleting a component, check upstream/downstream connections and variable references to avoid missing inputs for subsequent nodes. diff --git a/docs/guides/agent/understand_the_canvas/configuration_panel.md b/docs/guides/agent/understand_the_canvas/configuration_panel.md new file mode 100644 index 0000000000..d5d088732d --- /dev/null +++ b/docs/guides/agent/understand_the_canvas/configuration_panel.md @@ -0,0 +1,10 @@ +--- +sidebar_position: 5 +slug: /configuration_panel +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Configuration Panel +Click any canvas component to open the right-side configuration panel, which displays fields, input variables, output variables and runtime parameters. Recommended workflow: confirm which variable the component reads → configure processing logic → verify downstream nodes reference correct outputs. diff --git a/docs/guides/agent/understand_the_canvas/save_and_run.md b/docs/guides/agent/understand_the_canvas/save_and_run.md new file mode 100644 index 0000000000..54bac0ecc2 --- /dev/null +++ b/docs/guides/agent/understand_the_canvas/save_and_run.md @@ -0,0 +1,12 @@ +--- +sidebar_position: 3 +slug: /save_and_run +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Save & Run +After configuration, click **Save** to save the Agent. During debugging, click **Run** at the top of the canvas, enter test questions and observe the execution result of each component. If a component returns no output, check input variables, model configuration, knowledge base permissions, external interface addresses or tool configuration. + +![Save And Run](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/save_and_run.jpg) diff --git a/docs/guides/agent/understand_the_canvas/use_variables.md b/docs/guides/agent/understand_the_canvas/use_variables.md new file mode 100644 index 0000000000..f96dda7920 --- /dev/null +++ b/docs/guides/agent/understand_the_canvas/use_variables.md @@ -0,0 +1,36 @@ +--- +sidebar_position: 2 +slug: /use_variables +sidebar_custom_props: { + categoryIcon: RagAiAgent +} +--- + +# Use Variables +Components on the Agent canvas support variable references to implement data transmission between components. Variable sources include system variables, global variables defined in the Begin component, and outputs from upstream components. + +In input boxes supporting variable references, type `/` or click the variable button next to the input box to open the variable selector. + +Common variables: +| Variable | Description | +| ---- | ---- | +| `sys.query` | Current user input question | +| `formalized_content` | Sorted text results from Retrieval, SQL or tool components | +| `chunks` | Fragment set output by document parsing or chunking components | +| `content` | Main text output from Agent, Code or other components | + +Operation Steps: +1. Enter the Agent page and open the target canvas for editing. +2. Select a component supporting variable references, e.g. Agent, Retrieval, Message, Code, HTTP Request, SQL. +3. On the right configuration panel, click the input box that needs variable reference, such as System Prompt, User Prompt, Query, etc. +4. Open the variable selector via either method: + - Type `/` inside the input box + - Click the variable icon next to the input box (may display as `{}`, `+` or other icons in different versions) +5. Select required variables in the selector. Available variables include: + - System variables such as `sys.query` + - Global variables defined in the Begin component + - Output variables from upstream components +6. After selection, the variable will be automatically inserted into the input box. +7. Save component configuration and run the Agent to verify data transmission. + +![Use Variables](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/use_variables.jpg) diff --git a/docs/guides/dataset/add_data_source/add_github_repo.md b/docs/guides/dataset/add_data_source/add_github_repo.md index 9dc7383164..1a73107ab1 100644 --- a/docs/guides/dataset/add_data_source/add_github_repo.md +++ b/docs/guides/dataset/add_data_source/add_github_repo.md @@ -51,6 +51,8 @@ Once your GitHub token is ready, register the external data source within your R 4. Click **Save** to confirm your changes. *RAGFlow validates the connection immediately.* +![GitHub](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/github.jpg) + :::tip NOTE Currently deleted or modified files are not synchronized automatically. This feature is coming soon. Thanks to Gisselle-Gonzalez for requesting [this feature](https://github.com/infiniflow/ragflow/issues/13708). ::: diff --git a/docs/guides/dataset/advanced/construct_knowledge_graph.md b/docs/guides/dataset/advanced/construct_knowledge_graph.md index 5b5f219843..825e397196 100644 --- a/docs/guides/dataset/advanced/construct_knowledge_graph.md +++ b/docs/guides/dataset/advanced/construct_knowledge_graph.md @@ -33,7 +33,7 @@ RAPTOR (Recursive Abstractive Processing for Tree Organized Retrieval) can also The system's default chat model is used to generate knowledge graph. Before proceeding, ensure that you have a chat model properly configured: -![Set default models](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_default_models.jpg) +![Set default models](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_default_models.png) ## Configurations diff --git a/docs/guides/dataset/advanced/enable_raptor.md b/docs/guides/dataset/advanced/enable_raptor.md index b312d7c94d..48311e31fd 100644 --- a/docs/guides/dataset/advanced/enable_raptor.md +++ b/docs/guides/dataset/advanced/enable_raptor.md @@ -41,7 +41,7 @@ Knowledge graphs can also be used for multi-hop question-answering tasks. See [C The system's default chat model is used to summarize clustered content. Before proceeding, ensure that you have a chat model properly configured: -![Set default models](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_default_models.jpg) +![Set default models](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_default_models.png) ## Configurations diff --git a/docs/guides/dataset/advanced/extract_table_of_contents.md b/docs/guides/dataset/advanced/extract_table_of_contents.md index 8835d68dd3..0b36738d2a 100644 --- a/docs/guides/dataset/advanced/extract_table_of_contents.md +++ b/docs/guides/dataset/advanced/extract_table_of_contents.md @@ -21,7 +21,7 @@ Enabling PageIndex extraction requires significant memory, computational resourc The system's default chat model is used to summarize clustered content. Before proceeding, ensure that you have a chat model properly configured: -![Set default models](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_default_models.jpg) +![Set default models](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_default_models.png) ## Quickstart diff --git a/docs/guides/dataset/configure_child_chunking_strategy.md b/docs/guides/dataset/configure_child_chunking_strategy.md index 32a61408ee..d153a4c82e 100644 --- a/docs/guides/dataset/configure_child_chunking_strategy.md +++ b/docs/guides/dataset/configure_child_chunking_strategy.md @@ -33,4 +33,4 @@ Through this dual-layer structure of "precise localization + contextual suppleme 3. This configuration applies to the **Chunker** component when it comes to ingestion pipeline settings: -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/child_chunking_parser.png) \ No newline at end of file +![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/child_chunking_chunker.png) \ No newline at end of file diff --git a/docs/guides/dataset/set_metadata.md b/docs/guides/dataset/set_metadata.md index 6931281c2b..49fde4b91c 100644 --- a/docs/guides/dataset/set_metadata.md +++ b/docs/guides/dataset/set_metadata.md @@ -15,7 +15,7 @@ On the **Dataset** page of your dataset, you can add metadata to any uploaded fi For example, if you have a dataset of HTML files and want the LLM to cite the source URL when responding to your query, add a `"url"` parameter to each file's metadata. -![Set metadata](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_metadata.jpg) +![Set metadata](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_metadata.png) :::tip NOTE Ensure that your metadata is in JSON format; otherwise, your updates will not be applied. diff --git a/docs/guides/file/_category_.json b/docs/guides/file/_category_.json new file mode 100644 index 0000000000..5a9d35a9d7 --- /dev/null +++ b/docs/guides/file/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "File Management", + "position": 3.6, + "link": { + "type": "generated-index", + "description": "Guides on creating folders, uploading files, managing file operations, linking knowledge bases, and batch file management in RAGFlow." + }, + "customProps": { + "categoryIcon": "LucideFolderDot" + } +} diff --git a/docs/guides/file/batch_move_and_delete.md b/docs/guides/file/batch_move_and_delete.md new file mode 100644 index 0000000000..e822d66fb5 --- /dev/null +++ b/docs/guides/file/batch_move_and_delete.md @@ -0,0 +1,28 @@ +--- +sidebar_position: 4 +slug: /file_management/batch_move_and_delete +sidebar_label: Batch Move and Delete +sidebar_custom_props: { + categoryIcon: LucideFolderDot +} +--- + +# Batch Move and Delete + +Checkboxes are available on the left side of the file list. After you select at least one operable file, the page displays the batch operation bar and shows the number of selected files. + +## Batch Move + +1. Select one or more files. +2. Click **Move** in the batch operation bar. +3. Select the target folder in the directory tree. +4. Click **Save** to save the move result. + +## Batch Delete + +1. Select one or more files. +2. Click **Delete** in the batch operation bar. +3. Check the number of files to be deleted in the confirmation dialog. +4. After confirming that everything is correct, submit the deletion. + +Some system folders, external data source files, or files from special sources cannot be selected or cannot perform certain batch operations. This is normal behavior caused by permission and source controls. diff --git a/docs/guides/file/file.md b/docs/guides/file/file.md new file mode 100644 index 0000000000..bf2f4d2dfd --- /dev/null +++ b/docs/guides/file/file.md @@ -0,0 +1,45 @@ +--- +sidebar_position: 1 +slug: /file_management/files_and_folders +sidebar_label: Files and Folders +sidebar_custom_props: { + categoryIcon: LucideFolderDot +} +--- + +# Files and Folders + +## Files and Folders + +Folders help organize files by project, business topic, or data source. Regular users only need to focus on folders they created or folders they have permission to access. + +## Create Folder + +RAGFlow file management lets you build your own file system through nested folder structures. To create a folder in the root directory of RAGFlow: + +1. In the target directory, click **Add File**. +2. Select **New Folder**. +3. Enter the folder name in the **Name** input field. The name cannot be empty. It is recommended to use a short name that reflects the business source. +4. Click **Save**. + +## Upload Files or Folders + +After clicking **Add File** in the upper-right corner of the page, select **Upload File** to open the upload window. The upload control contains two tabs: **File** and **Folder**. You can select one or more files, or upload an entire folder. + +### Upload File + +1. Go to the **File** page and confirm that the current directory is the target save location. +2. Click **Add File**, then select **Upload File**. +3. In the **File** tab, click the upload area to select files, or drag files into the upload area. +4. Confirm the list of files to be uploaded. If you selected a file by mistake, click the delete button on the right side of the file row to remove it. +5. Click **Confirm** or **Save**, then wait for the upload progress to complete. + +### Upload Folder + +1. Click **Add File**, then select **Upload File**. +2. Switch to the **Folder** tab. +3. Click the **Upload Folder** area and select a local folder. The system will upload the files inside that folder. +4. After the upload is complete, check the result in the current directory or the corresponding folder. + +The upload process displays progress. If an upload failure message appears, check the file size, network connection, login status, and whether the file format is allowed by the current deployment. + diff --git a/docs/guides/file/file_operations.md b/docs/guides/file/file_operations.md new file mode 100644 index 0000000000..30a9745295 --- /dev/null +++ b/docs/guides/file/file_operations.md @@ -0,0 +1,27 @@ +--- +sidebar_position: 2 +slug: /file_management/file_operations +sidebar_label: File Operations +sidebar_custom_props: { + categoryIcon: LucideFolderDot +} +--- + +# File Operations + +After you hover over a file row, the **Operations** column displays the available operation buttons. The available operations for folders and regular files are slightly different. For files from external data sources, some operations, such as moving, renaming, or deleting, may be restricted by the data source permissions. + +**Add to Knowledge Base**: Applies to files. Associates the file with one or more knowledge bases, allowing the knowledge base to use the file as a data source. + +**Move**: Applies to files or folders. After selecting a target folder and saving, the system moves the selected item to the target directory. + +**Rename**: Applies to files or folders. When renaming, it is recommended to retain information that identifies the file format and source to avoid name confusion within the same directory. + +**Download**: Applies to files. Downloads the original file. Folder rows usually do not provide a download button. + +**Preview or View**: Applies to previewable files. Some document types display a view entry, allowing you to open or preview the file content within the page. + +**Delete**: Applies to files or folders. A confirmation dialog appears before deletion. After confirmation, the file is removed from the current directory. + +Deleting files or folders may affect knowledge base data sources that are already associated with them. Before deleting, confirm that the file is no longer used by business workflows, knowledge base parsing, or agent retrieval. + diff --git a/docs/guides/file/link_knowledge_base.md b/docs/guides/file/link_knowledge_base.md new file mode 100644 index 0000000000..2c7e025dbf --- /dev/null +++ b/docs/guides/file/link_knowledge_base.md @@ -0,0 +1,28 @@ +--- +sidebar_position: 3 +slug: /file_management/link_knowledge_base +sidebar_label: Link Knowledge Base +sidebar_custom_props: { + categoryIcon: LucideFolderDot +} +--- + +# Link Knowledge Base + +The file management page allows you to add files directly to a knowledge base. After the association is created, you can continue operations such as parsing, chunking, and retrieval from the knowledge base side. The specific processing status is subject to the knowledge base document page. + +## Link a Single File + +1. Find the target file in the file list. +2. Hover over the row, then click the **Add to Knowledge Base** icon in the **Operations** column. +3. In the pop-up window, select one or more knowledge bases. +4. Click **Save** to save the association. + +## Batch Link + +1. Select multiple files that need to be linked. +2. In the batch operation bar, click **Add to Knowledge Base**. +3. Select the target knowledge base and save. + +A single-file operation replaces the knowledge base associations of that file with the current selection. A batch operation adds the selected files to the target knowledge base. If the same file serves multiple knowledge bases, confirm the target knowledge base name before saving. + diff --git a/docs/guides/memory/_category_.json b/docs/guides/memory/_category_.json index d3b1e49e56..d753b464b6 100644 --- a/docs/guides/memory/_category_.json +++ b/docs/guides/memory/_category_.json @@ -3,7 +3,7 @@ "position": 3.5, "link": { "type": "generated-index", - "description": "Guides on using Memory." + "description": "Guides on creating, configuring, and using Memory with Agents." }, "customProps": { "categoryIcon": "LucideBox" diff --git a/docs/guides/memory/configure_memory.md b/docs/guides/memory/configure_memory.md new file mode 100644 index 0000000000..76268293b8 --- /dev/null +++ b/docs/guides/memory/configure_memory.md @@ -0,0 +1,43 @@ +--- +sidebar_position: 3 +slug: /configure_memory +sidebar_custom_props: { + categoryIcon: LucideBox +} +--- + +## Configure Memory + +The configuration page is used to maintain a memory's basic information, model configuration, capacity configuration, and advanced settings. After making changes, click **Confirm** to save them, or click **Cancel** to discard unsaved content. + +On the memory page, click the target memory **> Configurations** to view and update its settings. + +### Basic Information + +The name, avatar, and description are mainly used to distinguish memories. Fill them in according to the page prompts. The avatar image must not exceed 4 MB. + +The embedding model and large language model are the basic configuration for memory extraction and retrieval. The embedding model is used to convert memory content into vectors and supports subsequent similarity retrieval. The large language model is used to analyze conversation content and extract structured memories. After messages have already been written to a memory, frequent model changes are not recommended. + +### Memory Type + +Multiple memory types can be selected, but **Raw (`raw`)** is required and cannot be removed. When multiple types are selected, the system saves or extracts memories at different levels according to the selected types. + +- **Raw (`raw`)**: Saves the original conversation content between the user and the Agent. It is suitable for scenarios where the complete context needs to be traced, and it is also the basis for extracting other types of memory. +- **Semantic (`semantic`)**: Extracts relatively stable facts, preferences, attributes, or background information, such as user preferences, customer profiles, and common requirements. It is suitable for long-term reuse. +- **Episodic (`episodic`)**: Extracts experience records with time, conversation, or event context, such as a communication, a task execution result, or a staged event. It is suitable for tracing historical processes. +- **Procedural (`procedural`)**: Extracts processes, steps, operating habits, or handling rules, such as fixed workflows and common handling methods. It is suitable for allowing Agents to reuse approaches in subsequent tasks. + +### Memory Size + +Memory size is used to limit the capacity that the memory can occupy. The value range is `(0, 5242880]` bytes. After the capacity reaches the upper limit, the system cleans up old content according to the forgetting policy. + +### Advanced Settings + +Advanced settings are used to control the memory's visibility scope, storage method, and extraction effect. If there are no special requirements, you can keep the default configuration. + +- **Permissions**: Select **Only me (`me`)** or **Team (`team`)**. **Only me** means that only the current user can see the memory. **Team** means that team members can see and use the memory. +- **Storage type**: Currently, **Table (`table`)** can be selected. It is suitable for general messages, field queries, and regular retrieval. +- **Forgetting policy**: Currently, **First in, first out (FIFO)** can be selected. When the capacity reaches the upper limit, the system preferentially cleans up content written earlier. +- **Temperature**: The value range is `0-1`. It is used to control the randomness of memory extraction. A lower value makes the extraction result more stable, while a higher value makes the expression more divergent. +- **System prompt**: Used to define the role, output format, and structure constraints for memory extraction. Adjust it only when you need to unify the extraction format or strengthen extraction rules. +- **User prompt**: Used to supplement user-side extraction requirements. If there are no special requirements, it can be left empty. diff --git a/docs/guides/memory/connect_to_an_agent.md b/docs/guides/memory/connect_to_an_agent.md new file mode 100644 index 0000000000..c6ef2ce124 --- /dev/null +++ b/docs/guides/memory/connect_to_an_agent.md @@ -0,0 +1,28 @@ +--- +sidebar_position: 4 +slug: /connect_to_an_agent +sidebar_custom_props: { + categoryIcon: LucideBox +} +--- + +## Connect to an Agent + +A memory must be connected to an Agent before historical messages can be written during Agent execution or historical context can be retrieved when answering. Usually, both directions, **write to memory** and **retrieve from memory**, need to be configured. + +### Write Agent Messages to Memory + +1. Go to the **Agent** page and open the Agent that needs to be configured. +2. Select or add the **Message** component on the Agent canvas. +3. In the **Message** component configuration, find **Save to Memory**. +4. Select the target memory. If historical records need to be distinguished by user, configure the user ID. +5. Save the Agent and run a test. After it runs, return to the memory's **Messages** page to check whether new messages have been generated. + +### Let an Agent Retrieve from Memory + +1. Select or add the **Retrieval** component on the Agent canvas. +2. In **Query variable**, select the query source. `sys.query` is commonly used. +3. In **Retrieval source**, select **Memory**, and select one or more target memories. +4. Adjust **Similarity threshold**, **Vector similarity weight**, and **Top N** as needed. +5. Connect the retrieval result to a subsequent large language model or answer component, so that the Agent can use the retrieved historical context. +6. Save and run a test, and check whether the answer correctly references historical memories. diff --git a/docs/guides/memory/create_memory.md b/docs/guides/memory/create_memory.md new file mode 100644 index 0000000000..b0fd8d9eb1 --- /dev/null +++ b/docs/guides/memory/create_memory.md @@ -0,0 +1,20 @@ +--- +sidebar_position: 1 +slug: /use_memory +sidebar_label: Create Memory +sidebar_custom_props: { + categoryIcon: LucideBox +} +--- + +# Memory + +This chapter describes how to create and configure memories in RAGFlow, view and manage messages, and save and retrieve memories in Agents. Memories are used to save conversation content and extraction results generated during Agent execution, helping Agents reuse historical context in subsequent conversations or tasks. + +## Create Memory + +1. Go to the **Memory** page. +2. Click **Create memory**. +3. Enter the memory name. +4. Select the memory type, embedding model, and large language model. +5. After confirmation, enter the memory list or details page. diff --git a/docs/guides/memory/message_page.md b/docs/guides/memory/message_page.md new file mode 100644 index 0000000000..be763dcc13 --- /dev/null +++ b/docs/guides/memory/message_page.md @@ -0,0 +1,29 @@ +--- +sidebar_position: 2 +slug: /message_page +sidebar_custom_props: { + categoryIcon: LucideBox +} +--- + +## Message Page + +The message page is used to view messages written to memory and control whether messages participate in subsequent retrieval. The left side provides **Messages** and **Configurations** entries, and the right side displays the message list, search, and filters. + +Memory extraction uses the prompts and temperature in **Advanced Settings** on the configuration page. If the extraction result does not meet expectations, check these configurations first. + +Users can search messages in the current memory's message list, or narrow the search scope through conditional filters. + +The message list displays information such as sessions, source Agents, message types, valid time, forgotten status, and enabled status, and provides corresponding operation entries. + +### Message Fields + +| Field | Description | +| --- | --- | +| Session ID | The session that the message belongs to. Multiple messages generated in the same session usually have the same session ID. | +| Agent | The name of the Agent that wrote the message, such as `customer` or `deep search`. | +| Type | The message type or extracted memory type. In the current example, this is displayed as **Raw**. | +| Valid date | The valid time of this memory, that is, the effective time. | +| Forgotten at | The time when this message was forgotten. If it has not been forgotten, this is usually displayed as **None** or left empty. | +| Enabled | Controls whether this message participates in subsequent retrieval. After it is disabled, the message is still retained, but it no longer affects Agent retrieval results. | +| Operation | Used to view, copy, view logs, or forget messages. The specific buttons depend on the current permissions and message status. | diff --git a/docs/guides/memory/use_memory.md b/docs/guides/memory/use_memory.md deleted file mode 100644 index 492bfbdff6..0000000000 --- a/docs/guides/memory/use_memory.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -sidebar_position: 1 -slug: /use_memory -sidebar_custom_props: { - categoryIcon: LucideMonitorCog -} ---- - -# Use memory - -RAGFlow's Memory module is built to save everything, including conversation that happens while an Agent is working. It keeps the raw logs of conversations, like what a user says and what the AI says back. It also saves extra information created during the chat, like summaries or notes the AI makes about the interaction. Its main jobs are to make conversations flow smoothly from one to the next, to allow the AI to remember personal details about a user, and to let the AI learn from all its past talks. - -This module does more than just store the raw data. It is smart enough to sort information into different useful types. It can pull out key facts and meanings (semantic memory), remember specific events and stories from past chats (episodic memory), and hold details needed for the current task (working memory). This turns a simple log into an organized library of past experiences. - -Because of this, users can easily bring back any saved information into a new conversation. This past context helps the AI stay on topic and avoid repeating itself, making chats feel more connected and natural. More importantly, it gives the AI a reliable history to think from, which makes its answers more accurate and useful. - -## Create memory - -The Memory module offers streamlined, centralized management of all memories. - -When creating a Memory, users can precisely define which types of information to extract, helping ensure that only relevant data is captured and organized. From the navigation path Overview >> Memory, users can then perform key management actions, including renaming memories, organizing them, and sharing them with team members to support collaborative workflows. - - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/memory_interface.PNG) - -## Configure memory - -On the **Memory** page, click the intended memory **>** **Configuration** to view and update its settings. - -### Name - -The unique name of the memory created. - -### Embedding model - -The embedding model for converting the memory into embeddings. - -### LLM - -The chat model for extracting knowledge from the memory. - -### Memory type - -What is stored in the memory: - -`Raw`: The raw dialogue between the user and the Agent (Required by default). -`Semantic Memory`: General knowledge and facts about the user and world. -`Episodic Memory`: Time-stamped records of specific events and experiences. -`Procedural Memory`: Learned skills, habits, and automated procedures. - -### Memory size - -The default capacity allocated to the memory and the corresponding embeddings in bytes. Defaults to `5242880` (5MB). - -:::tip NOTE -A 1KB message with a 1024-dimension embedding occupies approximately 9KB of memory (1KB + 1024 x 8Bytes = 9KB). With a default limit of 5 MB, the system can store roughly 500 such messages. -::: - -### Permission - -- **Only me**: Exclusive to the user. -- **Team**: Share this memory with the team members. - - -## Manage memory - -Within an individual Memory page, you can fine-tune how saved entries are used during Agent calls. Each entry can be selectively enabled or disabled, allowing you to control which pieces of information remain active without permanently removing anything. - -When certain details are no longer relevant, you can also choose to forget specific memory entries entirely. This keeps the Memory clean, focused, and easier to maintain over time, ensuring that Agents rely only on up‑to‑date and useful information. - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/memory_interface.PNG) - -Manually forgotten memory entries are completely excluded from the results returned by Agent calls, ensuring they no longer influence downstream behavior. This helps keep responses focused on the most relevant and intentionally retained information. - -When the Memory reaches its storage limit and the automatic forgetting policy is applied, entries that were previously forgotten manually are also prioritized for removal. This allows the system to reclaim capacity more intelligently while respecting earlier user curation decisions. - -## Enhance Agent context - -Under [Retrieval](../agent/agent_component_reference/retrieval.mdx) and [Message](../agent/agent_component_reference/message.md) component settings, a new Memory invocation capability is available. In the Message component, users can configure the Agent to write selected data into a designated Memory, while the Retrieval component can be set to read from that same Memory to answer future queries. This enables a simple Q&A bot Agent to accumulate context over time and respond with richer, memory-aware answers. - -### Retrieve from memory - -For any Agent configuration that uses Memory, a **Retrieval** component is required to bring stored information back into the conversation. By including Retrieval alongside Memory-aware components, the Agent can consistently recall and apply relevant past data whenever it is needed. - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/retrieve_from_memory.PNG) - -### Save to memory - -At the same time you have finished **Retrieval** component settings, select the corresponding Memory in the **Message** component under **Save to Memory**: - - -![](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/save_to_memory.png) - - -## Frequently asked questions - -### Can I share my memory? - -Yes, you can. Your memory can be shared between Agents. See these topics: - -- [Create memory](#create-memory) -- [Enhance Agent context](#enhance-agent-context) - -If you wish to share your memory with your team members, please ensure you have configured its team permissions. See [Share memory](../team/share_memory.md) for details. - - - - diff --git a/docs/guides/models/llm_api_key_setup.md b/docs/guides/models/llm_api_key_setup.md index 704d31e395..7b5cbce068 100644 --- a/docs/guides/models/llm_api_key_setup.md +++ b/docs/guides/models/llm_api_key_setup.md @@ -7,44 +7,116 @@ sidebar_custom_props: { --- # Configure model API key -An API key is required for RAGFlow to interact with an online AI model. This guide provides information about setting your model API key in RAGFlow. +RAGFlow model provider management allows you to connect online models, local models, and OpenAI-compatible models to RAGFlow for use in knowledge bases, chats, search, and agents. ## Get model API key -RAGFlow supports most mainstream LLMs. Please refer to [Supported Models](../../guides/models/supported_models.mdx) for a complete list of supported models. You will need to apply for your model API key online. Note that most LLM providers grant newly-created accounts trial credit, which will expire in a couple of months, or a promotional amount of free quota. +RAGFlow supports most mainstream LLMs. Please refer to [Supported Models](../../guides/models/supported_models.mdx) for a complete list of supported models. You will need to apply for your model API key online. :::note If you find your online LLM is not on the list, don't feel disheartened. The list is expanding, and you can [file a feature request](https://github.com/infiniflow/ragflow/issues/new?assignees=&labels=feature+request&projects=&template=feature_request.yml&title=%5BFeature+Request%5D%3A+) with us! Alternatively, if you have customized or locally-deployed models, you can [bind them to RAGFlow using Ollama, Xinference, or LocalAI](./deploy_local_llm.mdx). ::: -## Configure model API key +## Add a model provider instance -You have two options for configuring your model API key: +### Select a model provider -- Configure it in **service_conf.yaml.template** before starting RAGFlow. -- Configure it on the **Model providers** page after logging into RAGFlow. +Go to **User settings** **>** **Model providers**. In **Available models**, select a provider and complete its configuration. After the configuration succeeds, the provider is marked as **Configured**. -### Configure model API key before starting up RAGFlow +![Select model provider](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/select_model_provider.png) -1. Navigate to **./docker/ragflow**. -2. Find entry **user_default_llm**: - - Update `factory` with your chosen LLM. - - Update `api_key` with yours. - - Update `base_url` if you use a proxy to connect to the remote service. -3. Reboot your system for your changes to take effect. -4. Log into RAGFlow. - _After logging into RAGFlow, you will find your chosen model appears under **Added models** on the **Model providers** page._ +### Create a model provider instance and configure connection information -### Configure model API key after logging into RAGFlow +An instance stores a set of connection settings under a provider. You can create separate instances for test environments, production environments, local models, or proxy gateways to avoid mixing configurations for different purposes. +When you configure a provider for the first time, the right pane prompts you to create an instance first. After the instance is saved, you can continue to fill in **API Key** and **Base URL** and add models. -:::caution WARNING -After logging into RAGFlow, configuring your model API key through the **service_conf.yaml.template** file will no longer take effect. +**API Key** is used for authentication. **Base URL** specifies the model service endpoint. + +For official providers, keep the default **Base URL** in most cases. For proxies, gateways, local models, or compatible APIs, enter the actual service address. + +To configure a model provider: + +1. Select the provider you want to configure. +2. Enter an instance name. +3. Enter **API Key** and **Base URL**. +4. Save the instance. + +![Create instance](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/create_instance.png) + +:::caution +Do not expose your API Key. An incorrect Base URL causes connection verification or model calls to fail. When using a compatible API, confirm whether the path must include `/v1`. ::: -After logging into RAGFlow, you can *only* configure API Key on the **Model providers** page: +### Verify the connection -1. Click on your logo on the top right of the page **>** **Model providers**. -2. Find your model card under **Models to be added** and click **Add the model**. -3. Paste your model API key. -4. Fill in your base URL if you use a proxy to connect to the remote service. -5. Click **OK** to confirm your changes. \ No newline at end of file +After filling in **API Key** and **Base URL**, verify the connection first. If verification fails, check the API Key, Base URL, network connection, account quota, and model availability. + +![Verify connection](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/verify_connection.png) + +## Add models to an instance + +After you add a model provider instance and the connection verification succeeds, you can add and configure models for this instance. Add the model types required by your business, such as large language models (LLMs), embedding models, vision-language models (VLMs), automatic speech recognition models (ASR), rerank models, and text-to-speech models (TTS). + +After adding models, you can set them as the default models for the corresponding model types. + +### Add models from the list + +After the model instance connection succeeds, RAGFlow automatically displays some models supported by the model provider. You can search for the models you need and add them one by one, or add the models in the current list in batch. + +![Add models from list](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/add_models_from_list.png) + +### Add a custom model + +If the required model is not shown in the list but is actually supported by the model provider, you can add it manually as a custom model. When adding a custom model, fill in the model name and select the model type. + +The model name must match the model ID exposed by the model provider API. Otherwise, RAGFlow may not be able to identify the model correctly during calls. + +To add a custom model: + +1. Go to the configured provider instance and click **Add custom model**. +2. Enter the model name. The name must match the actual model identifier provided by the provider. +3. Select the corresponding model type. +4. Fill in **Max tokens** according to the model capability. This value sets the maximum number of tokens the model can generate in one call. +5. If the model supports tool calling, enable **Tool call**. After it is enabled, the model can call external tools or functions during chats or agent runs, such as knowledge retrieval or API requests. Do not enable it for models that do not support this capability. +6. Click **Confirm** to save the model, and verify whether the model is available through an actual call. + + +![Add custom model1](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/add_custom_model_1.png) + +![Add custom model2](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/add_custom_model_2.png) +## Set default models + +Default models are used when RAGFlow needs to select a model automatically and no model has been specified separately. Set default models after adding and verifying models to avoid selecting unavailable models on business pages. + +At minimum, set the following defaults: + +1. Default LLM. +2. Default embedding model. + +If you have configured a rerank model, it is also recommended to set a default rerank model. Configure VLM, ASR, TTS, and OCR defaults as required by your business. + +![Set default models](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_default_models.png) + +## Model types and usage + +| Model type | Full name | Main function | Input | Output | Typical scenarios | +| --- | --- | --- | --- | --- | --- | +| LLM | Large Language Model | Understands, reasons over, and generates text | Text prompts | Text | Intelligent question answering, content generation, summarization, and information extraction | +| Embedding | Embedding model | Converts text into vector representations | Text | Vectors | Semantic retrieval, similarity calculation, and knowledge base indexing | +| Rerank | Rerank model | Scores and reorders initially retrieved candidate results by relevance | Query text and candidate text | Relevance scores and ranking results | Optimizing retrieval results and improving knowledge base Q&A accuracy | +| VLM | Vision-Language Model | Understands images and the text, objects, and scene information in them | Images, text, or images with text | Text | Image Q&A, chart understanding, and visual content analysis | +| ASR | Automatic Speech Recognition model | Converts speech into text | Audio | Text | Speech transcription, meeting records, and real-time captions | +| TTS | Text-to-Speech model | Converts text into speech | Text | Audio | Voice playback, audio content, and voice interaction | +| OCR | Optical Character Recognition model | Recognizes text in images or scanned documents | Images or scanned documents | Recognized text | Scanned document recognition and receipt recognition | + +The following model types usually work together for retrieval and generation: + +1. **Embedding**, **Rerank**, and **LLM**: The embedding model converts queries and knowledge chunks into vectors, and the system recalls candidate chunks based on vector similarity. The rerank model scores and reorders the candidate chunks by relevance. The LLM understands the question based on the selected knowledge content and generates the answer. + +2. **VLM**, **ASR**, **TTS**, and **OCR**: VLM is used to understand images and image-text information. OCR recognizes text in images or scanned documents. ASR converts speech into text. TTS converts text into speech. Different model types jointly support multimodal scenarios such as image understanding, document recognition, and voice interaction. + +3. **Moderation**: The moderation model is used to identify non-compliant, harmful, or sensitive content in text or images. It can review user input and model output to reduce the risk of generating or spreading non-compliant content. + +## Supported model list + +See [Supported Models](./supported_models.mdx). \ No newline at end of file diff --git a/docs/guides/team/join_or_leave_team.md b/docs/guides/team/join_or_leave_team.md deleted file mode 100644 index dfc80ed5a1..0000000000 --- a/docs/guides/team/join_or_leave_team.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -sidebar_position: 3 -slug: /join_or_leave_team -sidebar_custom_props: { - categoryIcon: LucideLogOut -} ---- -# Join or leave a team - -Accept an invitation to join a team, decline an invitation, or leave a team. - ---- - -Once you join a team, you can do the following: - -- Upload documents to the team owner's shared datasets. -- Parse documents in the team owner's shared datasets. -- Use the team owner's shared Agents. - -:::tip NOTE -You cannot invite users to a team unless you are its owner. -::: - -## Prerequisites - -1. Ensure that your Email address that received the team invitation is associated with a RAGFlow user account. -2. The team owner should share his datasets by setting their **Permission** to **Team**. - -## Accept or decline team invite - -1. You will be notified on the top right corner of your system page when you receive an invitation to join a team. - -2. Click on your avatar in the top right corner of the page, then select **Team** in the left-hand panel to access the **Team** page. - -_On the **Team** page, you can view the information about members of your team and the teams you have joined._ - -_After accepting the team invite, you should be able to view and update the team owner's datasets whose **Permissions** is set to **Team**._ - -## Leave a joined team \ No newline at end of file diff --git a/docs/guides/team/manage_team_members.md b/docs/guides/team/manage_team_members.md deleted file mode 100644 index 6df7589910..0000000000 --- a/docs/guides/team/manage_team_members.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -sidebar_position: 2 -slug: /manage_team_members -sidebar_custom_props: { - categoryIcon: LucideUserCog -} ---- -# Manage team members - -Invite or remove team members. - ---- - -By default, each RAGFlow user is assigned a single team named after their name. RAGFlow allows you to invite RAGFlow users to your team. Your team members can help you: - -- Upload documents to your shared datasets. -- Parse documents in your shared datasets. -- Use your shared Agents. - -:::tip NOTE -- Your team members are currently *not* allowed to invite users to your team, and only you, the team owner, is permitted to do so. -- Sharing added models with team members is only available in RAGFlow's Enterprise edition. -::: - -## Prerequisites - -1. Ensure that the invited team member is a RAGFlow user and that the Email address used is associated with a RAGFlow user account. -2. To allow your team members to view and update your dataset, ensure that you set **Permissions** on its **Configuration** page from **Only me** to **Team**. - -## Invite team members - -Click on your avatar in the top right corner of the page, then select **Team** in the left-hand panel to access the **Team** page. - -![team_view](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/team_view.jpg) - -_On the **Team** page, you can view the information about members of your team and the teams you have joined._ - -You are, by default, the owner of your own team and the only person permitted to invite users to join your team or remove team members. - -![invite_user](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/invite_user.jpg) - -## Remove team members - -![delete_invite](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/delete_invite.jpg) \ No newline at end of file diff --git a/docs/guides/team/permission_system_overview/_category_.json b/docs/guides/team/permission_system_overview/_category_.json new file mode 100644 index 0000000000..018811fa4c --- /dev/null +++ b/docs/guides/team/permission_system_overview/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Permission system overview", + "position": 1, + "link": { + "type": "generated-index", + "description": "Permission system overview." + }, + "customProps": { + "categoryIcon": "LucideUserCog" + } +} diff --git a/docs/guides/team/permission_system_overview/index.md b/docs/guides/team/permission_system_overview/index.md new file mode 100644 index 0000000000..3b6fb384a3 --- /dev/null +++ b/docs/guides/team/permission_system_overview/index.md @@ -0,0 +1,13 @@ +--- +sidebar_position: 1 +slug: /permission_system_overview +sidebar_custom_props: { + categoryIcon: LucideUserCog +} +sidebar_label: Overview +--- +# Permission system overview + +RAGFlow manages team collaboration and resource permissions through three layers: team membership, resource sharing scope, and resource operation permissions. + +The **Team and Permissions** section describes how users enter the team page, view members in the current workspace, invite or remove members, accept or decline invitations, leave joined teams, and configure visible scopes for shared resources such as knowledge bases, Agents, chats, Search applications, and memories. diff --git a/docs/guides/team/permission_system_overview/permission_effective_rules.md b/docs/guides/team/permission_system_overview/permission_effective_rules.md new file mode 100644 index 0000000000..e03dcac6fc --- /dev/null +++ b/docs/guides/team/permission_system_overview/permission_effective_rules.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 5 +sidebar_label: "Permission effective rules" +--- + +## Permission effective rules + +When a user performs an operation on a resource, RAGFlow evaluates permissions in the following order: + +1. Whether the user has formally joined the team that owns the resource. +2. Whether the resource sharing scope allows team access. +3. Whether the user has knowledge base-level, resource-level, or collaborator-level **Read**, **Write**, or **Manage** permission. +4. Whether the target document has additional document-level **Read**, **Write**, or **Manage** permission requirements. +5. Whether the current operation is allowed by the permission table for that resource type. + +The resource owner always has all permissions. If a resource is set to **Only me**, only the owner can access it. If a resource is set to **Team**, only team members who meet the permission conditions can access it. In RAGFlow Enterprise, the system also checks collaborator configuration for members, departments, and groups. + +If finer-grained permissions exist, such as document-level permissions in a knowledge base, those permissions continue to apply on top of resource access permission. diff --git a/docs/guides/team/permission_system_overview/resource_operation_permissions.md b/docs/guides/team/permission_system_overview/resource_operation_permissions.md new file mode 100644 index 0000000000..850f1a500f --- /dev/null +++ b/docs/guides/team/permission_system_overview/resource_operation_permissions.md @@ -0,0 +1,20 @@ +--- +sidebar_position: 4 +sidebar_label: "Resource operation permissions" +--- + +## Resource operation permissions + +Resource operation permissions define what a user can do after the resource becomes visible to the user. + +Operation permissions can apply to the following resource types: + +- Knowledge bases and knowledge base documents. +- Chat applications. +- Agents. +- MCP servers. +- Memories and memory messages. +- Search applications. +- Model providers, model instances, and default model configuration. + +Different resources use different permission levels. Common permission levels include **Read permission**, **Write permission**, and **Manage permission**. The resource owner always has the highest permission on the resource. diff --git a/docs/guides/team/permission_system_overview/resource_sharing_scope.md b/docs/guides/team/permission_system_overview/resource_sharing_scope.md new file mode 100644 index 0000000000..470b61d82a --- /dev/null +++ b/docs/guides/team/permission_system_overview/resource_sharing_scope.md @@ -0,0 +1,12 @@ +--- +sidebar_position: 3 +sidebar_label: "Resource sharing scope" +--- + +## Resource sharing scope + +Sharing scope controls the visible scope of a resource, that is, which users can access the current resource. + +In the open-source edition, supported resources can usually be set to **Only me** or **Team**. In RAGFlow Enterprise, resources can be authorized more finely by adding collaborators such as members, departments, or groups. + +A resource set to **Team** is not necessarily visible to every user in every case. The system still checks whether the user belongs to the resource owner's team, whether the resource supports team sharing, and whether the user's operation is allowed by the corresponding permission rules. diff --git a/docs/guides/team/permission_system_overview/team_and_resource_permissions.md b/docs/guides/team/permission_system_overview/team_and_resource_permissions.md new file mode 100644 index 0000000000..83105ec901 --- /dev/null +++ b/docs/guides/team/permission_system_overview/team_and_resource_permissions.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 2 +sidebar_label: "Team and resource permissions" +--- + +## Team and resource permissions + +Team membership and resource permissions are separate concepts. + +A user may be a member of a team, but that does not mean the user can access every resource in the team. A resource must also be shared with the team or explicitly authorized to the user through collaborator permissions. + +For common resource sharing scopes: + +| Sharing scope | Description | +| --- | --- | +| Only me / me | Only the owner can access the resource. | +| Team / team | Users who have joined the team may access the resource if the resource-level permission rules allow it. | + +When a team owner invites a user, the relationship is first created with the `invite` role. After the invited user accepts the invitation, the role changes to `normal`. diff --git a/docs/guides/team/permission_system_overview/team_member_management.md b/docs/guides/team/permission_system_overview/team_member_management.md new file mode 100644 index 0000000000..2747f61a1f --- /dev/null +++ b/docs/guides/team/permission_system_overview/team_member_management.md @@ -0,0 +1,24 @@ +--- +sidebar_position: 1 +sidebar_label: "Team member management" +--- + +## Team member management + +Each user has a personal workspace. The team page of that workspace is displayed with the current user's nickname and **workspace** as its title. + +The team page contains two main areas: + +- **Team members**: Members in the current workspace. +- **Joined teams**: Other workspaces that the current user has joined or has been invited to join. + +RAGFlow uses the `user_tenant` relationship to record team membership. Common role values include: + +| Role | Description | +| --- | --- | +| owner | The owner of the workspace. The owner can invite members and remove members. | +| normal | A user who has accepted an invitation and joined the workspace. | +| invite | A user who has been invited but has not accepted the invitation. | +| admin | A backend role value used by the system. | + +The team role is different from the Enterprise role management feature. Team roles define whether a user belongs to a workspace and what team-level actions the user can perform. Enterprise roles define action permissions for administrative resources. diff --git a/docs/guides/team/resource_operation_permission_rules/_category_.json b/docs/guides/team/resource_operation_permission_rules/_category_.json new file mode 100644 index 0000000000..a84059c1ca --- /dev/null +++ b/docs/guides/team/resource_operation_permission_rules/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Resource operation permission rules", + "position": 4, + "link": { + "type": "generated-index", + "description": "Resource operation permission rules." + }, + "customProps": { + "categoryIcon": "LucideKeyRound" + } +} diff --git a/docs/guides/team/resource_operation_permission_rules/agent_permissions.md b/docs/guides/team/resource_operation_permission_rules/agent_permissions.md new file mode 100644 index 0000000000..d6b853c06e --- /dev/null +++ b/docs/guides/team/resource_operation_permission_rules/agent_permissions.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 3 +sidebar_label: "Agent permissions" +--- + +## Agent permissions + +Agent settings include a sharing scope such as **Only me** or **Team**. Agent operation permissions determine whether the user can view, debug, run, update, or delete an Agent. + +| Operation | No permission | Read | Write | Manage | Owner | +| --- | --- | --- | --- | --- | --- | +| Create Agent | Y | Y | Y | Y | Y | +| List visible Agents and return `operator_permission` | X | Y | Y | Y | Y | +| Get user-visible Agents and tags | X | Y | Y | Y | Y | +| View Agent details | X | Y | Y | Y | Y | +| Access session list | X | Y | Y | Y | Y | +| View a single session | X | Y | Y | Y | Y | +| View component form configuration | X | Y | Y | Y | Y | +| View version list | X | Y | Y | Y | Y | +| Read a single version | X | Y | Y | Y | Y | +| View `webhooktrace` | X | Y | Y | Y | Y | +| View component connection configuration file | X | Y | Y | Y | Y | +| Download Agent-related files | X | Y | Y | Y | Y | +| Get prompts | X | Y | Y | Y | Y | +| Create session | X | X | Y | Y | Y | +| Create a single session | X | X | Y | Y | Y | +| Batch delete sessions | X | X | Y | Y | Y | +| Upload Agent | X | X | Y | Y | Y | +| Component debugging | X | X | Y | Y | Y | +| Test database connection | X | X | Y | Y | Y | +| Read running logs | X | X | Y | Y | Y | +| Chat conversation entry | X | X | Y | Y | Y | +| Chat running entry | X | X | Y | Y | Y | +| Update Agent or DSL | X | X | Y | Y | Y | +| Update canvas tags | X | X | X | Y | Y | +| Delete Agent | X | X | X | X | Y | +| Dataflow or pipeline rerun | - | - | - | - | - | +| Webhook running entry | N/A | N/A | N/A | N/A | N/A | +| Webhook test entry | N/A | N/A | N/A | N/A | N/A | diff --git a/docs/guides/team/resource_operation_permission_rules/chat_application_permissions.md b/docs/guides/team/resource_operation_permission_rules/chat_application_permissions.md new file mode 100644 index 0000000000..76a1f58a92 --- /dev/null +++ b/docs/guides/team/resource_operation_permission_rules/chat_application_permissions.md @@ -0,0 +1,49 @@ +--- +sidebar_position: 2 +sidebar_label: "Chat application permissions" +--- + +## Chat application permissions + +Chat application permissions control viewing, configuration, creation, deletion, generation, and retrieval operations for chat assistants. + +### Chat management + +| Operation | No permission | Read | Write | Manage | Owner | +| --- | --- | --- | --- | --- | --- | +| Get chat list | X | Y | Y | Y | Y | +| Get chat details | X | Y | Y | Y | Y | +| Full update of chat configuration | X | X | X | Y | Y | +| Partial update of chat configuration | X | X | X | Y | Y | +| Create chat application configuration | X | X | X | X | Y | +| Batch delete chats through `ids`, `delete_all`, or request-body `chat_id` | X | X | X | X | Y | +| Delete a single chat | X | X | X | X | Y | + +### Sessions and messages + +| Operation | No permission | Read | Write | Manage | Owner | +| --- | --- | --- | --- | --- | --- | +| Create session | X | Y | Y | Y | Y | +| List sessions | X | Y | Y | Y | Y | +| Get a single session | X | Y | Y | Y | Y | +| Like, dislike, or submit feedback | X | Y | Y | Y | Y | +| Batch delete sessions | X | X | Y | Y | Y | +| Update session name or information | X | X | Y | Y | Y | +| Delete a message and its reply or reference | X | X | Y | Y | Y | + +For read permission, session operations are limited to the user's own sessions. Write permission can cover all sessions. Batch deletion and message deletion with write permission are limited to the user's own sessions; manage permission and owner permission cover all sessions. + +### Chat generation and retrieval + +| Operation | No permission | Read | Write | Manage | Owner | +| --- | --- | --- | --- | --- | --- | +| TTS returns audio stream | X | Y | Y | Y | Y | +| Audio to text | X | Y | Y | Y | Y | +| Main chat completion API, including SSE and non-SSE | X | Y | Y | Y | Y | +| OpenAI-compatible chat completion | X | Y | Y | Y | Y | +| Shared chatbot conversation entry | X | Y | Y | Y | Y | +| Get recommended questions | X | Y | Y | Y | Y | +| Legacy completion API | X | Y | Y | Y | Y | +| Legacy recommended questions | X | Y | Y | Y | Y | + +For the main chat completion API, read permission applies to the user's own sessions, while manage permission applies to all sessions. diff --git a/docs/guides/team/resource_operation_permission_rules/index.md b/docs/guides/team/resource_operation_permission_rules/index.md new file mode 100644 index 0000000000..ad5acfc1e0 --- /dev/null +++ b/docs/guides/team/resource_operation_permission_rules/index.md @@ -0,0 +1,17 @@ +--- +sidebar_position: 4 +slug: /resource_operation_permission_rules +sidebar_custom_props: { + categoryIcon: LucideKeyRound +} +sidebar_label: Overview +--- +# Resource operation permission rules + +Resource operation permission rules define what users can do with shared resources. + +--- + +After a resource is shared, operation permissions determine whether a user can view, configure, use, or manage that resource. Different resource types use different operation tables. The resource owner always has the highest permission. + +In the tables below, **Y** means the operation is allowed and **X** means the operation is not allowed. diff --git a/docs/guides/team/resource_operation_permission_rules/knowledge_base_operation_permissions.md b/docs/guides/team/resource_operation_permission_rules/knowledge_base_operation_permissions.md new file mode 100644 index 0000000000..555c213078 --- /dev/null +++ b/docs/guides/team/resource_operation_permission_rules/knowledge_base_operation_permissions.md @@ -0,0 +1,85 @@ +--- +sidebar_position: 1 +sidebar_label: "Knowledge base operation permissions" +--- + +## Knowledge base operation permissions + +Knowledge base permissions are determined jointly by knowledge base-level permissions and document-level permissions. Knowledge base permissions include **Read permission**, **Write permission**, and **Manage permission**. Documents in a knowledge base can also have no permission, read permission, write permission, or manage permission. + +### File and file permission operations + +The following operations require document read permission or higher. If the user has no permission on the target document, the operation is not allowed even when the user has knowledge base-level permission. + +| Operation | No document permission | Document read | Document write | Document manage | Owner | +| --- | --- | --- | --- | --- | --- | +| View parsing logs | X | Y | Y | Y | Y | +| View file information | X | Y | Y | Y | Y | +| Download file | X | Y | Y | Y | Y | +| View chunk | X | Y | Y | Y | Y | +| View file configuration | X | Y | Y | Y | Y | +| View metadata | X | Y | Y | Y | Y | +| Preview document | X | Y | Y | Y | Y | + +The following operations require document write permission or higher. + +| Operation | No document permission | Document read | Document write | Document manage | Owner | +| --- | --- | --- | --- | --- | --- | +| Enable or disable file | X | X | Y | Y | Y | +| Edit metadata | X | X | Y | Y | Y | +| Batch update metadata | X | X | Y | Y | Y | +| Parse or cancel parsing | X | X | Y | Y | Y | +| Enable or disable chunk | X | X | Y | Y | Y | +| Add chunk | X | X | Y | Y | Y | +| Modify chunk | X | X | Y | Y | Y | +| Delete chunk | X | X | Y | Y | Y | + +The following operations require document manage permission. + +| Operation | No document permission | Document read | Document write | Document manage | Owner | +| --- | --- | --- | --- | --- | --- | +| Modify file configuration | X | X | X | Y | Y | +| Rename file | X | X | X | Y | Y | + +### Knowledge base permission operations + +The following knowledge base operations are available to users with knowledge base read permission or higher. + +| Operation | No KB permission | KB read | KB write | KB manage | Owner | +| --- | --- | --- | --- | --- | --- | +| View knowledge graph | X | Y | Y | Y | Y | +| Duplicate | X | Y | Y | Y | Y | +| View dataset card | X | Y | Y | Y | Y | +| View metadata configuration | X | Y | Y | Y | Y | +| `trace_index` | X | Y | Y | Y | Y | +| Metadata aggregation | X | Y | Y | Y | Y | +| Knowledge base tag aggregation | X | Y | Y | Y | Y | +| View knowledge base parsing overview | X | Y | Y | Y | Y | +| View knowledge base tag | X | Y | Y | Y | Y | + +The following knowledge base operations require knowledge base manage permission or owner permission. + +| Operation | No KB permission | KB read | KB write | KB manage | Owner | +| --- | --- | --- | --- | --- | --- | +| Delete file | X | X | X | Y | Y | +| Add file | X | X | X | Y | Y | +| Generate RAPTOR | X | X | X | Y | Y | +| Generate index | X | X | X | Y | Y | +| Delete index | X | X | X | Y | Y | +| Generate knowledge graph | X | X | X | Y | Y | +| Delete knowledge graph | X | X | X | Y | Y | +| Re-embed | X | X | X | Y | Y | +| Delete knowledge base tag | X | X | X | Y | Y | +| Rename knowledge base tag | X | X | X | Y | Y | +| Modify knowledge base configuration | X | X | X | Y | Y | +| Delete knowledge base | X | X | X | Y | Y | + +### Knowledge base permission judgment order + +When a user performs a knowledge base or document operation, permissions are evaluated in the following order: + +1. Whether the user has formally joined the team that owns the knowledge base. +2. Whether the knowledge base sharing scope allows team access. +3. Whether the user has knowledge base-level **Read**, **Write**, or **Manage** permission. +4. Whether the user has target document-level **Read**, **Write**, or **Manage** permission. +5. Whether the current operation is allowed by the permission table. diff --git a/docs/guides/team/resource_operation_permission_rules/mcp_permissions.md b/docs/guides/team/resource_operation_permission_rules/mcp_permissions.md new file mode 100644 index 0000000000..d63d6eb03f --- /dev/null +++ b/docs/guides/team/resource_operation_permission_rules/mcp_permissions.md @@ -0,0 +1,31 @@ +--- +sidebar_position: 4 +sidebar_label: "MCP permissions" +--- + +## MCP permissions + +MCP permission rules control MCP server creation, connection testing, listing, details, configuration, deletion, and export. + +| Operation | No permission | Read | Write | Manage | Owner | +| --- | --- | --- | --- | --- | --- | +| Create MCP server | Y | Y | Y | Y | Y | +| Test MCP connection | Y | Y | Y | Y | Y | +| Batch import MCP server | Y | Y | Y | Y | Y | +| List visible MCP servers | X | Y | Y | Y | Y | +| View MCP details | X | Y | Y | Y | Y | +| Update MCP configuration | X | X | Y | Y | Y | +| Delete MCP server | X | X | X | X | Y | +| Export or download MCP configuration | X | X | X | X | Y | + +Creating an MCP server creates a new resource and does not require an existing MCP permission. The owner permission is created after the resource is created. + +Testing MCP connection is currently not strictly restricted by existing permission checks in the backend. If this behavior changes, a permission check should be added at the point where MCP permissions can be changed. + +Batch import creates resources and does not use `operator_permission` from an existing MCP server. + +Listing visible MCP servers returns visible results, including `operator_permission`. If an MCP server is visible, its details can be read. + +Updating MCP configuration includes updating URL, headers, variables, and tools. Manage permission is recommended for this operation. + +Deleting an MCP server is recommended to be owner-only. Exporting or downloading MCP configuration is also recommended to be owner-only because the configuration may contain sensitive values such as `authorization_token`. diff --git a/docs/guides/team/resource_operation_permission_rules/memory_permissions.md b/docs/guides/team/resource_operation_permission_rules/memory_permissions.md new file mode 100644 index 0000000000..a33e093e06 --- /dev/null +++ b/docs/guides/team/resource_operation_permission_rules/memory_permissions.md @@ -0,0 +1,34 @@ +--- +sidebar_position: 5 +sidebar_label: "Memory permissions" +--- + +## Memory permissions + +Memory settings include a sharing scope. Memory permissions cover memory configuration, memory messages, SDK-related message access, and message status operations. + +### Memory operations + +| Resource | Operation | No permission | Read | Write | Manage | Owner | +| --- | --- | --- | --- | --- | --- | --- | +| MEMORY | Create memory | Y | Y | Y | Y | Y | +| MEMORY | List memory | X | Y | Y | Y | Y | +| MEMORY | View memory configuration | X | Y | Y | Y | Y | +| MEMORY | View memory message list | X | Y | Y | Y | Y | +| MEMORY | Modify memory basic configuration | X | X | X | Y | Y | +| MEMORY | Delete memory | X | X | X | X | Y | + +Creating a memory creates a new resource. The frontend creation entry is on the memories list page. Listing memories returns accessible memories, including private and shared memories. Modifying memory basic configuration includes fields such as name, model, and prompts. + +### Message operations + +| Resource | Operation | No permission | Read | Write | Manage | Owner | +| --- | --- | --- | --- | --- | --- | --- | +| MESSAGE | Search messages | X | Y | Y | Y | Y | +| MESSAGE | Get a specified message | X | Y | Y | Y | Y | +| MESSAGE | View message content | X | Y | Y | Y | Y | +| MESSAGE | Add message to memory | X | X | Y | Y | Y | +| MESSAGE | Delete a single message | X | X | Y | Y | Y | +| MESSAGE | Update a single message status | X | X | Y | Y | Y | + +Message search can be performed by memory, Agent, or session. Getting specified messages applies to memory messages and SDK availability. Adding a message to memory has no direct frontend button and is mainly used by the backend SDK. diff --git a/docs/guides/team/resource_operation_permission_rules/model_permissions.md b/docs/guides/team/resource_operation_permission_rules/model_permissions.md new file mode 100644 index 0000000000..de3f40e006 --- /dev/null +++ b/docs/guides/team/resource_operation_permission_rules/model_permissions.md @@ -0,0 +1,34 @@ +--- +sidebar_position: 7 +sidebar_label: "Model permissions" +--- + +## Model permissions + +Model permissions use provider-level and owner-level checks. The table below uses **No permission**, **Read permission**, and **Owner** columns. + +| Operation | No permission | Read permission | Owner | +| --- | --- | --- | --- | +| List providers | X | Y | Y | +| Add provider | X | Y | Y | +| Delete provider | X | X | Y | +| View models under a provider | X | X | Y | +| View a single model | X | X | Y | +| Create instance | X | X | Y | +| Verify connection or API key | X | X | Y | +| List instances | X | X | Y | +| View a single instance | X | X | Y | +| Get models under an instance | X | X | Y | +| Create instance model scope | X | X | Y | +| Delete instance model scope | X | X | Y | +| View model support status | X | X | Y | +| Create model support status | X | X | Y | +| Delete model support status | X | X | Y | +| Batch delete instances | X | X | Y | +| View system default model | X | X | Y | +| View current user's default model | X | X | Y | +| Set or get default model | X | X | Y | + +Listing providers lists the current user's own providers and system providers. Adding a provider follows the permission matrix. Deleting a provider is not related to ordinary read permissions. + +Viewing the system default model must determine whether the default model belongs to the current user. Viewing the current user's default model must determine whether the model is the user's own default value. Setting or getting the default model follows the initial permission design. diff --git a/docs/guides/team/resource_operation_permission_rules/permission_effective_rules.md b/docs/guides/team/resource_operation_permission_rules/permission_effective_rules.md new file mode 100644 index 0000000000..9d117a722c --- /dev/null +++ b/docs/guides/team/resource_operation_permission_rules/permission_effective_rules.md @@ -0,0 +1,14 @@ +--- +sidebar_position: 8 +sidebar_label: "Permission effective rules" +--- + +## Permission effective rules + +Resource permissions take effect according to the following general rules: + +- The resource owner always has all permissions. +- If the sharing scope is **Only me**, only the owner can access the resource. +- If the sharing scope is **Team**, only team members who meet the permission conditions can access the resource. +- In RAGFlow Enterprise, the system checks collaborator configuration for **Member**, **Department**, and **Group** collaborators. +- If finer-grained permissions exist, such as document-level permissions in a knowledge base, those permissions continue to apply on top of resource access permission. diff --git a/docs/guides/team/resource_operation_permission_rules/search_permissions.md b/docs/guides/team/resource_operation_permission_rules/search_permissions.md new file mode 100644 index 0000000000..87ee3ae963 --- /dev/null +++ b/docs/guides/team/resource_operation_permission_rules/search_permissions.md @@ -0,0 +1,25 @@ +--- +sidebar_position: 6 +sidebar_label: "Search permissions" +--- + +## Search permissions + +Search permissions control creating Search applications, listing and viewing Search applications, Q&A, related questions, mind map generation, editing, and deletion. + +| Operation | No permission | Read | Write | Manage | Owner | +| --- | --- | --- | --- | --- | --- | +| Create Search | Y | Y | Y | Y | Y | +| Search list | X | Y | Y | Y | Y | +| Search details | X | Y | Y | Y | Y | +| Search Q&A | X | X | Y | Y | Y | +| Get related questions | X | X | Y | Y | Y | +| Generate mind map | X | X | Y | Y | Y | +| Edit Search | X | X | X | Y | Y | +| Delete Search | X | X | X | X | Y | + +Creating Search creates a new resource and creates the owner record afterward. The Search list currently relies on the ENABLE role check and is not fully connected to ACL sharing. Search details are currently connected only by ID; changing this to a READ operation is recommended. + +For Search Q&A, related questions, and mind map generation, effective use recommends a READ operation check rather than only checking whether the resource can be created. + +Editing Search includes adjusting knowledge base configuration and should require manage permission. Deleting Search is recommended to be owner-only, and current behavior is generally consistent with `created_by`. diff --git a/docs/guides/team/share_agents.md b/docs/guides/team/share_agents.md deleted file mode 100644 index f901f08ebf..0000000000 --- a/docs/guides/team/share_agents.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -sidebar_position: 6 -slug: /share_agent -sidebar_custom_props: { - categoryIcon: LucideShare2 -} ---- -# Share Agent - -Share an Agent with your team members. - ---- - -When ready, you may share your Agents with your team members so that they can use them. Please note that your Agents are not shared automatically; you must manually enable sharing by selecting the corresponding **Permissions** radio button: - -1. Click the intended Agent to open its editing canvas. -2. Click **Management** > **Settings** to show the **Agent settings** dialogue. -3. Change **Permissions** from **Only me** to **Team**. -4. Click **Save** to apply your changes. - -*When completed, your team members will see your shared Agents.* \ No newline at end of file diff --git a/docs/guides/team/share_chat_assistant.md b/docs/guides/team/share_chat_assistant.md deleted file mode 100644 index 719fbda51a..0000000000 --- a/docs/guides/team/share_chat_assistant.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -sidebar_position: 5 -slug: /share_chat_assistant -sidebar_custom_props: { - categoryIcon: LucideShare2 -} ---- -# Share chat assistant - -Sharing chat assistant is currently exclusive to RAGFlow Enterprise, but will be made available in due course. \ No newline at end of file diff --git a/docs/guides/team/share_knowledge_bases.md b/docs/guides/team/share_knowledge_bases.md deleted file mode 100644 index 3f00c9bd8e..0000000000 --- a/docs/guides/team/share_knowledge_bases.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -sidebar_position: 4 -slug: /share_datasets -sidebar_custom_props: { - categoryIcon: LucideShare2 -} ---- -# Share dataset - -Share a dataset with team members. - ---- - -When ready, you may share your datasets with your team members so that they can upload and parse files in them. Please note that your datasets are not shared automatically; you must manually enable sharing by selecting the appropriate **Permissions** radio button: - -1. Navigate to the dataset's **Configuration** page. -2. Change **Permissions** from **Only me** to **Team**. -3. Click **Save** to apply your changes. - -*Once completed, your team members will see your shared datasets.* \ No newline at end of file diff --git a/docs/guides/team/share_memory.md b/docs/guides/team/share_memory.md deleted file mode 100644 index fa7a1c51b0..0000000000 --- a/docs/guides/team/share_memory.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -sidebar_position: 9 -slug: /share_memory -sidebar_custom_props: { - categoryIcon: LucideShare2 -} ---- -# Share memory - -Share a memory with your team members. - ---- - -When ready, you may share your memory with your team members so that they can use it. Please note that your memories are not shared automatically; you must manually enable sharing by selecting the corresponding **Permissions** radio button: - -1. Navigate to the **Memory** page, find the intended memory, and click to open its editing canvas. -2. Click **Configurations**. -3. Change **Permissions** from **Only me** to **Team**. -4. Click **Save** to apply your changes. - *When completed, your team members will see your shared memories.* \ No newline at end of file diff --git a/docs/guides/team/share_model.md b/docs/guides/team/share_model.md deleted file mode 100644 index 5a97e67165..0000000000 --- a/docs/guides/team/share_model.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -sidebar_position: 7 -slug: /share_model -sidebar_custom_props: { - categoryIcon: LucideShare2 -} ---- -# Share models - -Sharing models is currently exclusive to RAGFlow Enterprise. \ No newline at end of file diff --git a/docs/guides/team/sharing_scope_configuration/_category_.json b/docs/guides/team/sharing_scope_configuration/_category_.json new file mode 100644 index 0000000000..87bfaf24b2 --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Sharing scope configuration", + "position": 3, + "link": { + "type": "generated-index", + "description": "Sharing scope configuration." + }, + "customProps": { + "categoryIcon": "LucideShare2" + } +} diff --git a/docs/guides/team/sharing_scope_configuration/collaborator_permission_configuration.md b/docs/guides/team/sharing_scope_configuration/collaborator_permission_configuration.md new file mode 100644 index 0000000000..ef6666717e --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/collaborator_permission_configuration.md @@ -0,0 +1,24 @@ +--- +sidebar_position: 3 +sidebar_label: "Collaborator permission configuration" +--- + +## Collaborator permission configuration + +In RAGFlow Enterprise, you can configure permissions separately for different collaborator objects, including **Member**, **Department**, and **Group**. Each collaborator can have an independent permission level. + +To configure collaborator permissions: + +1. Open the resource's **Permission Management** page. +2. Click **Add**. +3. Add a member, department, or group as a collaborator. +4. In the collaborator's **Permission** field, select the required permission level. +5. Save the configuration. The permission takes effect immediately. + +| Permission | Description | +| --- | --- | +| Read permission | Allows users to view and use the resource, but does not allow them to modify resource content or configuration. | +| Write permission | Allows users to edit resource content, such as adding, modifying, or deleting content in the resource, but does not allow them to modify resource permissions or management configuration. | +| Manage permission | Grants resource management permissions. Users can manage resource configuration, collaborator permissions, and other management operations. | + +![Collaborator Permission Configuration](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/collaborator_permission_configuration.jpg) diff --git a/docs/guides/team/sharing_scope_configuration/document_level_permissions_enterprise_edition.md b/docs/guides/team/sharing_scope_configuration/document_level_permissions_enterprise_edition.md new file mode 100644 index 0000000000..9d7e4886a2 --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/document_level_permissions_enterprise_edition.md @@ -0,0 +1,35 @@ +--- +sidebar_position: 4 +sidebar_label: "Document-level permissions (Enterprise edition)" +--- + +## Document-level permissions (Enterprise edition) + +Document-level permissions refine knowledge base permissions. The knowledge base owner can configure different collaborator permissions for different documents in the same knowledge base. + +For example, the same team member may have read permission on a knowledge base but no permission on a specific document in it. The same member may also have write permission on a specific document, allowing operations such as enabling or disabling that document. + +### Configure operations + +In the **Files** list of a knowledge base, each document row provides a key icon in the **Action** column. Click the key icon to open the document's **Permission Management** dialog. + +Use this dialog to configure collaborator permissions for the selected document. + +![Configure Operations](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/configure_operations_1.jpg) + +![Configure Operations](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/configure_operations_2.jpg) + + +### Document permission levels + +Document-level permission management also uses **Read permission**, **Write permission**, and **Manage permission**. + +| Permission | Description | +| --- | --- | +| Read permission | Allows read-only operations such as viewing document information, previewing documents, downloading documents, viewing chunks, and viewing parsing logs. | +| Write permission | Allows document status change operations, such as enabling or disabling documents. | +| Manage permission | Allows higher-level document management actions and covers operations within the read and write permission scopes. | + +Resource owners have the highest permission on documents. + +If a document has not finished parsing or is being parsed, buttons in the **Action** column may be disabled. In this case, even if the user has the required permission, they must wait until parsing is complete before performing the corresponding operation. diff --git a/docs/guides/team/sharing_scope_configuration/enterprise_edition_sharing_scope_configuration.md b/docs/guides/team/sharing_scope_configuration/enterprise_edition_sharing_scope_configuration.md new file mode 100644 index 0000000000..99b9e961a9 --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/enterprise_edition_sharing_scope_configuration.md @@ -0,0 +1,26 @@ +--- +sidebar_position: 2 +sidebar_label: "Enterprise edition sharing scope configuration" +--- + +## Enterprise edition sharing scope configuration + +RAGFlow Enterprise supports finer-grained team permission management and team permission control. After a resource is set to **Team**, it does not automatically authorize all team members to access the resource. + +Administrators can add collaborators to a resource and grant permissions to **Member**, **Department**, or **Group** collaborators. Only authorized users can access the resource. + +Departments and groups are created by administrators based on the enterprise's actual organization structure. Their names and hierarchy may vary between enterprises. + +Collaborators can be one of the following object types: + +| Type | Description | +| --- | --- | +| Member | Specifies an individual team member. | +| Department | Specifies a department. Members in the department can inherit the corresponding permissions. | +| Group | Specifies a user group. Members in the group can inherit the corresponding permissions. | + +![Enterprise Edition Sharing Scope Configuration](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/enterprise_edition_sharing_scope_configuration_1.jpg) + +![Enterprise Edition Sharing Scope Configuration](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/enterprise_edition_sharing_scope_configuration_2.jpg) + +![Enterprise Edition Sharing Scope Configuration](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/enterprise_edition_sharing_scope_configuration_3.jpg) diff --git a/docs/guides/team/sharing_scope_configuration/index.md b/docs/guides/team/sharing_scope_configuration/index.md new file mode 100644 index 0000000000..3576a10eb9 --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/index.md @@ -0,0 +1,15 @@ +--- +sidebar_position: 3 +slug: /sharing_scope_configuration +sidebar_custom_props: { + categoryIcon: LucideShare2 +} +sidebar_label: Overview +--- +# Sharing scope configuration + +Configure the visible scope of resources in RAGFlow. + +--- + +Sharing scope controls which users can access the current resource. Resources that support team sharing, such as knowledge bases, Agents, chats, Search applications, and memories, can be configured with a sharing scope. diff --git a/docs/guides/team/sharing_scope_configuration/open_source_edition_sharing_scope_configuration.md b/docs/guides/team/sharing_scope_configuration/open_source_edition_sharing_scope_configuration.md new file mode 100644 index 0000000000..1b569dc13d --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/open_source_edition_sharing_scope_configuration.md @@ -0,0 +1,15 @@ +--- +sidebar_position: 1 +sidebar_label: "Open-source edition sharing scope configuration" +--- + +## Open-source edition sharing scope configuration + +In the open-source edition, the sharing scope is configured through the **Permissions** field on the resource configuration page. Select one of the following options based on your business needs: + +- **Only me**: Only the knowledge base owner can access the knowledge base. +- **Team**: The knowledge base can be shared within the team. + +Resources are not shared automatically. To make a resource available to other users, explicitly configure its sharing scope or permissions. + +![Open Source Edition Sharing Scope Configuration](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/open_source_edition_sharing_scope_configuration.jpg) diff --git a/docs/guides/team/sharing_scope_configuration/share_agents.md b/docs/guides/team/sharing_scope_configuration/share_agents.md new file mode 100644 index 0000000000..ac826ac52f --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/share_agents.md @@ -0,0 +1,15 @@ +--- +sidebar_position: 7 +sidebar_label: "Share Agents" +--- + +## Share Agents + +To share an Agent: + +1. Open the intended Agent in its editing canvas. +2. Click **Management** **>** **Settings** to open the **Agent settings** dialog. +3. Change **Permissions** from **Only me** to **Team**. +4. Click **Save** to apply your changes. + +After this configuration is saved, team members can see the shared Agent. diff --git a/docs/guides/team/sharing_scope_configuration/share_chat_assistants.md b/docs/guides/team/sharing_scope_configuration/share_chat_assistants.md new file mode 100644 index 0000000000..7a77e0698c --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/share_chat_assistants.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 6 +sidebar_label: "Share chat assistants" +--- + +## Share chat assistants + +Sharing chat assistants is currently exclusive to RAGFlow Enterprise. diff --git a/docs/guides/team/sharing_scope_configuration/share_knowledge_bases.md b/docs/guides/team/sharing_scope_configuration/share_knowledge_bases.md new file mode 100644 index 0000000000..1363dd8b2a --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/share_knowledge_bases.md @@ -0,0 +1,10 @@ +--- +sidebar_position: 5 +sidebar_label: "Share knowledge bases" +--- + +## Share knowledge bases + +Share a knowledge base by changing its **Permissions** from **Only me** to **Team**. + +Team members can upload and parse files in shared knowledge bases. diff --git a/docs/guides/team/sharing_scope_configuration/share_memories.md b/docs/guides/team/sharing_scope_configuration/share_memories.md new file mode 100644 index 0000000000..12a49b34b9 --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/share_memories.md @@ -0,0 +1,15 @@ +--- +sidebar_position: 9 +sidebar_label: "Share memories" +--- + +## Share memories + +To share a memory: + +1. Navigate to the **Memory** page and open the intended memory. +2. Click **Configurations**. +3. Change **Permissions** from **Only me** to **Team**. +4. Click **Save** to apply your changes. + +After this configuration is saved, team members can see the shared memory. diff --git a/docs/guides/team/sharing_scope_configuration/share_models.md b/docs/guides/team/sharing_scope_configuration/share_models.md new file mode 100644 index 0000000000..6eff998d77 --- /dev/null +++ b/docs/guides/team/sharing_scope_configuration/share_models.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 8 +sidebar_label: "Share models" +--- + +## Share models + +Sharing models is currently exclusive to RAGFlow Enterprise. diff --git a/docs/guides/team/team_management/_category_.json b/docs/guides/team/team_management/_category_.json new file mode 100644 index 0000000000..5f29151b87 --- /dev/null +++ b/docs/guides/team/team_management/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Team management", + "position": 2, + "link": { + "type": "generated-index", + "description": "Team management." + }, + "customProps": { + "categoryIcon": "LucideLogOut" + } +} diff --git a/docs/guides/team/team_management/accept_or_decline_an_invitation.md b/docs/guides/team/team_management/accept_or_decline_an_invitation.md new file mode 100644 index 0000000000..ac0eabad93 --- /dev/null +++ b/docs/guides/team/team_management/accept_or_decline_an_invitation.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 6 +sidebar_label: "Accept or decline an invitation" +--- + +## Accept or decline an invitation + +When another team owner invites you to join a team, you can process the invitation on the **Team** page. + +If the membership role is `invite`, the **Joined teams** list displays **Agree** and **Refuse** operations. + +- Click **Agree** to accept the invitation. The system changes the relationship role from `invite` to `normal`. +- Click **Refuse** to decline the invitation. The system deletes the invitation relationship. + +Only an invitation relationship can be accepted. After accepting an invitation, you can access team-shared resources in that workspace when those resources also satisfy their sharing scope and operation permission rules. + +![Accept Or Decline An Invitation](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/accept_or_decline_an_invitation_1.jpg) + +![Accept Or Decline An Invitation](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/accept_or_decline_an_invitation_2.jpg) diff --git a/docs/guides/team/team_management/enter_the_team_page.md b/docs/guides/team/team_management/enter_the_team_page.md new file mode 100644 index 0000000000..fc0b510c6b --- /dev/null +++ b/docs/guides/team/team_management/enter_the_team_page.md @@ -0,0 +1,12 @@ +--- +sidebar_position: 1 +sidebar_label: "Enter the Team page" +--- + +## Enter the Team page + +Click your avatar in the upper-right corner of the page, then select **Team** in the left-side panel to access the **Team** page. + +The page title is displayed as the current user's nickname plus **workspace**. On this page, you can view members in the current workspace and teams that the current user has joined. + +![Enter The Team Page](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/enter_the_team_page.jpg) diff --git a/docs/guides/team/team_management/enterprise_role_permissions.md b/docs/guides/team/team_management/enterprise_role_permissions.md new file mode 100644 index 0000000000..a530e00097 --- /dev/null +++ b/docs/guides/team/team_management/enterprise_role_permissions.md @@ -0,0 +1,12 @@ +--- +sidebar_position: 10 +sidebar_label: "Enterprise role permissions" +--- + +## Enterprise role permissions + +Enterprise role permissions are separate from the team page. + +The Enterprise role page supports listing roles, creating roles, editing role descriptions, deleting roles, and configuring available actions by resource type. The fixed action types include **enable**, **read**, **write**, and **share**. + +Enterprise roles are different from team roles such as `owner`, `invite`, and `normal`. diff --git a/docs/guides/team/team_management/faq.md b/docs/guides/team/team_management/faq.md new file mode 100644 index 0000000000..8d367bf3e4 --- /dev/null +++ b/docs/guides/team/team_management/faq.md @@ -0,0 +1,31 @@ +--- +sidebar_position: 11 +sidebar_label: "FAQ" +--- + +## FAQ + +### Why does inviting a member fail? + +Common causes include: + +- The email address does not belong to an existing RAGFlow user. +- The user has already joined the team. +- The user has already been invited. +- The current user is not the team owner. + +### Why can't an invited user see team resources? + +The invited user must first click **Agree** to join the team. The target resource must also be set to **Team** or otherwise authorized to the user. + +### Why can a team member only see some knowledge bases after joining a team? + +Only knowledge bases whose permissions allow team access are visible to joined team members. + +### Why can't a team member delete a shared knowledge base? + +Deleting a shared knowledge base generally requires the current user to be the creator of the knowledge base. Team sharing grants access and use permissions, but it does not automatically grant delete permission. + +### Are Team roles the same as Enterprise roles? + +No. Team roles describe membership in a workspace. Enterprise roles describe administrative resource action permissions. diff --git a/docs/guides/team/team_management/index.md b/docs/guides/team/team_management/index.md new file mode 100644 index 0000000000..3bae393f4e --- /dev/null +++ b/docs/guides/team/team_management/index.md @@ -0,0 +1,24 @@ +--- +sidebar_position: 2 +slug: /team_management +sidebar_custom_props: { + categoryIcon: LucideLogOut +} +sidebar_label: Overview +--- +# Team management + +Manage team members, team invitations, joined teams, departments, and groups. + +--- + +By default, each RAGFlow user is assigned a single team named after the user's name. RAGFlow allows you to invite RAGFlow users to your team. Your team members can help you: + +- Upload documents to your shared datasets. +- Parse documents in your shared datasets. +- Use your shared Agents. + +:::tip NOTE +- Team members cannot invite users to your team. Only the team owner can invite users or remove members. +- Sharing added models with team members is only available in RAGFlow Enterprise. +::: diff --git a/docs/guides/team/team_management/invite_members.md b/docs/guides/team/team_management/invite_members.md new file mode 100644 index 0000000000..8a38150264 --- /dev/null +++ b/docs/guides/team/team_management/invite_members.md @@ -0,0 +1,23 @@ +--- +sidebar_position: 3 +sidebar_label: "Invite members" +--- + +## Invite members + +The team owner can invite RAGFlow users to join the team. + +To invite a member: + +1. Open the **Team** page. +2. In the **Team members** area, click **Invite**. +3. Enter the email address of the user to invite. +4. Click **OK**. + +The email address must belong to an existing RAGFlow user. If the email address does not match any user, the system returns a user-not-found error. If the user has already joined the team or has already been invited, the system rejects the duplicate invitation. + +After the invitation is created, the membership record is stored with the `invite` role. The invited user must accept the invitation before becoming a normal team member. + +![Invite Members](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/invite_members_1.jpg) + +![Invite Members](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/invite_members_2.jpg) diff --git a/docs/guides/team/team_management/leave_a_joined_team.md b/docs/guides/team/team_management/leave_a_joined_team.md new file mode 100644 index 0000000000..1eca083303 --- /dev/null +++ b/docs/guides/team/team_management/leave_a_joined_team.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 7 +sidebar_label: "Leave a joined team" +--- + +## Leave a joined team + +A user with the `normal` role can leave a joined team if the team is not the user's own workspace. + +To leave a joined team: + +1. Open the **Team** page. +2. Find the target team in the **Joined teams** list. +3. Click the leave action. +4. Confirm the operation. + +After leaving a team, the team no longer appears as a joined team. The user can no longer access resources that are only shared within that team. The user's own workspace does not provide a leave operation. + +![Leave A Joined Team](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/leave_a_joined_team.jpg) diff --git a/docs/guides/team/team_management/manage_departments.md b/docs/guides/team/team_management/manage_departments.md new file mode 100644 index 0000000000..1055476c67 --- /dev/null +++ b/docs/guides/team/team_management/manage_departments.md @@ -0,0 +1,30 @@ +--- +sidebar_position: 8 +sidebar_label: "Manage departments" +--- + +## Manage departments + +In RAGFlow Enterprise, administrators can create departments according to the enterprise's actual organization structure. Departments can be used as collaborator objects when configuring resource permissions. + +### Add or remove department members + +Administrators can add users to a department or remove users from a department. Members in a department can inherit the corresponding resource permission when the department is added as a collaborator. + +![Add Or Remove Department Members](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/add_or_remove_department_members_1.jpg) + +![Add Or Remove Department Members](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/add_or_remove_department_members_2.jpg) + + +### Move departments + +Administrators can move departments to adjust the organization hierarchy. Department names and levels may vary between enterprises. + +![Move Departments](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/move_departments.jpg) + + +### Manage groups + +In RAGFlow Enterprise, administrators can create groups to organize users for permission configuration and resource collaboration. A group can be added as a collaborator, and users in the group can inherit the group's corresponding permission. + +![Manage Groups](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/manage_groups.jpg) diff --git a/docs/guides/team/team_management/remove_members.md b/docs/guides/team/team_management/remove_members.md new file mode 100644 index 0000000000..863bf75d29 --- /dev/null +++ b/docs/guides/team/team_management/remove_members.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 4 +sidebar_label: "Remove members" +--- + +## Remove members + +The team owner can remove members from the team. + +To remove a member: + +1. Open the **Team** page. +2. Find the member in the **Team members** list. +3. Click the delete action in the **Action** column. +4. Confirm the operation. + +The workspace owner cannot be removed from the workspace. Removing a member does not delete the member's personal resources, but it affects the member's access to resources that are shared only within the team. + +![Remove Members](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/remove_members.jpg) diff --git a/docs/guides/team/team_management/resource_sharing_from_the_team_perspective.md b/docs/guides/team/team_management/resource_sharing_from_the_team_perspective.md new file mode 100644 index 0000000000..7424ad2968 --- /dev/null +++ b/docs/guides/team/team_management/resource_sharing_from_the_team_perspective.md @@ -0,0 +1,21 @@ +--- +sidebar_position: 9 +sidebar_label: "Resource sharing from the team perspective" +--- + +## Resource sharing from the team perspective + +Joining a team does not automatically grant access to all resources in that team. The resource itself must be shared with the team or authorized to the user. + +For knowledge bases, the **Permissions** field can be set to **Only me** or **Team**. The default value is **Only me**. When the value is changed to **Team**, joined team members can see and use the knowledge base according to permission rules. + +Knowledge base access follows these rules: + +- If the current user belongs to the owner tenant, access is allowed. +- If the knowledge base permission is **Only me**, non-owners cannot access it. +- If the knowledge base permission is **Team** and the user belongs to the tenant, access is allowed. +- Deleting a knowledge base is stricter and generally requires the current user to be the creator. + +Agent sharing also uses **Only me** and **Team**. The permission field is located in the Agent settings dialog. The default value is **Only me**. + +Memory sharing is configured in the memory's advanced settings. **Only me** maps to `me`, and **Team** maps to `team`. The backend also defines an `all` value, but the UI exposes **Only me** and **Team**. diff --git a/docs/guides/team/team_management/view_current_workspace_members.md b/docs/guides/team/team_management/view_current_workspace_members.md new file mode 100644 index 0000000000..361ed498e2 --- /dev/null +++ b/docs/guides/team/team_management/view_current_workspace_members.md @@ -0,0 +1,24 @@ +--- +sidebar_position: 2 +sidebar_label: "View current workspace members" +--- + +## View current workspace members + +The **Team members** list displays members in the current workspace. The owner is not included in the ordinary member list returned by the backend member query. + +The list contains the following fields: + +| Field | Description | +| --- | --- | +| Name | The member's nickname. | +| Update date | The time when the membership record was last updated. | +| Email | The member's email address. | +| Role | The member's team role. `normal` is displayed as **Member**, `invite` is displayed as **Invite**, and `owner` is displayed as **Owner**. | +| Action | Operations available for the current member, such as removing a member when permitted. | + +You can search members by nickname or email address, and sort members by **Update date**. + +Only the workspace owner can query and manage the full member list for the workspace. + +![View Current Workspace Members](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/view_current_workspace_members.jpg) diff --git a/docs/guides/team/team_management/view_joined_teams.md b/docs/guides/team/team_management/view_joined_teams.md new file mode 100644 index 0000000000..b695ea8315 --- /dev/null +++ b/docs/guides/team/team_management/view_joined_teams.md @@ -0,0 +1,21 @@ +--- +sidebar_position: 5 +sidebar_label: "View joined teams" +--- + +## View joined teams + +The **Joined teams** list displays other workspaces that the current user has joined or has been invited to join. + +The list contains the following fields: + +| Field | Description | +| --- | --- | +| Name | The workspace owner's nickname. | +| Update date | The time when the membership record was last updated. | +| Email | The workspace owner's email address. | +| Action | Operations available for the joined team, such as accepting, declining, or leaving. | + +You can search joined teams by the owner nickname or email address, and sort joined teams by **Update date**. + +![View Joined Teams](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/view_joined_teams.jpg)