Skip to main content
Version: DEV

Introduction to agents

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

NOTE

Before proceeding, ensure that:

  1. You have properly set the LLM to use. See the guides on Configure your API key or Deploy a local LLM for more information.
  2. You have a knowledge base configured and the corresponding files properly parsed. See the guide on Configure a knowledge base 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.

agents

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_templates

  2. To create an agent from scratch, click the Blank card. Alternatively, to create an agent from one of our templates, hover over the desired card, such as General-purpose chatbot, click Use this template, name your agent in the pop-up dialogue, and click OK to confirm.

    You are now taken to the no-code workflow editor page. The left panel lists the components (operators): Above the dividing line are the RAG-specific components; below the line are tools. We are still working to expand the component list.

    workflow_editor

  3. General speaking, now you can do the following:

    • Drag and drop a desired component to your workflow,
    • Select the knowledge base to use,
    • Update settings of specific components,
    • Update LLM settings
    • Sets the input and output for a specific component, and more.
  4. Click Save to apply changes to your agent and Run to test it.

Components

Please review the flowing description of the RAG-specific components before you proceed:

ComponentDescription
RetrievalA component that retrieves information from specified knowledge bases and returns 'Empty response' if no information is found. Ensure the correct knowledge bases are selected.
GenerateA component that prompts the LLM to generate responses. You must ensure the prompt is set correctly.
InteractA component that serves as the interface between human and the bot, receiving user inputs and displaying the agent's responses.
CategorizeA 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.
MessageA 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.
RelevantA 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.
RewriteA 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.
KeywordA component that retrieves top N search results from wikipedia.org. Ensure the TopN value is set properly before use.
NOTE
  • Ensure Rewrite's upstream component is Relevant and downstream component is Retrieval.
  • Ensure the downstream component of Message is Interact.
  • The downstream component of Begin is always Interact.

Basic operations

OperationDescription
Add a componentDrag and drop the desired component from the left panel onto the canvas.
Delete a componentOn the canvas, hover over the three dots (...) of the component to display the delete option, then select it to remove the component.
Copy a componentOn the canvas, hover over the three dots (...) of the component to display the copy option, then select it to make a copy the component.
Update component settingsOn the canvas, click the desired component to display the component settings.