ClickAI Docs
ClickAI Docs En
ClickAI Docs En
  • Welcome
  • GETTING STARTED
    • Sign up
    • Personal Setting
  • FUNCTION
    • AI Assistant
    • Creative
    • Community
      • Community User Guide
        • Post
        • Course
        • Event
        • Member
          • Leaderboard
        • Comunity Description
        • AI Avatar
      • Create Community
        • Create About Page
        • Create Course
        • Create Leaderboard
        • Create Bot Store
    • Academy
    • Studio
      • Create Chatbot
      • Create ChatFlow
        • Key Concepts
        • Variables
        • Node Description
          • Start
          • Trả Lời Trực Tiếp
          • Large Language Model (LLM)
          • Knowledge Retrieval
          • Question Classifier
          • Conditional Branch IF/ELSE
          • Code Execution
          • Template
          • Doc Extractor
          • List Operator
          • Variable Aggregator
          • Variable Assigner
          • Iteration
          • Parameter Extraction
          • HTTP Request
          • Tools
        • Shortcut Key
        • Orchestrate Node
        • File Upload
        • Additional Features
        • Debug and Preview
          • Preview and Run
          • Step Run
          • Conversation/Run Logs
          • Checklist
          • Run History
        • Application Publishing
      • Create Agent
      • Create Workflow
  • PAYMENT
    • Subscription Plans
    • Community subscription
    • Course subscription
  • POLICIES
    • Privacy Policy
    • ClickAI Community Guidelines
    • Affiliates Policy
Powered by GitBook
On this page
  1. FUNCTION
  2. Studio
  3. Create ChatFlow
  4. Node Description

Knowledge Retrieval

PreviousLarge Language Model (LLM)NextQuestion Classifier

Last updated 6 months ago

The Knowledge Base Retrieval Node is designed to query text content related to user questions from the Dify Knowledge Base, which can then be used as context for subsequent answers by the Large Language Model (LLM).

Configuring the Knowledge Base Retrieval Node involves three main steps:

  1. Selecting the Query Variable

  2. Choosing the Knowledge Base for Query

  3. Configuring the Retrieval Strategy

Selecting the Query Variable

In knowledge base retrieval scenarios, the query variable typically represents the user's input question. In the "Start" node of conversational applications, the system pre-sets "sys.query" as the user input variable. This variable can be used to query the knowledge base for text chunks most closely related to the user's question. The maximum query content sent to the knowledge base is 200 characters.

Choosing the Knowledge Base for Query

Within the knowledge base retrieval node, you can add an existing knowledge base from Dify. For instructions on creating a knowledge base within Dify, please refer to the knowledge base help documentation.

Configuring the Retrieval Strategy

It's possible to modify the indexing strategy and retrieval mode for an individual knowledge base within the node. For a detailed explanation of these settings, refer to the knowledge base help documentation.

Dify offers two recall strategies for different knowledge base retrieval scenarios: "N-to-1 Recall" and "Multi-way Recall". In the N-to-1 mode, knowledge base queries are executed through function calling, requiring the selection of a system reasoning model. In the multi-way recall mode, a Rerank model needs to be configured for result re-ranking. For a detailed explanation of these two recall strategies, refer to the retrieval mode explanation in the help documentation.