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.
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.
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.
-
- 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.
- When a log similar to the following appears, it indicates that the upgrade started successfully:
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.
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.
- Reset the RAGFlow service: exist
docker-compose.yml
Execute it in the directory where the file is locateddocker-compose up -d
command to bring the configuration into effect.
- Access to RAGFlow: pass (a bill or inspection etc)
127.0.0.1:8000
Visit the RAGFlow page.
Getting RAGFlow API Information
- 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.
- Get the API server address: Copy the "API Server Address" on the same page.
- Get the Knowledge Base ID: Go to the RAGFlow knowledge base to be integrated and copy the knowledge base ID in the address bar.
Adding an External Knowledge Base to Dify
- Go to Dify Knowledge Base Management: On the Dify page, select "Knowledge Base" -> "External Knowledge Base".
- Add an external knowledge base: Click "Add External Knowledge Base".
- 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.
- Get Intranet IP.
- Windows: In the console, type
ipconfig
The - Linux: Input
ifconfig
The
- Windows: In the console, type
- Get Intranet IP.
- Click "Save".
- Connecting to external knowledge bases:
- 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".
Effectiveness Test
To validate the integration, create a Dify application and associate it with the RAGFlow knowledge base you just created.
- Create the Dify app: Create a blank application to associate with the RAGFlow knowledge base.
- Take a quiz test: Create separate test applications in Dify and RAGFlow (with consistent parameter tuning) for the same Q&A test.
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.
Only one of all Corsair memory sticks in the original table data is 32G.
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.