AI Personal Learning
and practical guidance
Beanbag Marscode1

Dify Integration with the RAGFlow Knowledge Base: A Practical Guide to Enhancing Q&A Effectiveness

Recently, Dify released version v1.0.1, which fixes some issues that existed in the previous version. According to user feedback, many users are not satisfied with the Dify integrated (as in integrated circuit) RAGFlow This article details the steps involved in integrating Dify with the RAGFlow knowledge base and evaluates the results of the integration. In this article, we will detail the steps to integrate Dify with the RAGFlow knowledge base, and evaluate the actual results of the integration. It also describes how to upgrade your local Dify to the latest v1.0.1 version.

blank


 

Introduction to Dify and RAGFlow

Before we dive into the integration details, let's take a brief look at Dify and RAGFlow.

  • Dify. Dify is an open source LLM application development platform that allows developers to orchestrate and operate LLM applications visually.Dify supports multiple models and provides plug-ins, datasets, and other features that make it easy for developers to quickly build applications.
  • RAGFlow. RAGFlow is a knowledge base management tool based on Retrieval Augmented Generation (RAG) technology. It transforms unstructured data into structured knowledge and provides efficient retrieval and Q&A capabilities.RAGFlow supports a wide range of data sources and provides a user-friendly interface.

 

Dify upgraded to v1.0.1

For users deploying Dify with Docker, you can follow the steps below to upgrade to version v1.0.1:

 

Backup configuration files: Go to the root directory where the Dify source code is located in the /docker Catalog, Backup docker-compose.yaml Documentation.

 

blank

 

 

Get the new version of the configuration file: Download version v1.0.1 from Dify's GitHub repository docker-compose.yaml file, replacing the /docker old files in the directory.

 

blank

 

    • For those who don't have direct access to GitHub, the new version of the configuration file is available on Dify's official communication channels (e.g., public).

 

Updated and launched: exist /docker directory in the console to execute the docker-compose up -d Command.

 

blank

 

  • When a log similar to the following appears, it indicates that the upgrade started successfully:

 

blank

 

 

Verify the version: Visit the Dify page (127.0.0.1), click on your avatar in the upper right corner and check if the version number is v1.0.1 in the drop-down box.
blank

 

Dify Integration RAGFlow Knowledge Base

Dify supports the enhancement of Q&A capabilities with external knowledge bases, and RAGFlow officially provides an API to interface with Dify, making the integration process very smooth.

Resolving Port Conflicts

When deploying RAGFlow and Dify locally, you may encounter port conflicts (both use ports 80 and 443 by default). To avoid conflicts, it is recommended to change the default ports for RAGFlow.

  • Modify the RAGFlow port: In RAGFlow's docker-compose.yml file maps port 80 of the container to port 8000 of the host and port 443 to port 4333 of the host.

blank

  • Reset the RAGFlow service: exist docker-compose.yml Execute it in the directory where the file is located docker-compose up -d command to bring the configuration into effect.

blank

  • Access to RAGFlow: pass (a bill or inspection etc) 127.0.0.1:8000 Visit the RAGFlow page.

blank

Getting RAGFlow API Information

  1. Create an API Key: On the RAGFlow page click on the avatar in the upper right corner -> "API" -> "API KEY" -> "Create New Key", copy and save the key.
    blank
  2. Get the API server address: Copy the "API Server Address" on the same page.
  3. Get the Knowledge Base ID: Go to the RAGFlow knowledge base to be integrated and copy the knowledge base ID in the address bar.

    blank

    blank

Adding an External Knowledge Base to Dify

  1. Go to Dify Knowledge Base Management: On the Dify page, select "Knowledge Base" -> "External Knowledge Base".
  2. Add an external knowledge base: Click "Add External Knowledge Base".
    blank
  3. Fill in the RAGFlow information:
    • Name. Customize the name.
    • API Endpoint. write data in a box (on a questionnaire or web form) http://:9380/api/v1/dify(will)  (replaced by the intranet IP of the host where RAGFlow is located).
    • API Key. Fill in the API Key previously created in RAGFlow.

      blank

      • Get Intranet IP.
        • Windows: In the console, type ipconfigThe
        • Linux: Input ifconfigThe
          blank
          blank
    • Click "Save".
  4. Connecting to external knowledge bases:
    blank

    • Knowledge Base ID. Fill in the Knowledge Base ID previously copied in RAGFlow.
    • Top K. Adjust as needed.
    • Similarity Threshold. Adjust as needed.
    • Click on "Connect".
      blank

 

Effectiveness Test

To validate the integration, create a Dify application and associate it with the RAGFlow knowledge base you just created.

  1. Create the Dify app: Create a blank application to associate with the RAGFlow knowledge base.
    blank
  2. Take a quiz test: Create separate test applications in Dify and RAGFlow (with consistent parameter tuning) for the same Q&A test.

blank

According to the test results, the answers of Dify and RAGFlow are basically the same, which indicates that the integration is successful.Dify effectively improves the accuracy of knowledge base Q&A by integrating with RAGFlow.
blank
blank
Only one of all Corsair memory sticks in the original table data is 32G.
blank

 

summarize

Dify's integration with the RAGFlow knowledge base is an effective way to enhance Q&A. RAGFlow's knowledge base parsing and Q&A capabilities make up for Dify's shortcomings in this area. RAGFlow's knowledge base parsing and quizzing capabilities make up for Dify's shortcomings in this area, and the official RAGFlow API makes the integration process very easy.

May not be reproduced without permission:Chief AI Sharing Circle " Dify Integration with the RAGFlow Knowledge Base: A Practical Guide to Enhancing Q&A Effectiveness

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish