Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added descriptions of Rewrite and Switch components. To be continued #4526

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

writinwaters
Copy link
Contributor

What problem does this PR solve?

Type of change

  • Documentation Update

@@ -62,8 +62,7 @@ Please review the flowing description of the RAG-specific components before you
| **Interact** | A component that serves as the interface between human and the bot, receiving user inputs and displaying the agent's responses. |
| **Categorize** | A component that uses the LLM to classify user inputs into predefined categories. Ensure you specify the name, description, and examples for each category, along with the corresponding next component. |
| **Message** | A component that sends out a static message. If multiple messages are supplied, it randomly selects one to send. Ensure its downstream is **Interact**, the interface component. |
| **Relevant** | A component that uses the LLM to assess whether the upstream output is relevant to the user's latest query. Ensure you specify the next component for each judge result. |
| **Rewrite** | A component that refines a user query if it fails to retrieve relevant information from the knowledge base. It repeats this process until the predefined looping upper limit is reached. Ensure its upstream is **Relevant** and downstream is **Retrieval**. |
| **Rewrite** | A component that edits, corrects, expands, or rewrites a user query from user-agent interaction, based on the context of previous dialogues. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLM and only rewrite


---

A **Rewrite** component edits, corrects, expands, or rewrites a user query from user-agent interaction, based on the context of previous dialogues.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From interaction component.


## Scenarios

A **Rewrite** component is essential when you need to optimize a user query based on the context of previous conversations. It is usually used in conjunction with a **Retrieval** component.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Input node of retrieval component.


A **Rewrite** component is essential when you need to optimize a user query based on the context of previous conversations. It is usually used in conjunction with a **Retrieval** component.

See also the [Keyword](https://ragflow.io/docs/dev/keyword_component) component, a similar component used for multi-turn optimization.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A guide for multi-turn optimization, consists of retrieval / rewrite / keyword node.


# Switch component

The component that evaluates whether specified conditions are met and applies strategies accordingly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

route to corresponding branch


---

A **Switch** component evaluates conditions based on the output of specific components and directs the flow of execution accordingly. It allows for complex branching logic by defining cases and specifying actions for each case or default action if no conditions are met.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No action, only route to different branch


## Scenarios

A **Switch** component is essential for condition-based flow of execution. It is somewhat similar to the [Categorize](https://ragflow.io/docs/dev/categorize_component) component, which is also used for multi-pronged strategies. The difference is that it does not involve an LLM and that there is a *clearer* line between the conditions it defines.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule based and LLM based.

@writinwaters writinwaters marked this pull request as draft January 17, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants