writinwaters commited on
Commit
fb019e4
·
1 Parent(s): 6c8312a

Added a description of the Categorize agent component (#4428)

Browse files

### What problem does this PR solve?


### Type of change


- [x] Documentation Update

docs/guides/agent/text2sql_agent.md CHANGED
@@ -33,7 +33,7 @@ A list of components required:
33
 
34
  - [Begin](https://ragflow.io/docs/dev/begin_component)
35
  - [Interact](https://ragflow.io/docs/dev/interact_component)
36
- - Retrieval
37
  - [Generate](https://ragflow.io/docs/dev/generate_component)
38
  - ExeSQL
39
 
 
33
 
34
  - [Begin](https://ragflow.io/docs/dev/begin_component)
35
  - [Interact](https://ragflow.io/docs/dev/interact_component)
36
+ - [Retrieval](https://ragflow.io/docs/dev/retrieval_component)
37
  - [Generate](https://ragflow.io/docs/dev/generate_component)
38
  - ExeSQL
39
 
docs/references/agent_component_reference/categorize.mdx ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ sidebar_position: 5
3
+ slug: /categorize_component
4
+ ---
5
+
6
+ # Categorize component
7
+
8
+ The component that classifies user inputs and applies strategies accordingly.
9
+
10
+ > The **Categorize** component is usually the downstream of the **Interact** component.
11
+
12
+ ## Scenarios
13
+
14
+ A **Categorize** component is essential when you need the LLM to help you identify user intentions and apply appropriate processing strategies.
15
+
16
+ ## Configurations
17
+
18
+ ### Input
19
+
20
+ 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**.
21
+
22
+ - **Reference**: Uses a component's output or a user input as the data source. You are required to select from the dropdown menu:
23
+ - A component ID under **Component Output**, or
24
+ - A global variable under **Begin input**, which is defined in the **Begin** component.
25
+ - **Text**: Uses fixed text as the query. You are required to enter static text.
26
+
27
+ ### Model
28
+
29
+ Click the dropdown menu of **Model** to show the model configuration window.
30
+
31
+ - **Model**: The chat model to use.
32
+ - Ensure you set the chat model correctly on the **Model providers** page.
33
+ - You can use different models for different components to increase flexibility or improve overall performance.
34
+ - **Freedom**: A shortcut to **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty** settings, indicating the freedom level of the model.
35
+ This parameter has three options:
36
+ - **Improvise**: Produces more creative responses.
37
+ - **Precise**: (Default) Produces more conservative responses.
38
+ - **Balance**: A middle ground between **Improvise** and **Precise**.
39
+ - **Temperature**: The randomness level of the model's output.
40
+ Defaults to 0.1.
41
+ - Lower values lead to more deterministic and predictable outputs.
42
+ - Higher values lead to more creative and varied outputs.
43
+ - A temperature of zero results in the same output for the same prompt.
44
+ - **Top P**: Nucleus sampling.
45
+ - 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*.
46
+ - Defaults to 0.3.
47
+ - **Presence penalty**: Encourages the model to include a more diverse range of tokens in the response.
48
+ - A higher **presence penalty** value results in the model being more likely to generate tokens not yet been included in the generated text.
49
+ - Defaults to 0.4.
50
+ - **Frequency penalty**: Discourages the model from repeating the same words or phrases too frequently in the generated text.
51
+ - A higher **frequency penalty** value results in the model being more conservative in its use of repeated tokens.
52
+ - Defaults to 0.7.
53
+ - **Max tokens**: Sets the maximum length of the model's output, measured in the number of tokens.
54
+ - Defaults to 512.
55
+ - If disabled, you lift the maximum token limit, allowing the model to determine the number of tokens in its responses.
56
+
57
+ :::tip NOTE
58
+ - 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.
59
+ - If you are uncertain about the mechanism behind **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty**, you can simply choose one of the three options of **Freedom**.
60
+ :::
61
+
62
+ ### Message window size
63
+
64
+ 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.
65
+
66
+ Defaults to 1.
67
+
68
+ :::tip IMPORTANT
69
+ 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.
70
+ :::
71
+
72
+ ### Category name
73
+
74
+ 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.
75
+
76
+ :::tip NOTE
77
+ 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.
78
+ :::
79
+
80
+ #### Description
81
+
82
+ Description of this category.
83
+
84
+ You can input criteria, situation, or information that may help the LLM determine which inputs belong in this category.
85
+
86
+ #### Examples
87
+
88
+ Additional examples that may help the LLM determine which inputs belong in this category.
89
+
90
+ :::danger IMPORTANT
91
+ Examples are more helpful than the description if you want the LLM to classify particular cases into this category.
92
+ :::
93
+
94
+ #### To
95
+
96
+ Specifies the downstream component of this category.
97
+
98
+ - *Once you specify the ID of the downstream component, a link is established between this category and the corresponding component.*
99
+ - *If you manually link this category to a downstream component on the canvas, the ID of that component is auto-populated.*
100
+
101
+ ## Examples
102
+
103
+ You can explore our customer service agent template, where a **Categorize** component (component ID: **Question Categorize**) has four defined categories and takes data inputs from an **Interact** component (component ID: **Interface**):
104
+
105
+ 1. Click the **Agent** tab at the top center of the page to access the **Agent** page.
106
+ 2. Click **+ Create agent** on the top right of the page to open the **agent template** page.
107
+ 3. On the **agent template** page, hover over the **Interpreter** card and click **Use this template**.
108
+ 4. Name your new agent and click **OK** to enter the workflow editor.
109
+
docs/references/agent_component_reference/generate.mdx CHANGED
@@ -22,7 +22,8 @@ A **Generate** component is essential when you need the LLM to assist with summa
22
  Click the dropdown menu of **Model** to show the model configuration window.
23
 
24
  - **Model**: The chat model to use.
25
- Ensure you set the chat model correctly on the **Model providers** page; otherwise, an error message would occur.
 
26
  - **Freedom**: A shortcut to **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty** settings, indicating the freedom level of the model.
27
  This parameter has three options:
28
  - **Improvise**: Produces more creative responses.
@@ -47,7 +48,8 @@ Click the dropdown menu of **Model** to show the model configuration window.
47
  - If disabled, you lift the maximum token limit, allowing the model to determine the number of tokens in its responses.
48
 
49
  :::tip NOTE
50
- If you are uncertain about the mechanism behind **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty**, you can simply choose one of the three options of **Freedom**.
 
51
  :::
52
 
53
  ### System prompt
 
22
  Click the dropdown menu of **Model** to show the model configuration window.
23
 
24
  - **Model**: The chat model to use.
25
+ - Ensure you set the chat model correctly on the **Model providers** page.
26
+ - You can use different models for different components to increase flexibility or improve overall performance.
27
  - **Freedom**: A shortcut to **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty** settings, indicating the freedom level of the model.
28
  This parameter has three options:
29
  - **Improvise**: Produces more creative responses.
 
48
  - If disabled, you lift the maximum token limit, allowing the model to determine the number of tokens in its responses.
49
 
50
  :::tip NOTE
51
+ - 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.
52
+ - If you are uncertain about the mechanism behind **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty**, you can simply choose one of the three options of **Freedom**.
53
  :::
54
 
55
  ### System prompt
docs/references/agent_component_reference/retrieval.mdx CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- sidebar_position: 3
3
  slug: /retrieval_component
4
  ---
5
 
@@ -59,7 +59,7 @@ Using a rerank model will *significantly* increase the system's response time.
59
  You are required to select the knowledge base(s) to retrieve data from.
60
 
61
  :::danger IMPORTANT
62
- If you select multiple knowledge bases must ensure that the knowledge bases (datasets) you select use the same embedding model; otherwise, an error message would occur.
63
  :::
64
 
65
 
 
1
  ---
2
+ sidebar_position: 4
3
  slug: /retrieval_component
4
  ---
5
 
 
59
  You are required to select the knowledge base(s) to retrieve data from.
60
 
61
  :::danger IMPORTANT
62
+ If you select multiple knowledge bases, you must ensure that the knowledge bases (datasets) you select use the same embedding model; otherwise, an error message would occur.
63
  :::
64
 
65