Welcome to DOFBOT SE repository
7. RAG knowledge base + chatbot
RAG Knowledge + Base Chatbot
RAG Knowledge + Base ChatbotCourse ContentStart Dify ServiceCase 1: Task PlanningCase 2: Knowledge ManagementCreate a Knowledge BaseCreate an Application
Course Content
On the basis of the previous RAG knowledge base and chatbot, develop an AI application that combines both to improve the AI large model's answer capability in specific domains and reduce AI large model hallucinations through the RAG knowledge base.
Start Dify Service

Check the virtual machine's IP address. You can find it in yellow on the terminal or by entering
ifconfigor checking directly in the terminal. Enter the virtual machine's IP address in the browser address bar to access the Dify management page.
Case 1: Task Planning
Tip
Case 1 here simulates the decision layer functionality of Dofbot-SE.
Click Create from Blank on the homepage.

Click to select Chatbot from MORE BASIC APP TYPES ——> Name your application ——> Create

Example prompt
You are a task planning master. Using your knowledge, break down complex tasks into steps.
After creating the application, enter the prompt in the INSTRUCTIONS section, and then click "Add" in the knowledge options.

Select the knowledge base you want to add, then click "Add".

Then select an AI large model to connect. Here we use
qwen-maxas an example.

Then enter test conversation content. Here we take tracking as an example. You can see that the AI large model can think and respond combined with the knowledge base content. Through this method of adding training samples to the knowledge base, you can quickly expand the AI large model's response capability and learning ability in different task scenarios and domains.

We can first delete the knowledge base to compare the AI large model's response effect without the RAG knowledge base. You can see that without the knowledge base, the general AI model from the model provider cannot handle vertical domain tasks.
Tip
The hands-on case here can be combined with the theoretical knowledge of "2. RAG Retrieval Augmentation and Training Samples" for understanding and mastery.

Case 2: Knowledge Management
When we have internal materials that need to be managed by a large model, we can combine the AI large model with RAG and the knowledge base. This allows the large model to respond combined with actual business materials, which is very helpful for vertical domains such as finance and healthcare.
Create a Knowledge Base
Here we take an example material, which includes a virtual literary author and a collection of virtual works. The example material can be found in this section's course folder.

Create an Application
Example prompt
xxxxxxxxxx# Role PositioningYou are a seasoned knowledge management expert with extensive practical experience in knowledge system construction, information filtering and integration, knowledge accumulation, and empowerment. Your core mission is to help users establish a clear and efficient knowledge management system, achieving accurate knowledge collection, systematic organization, in-depth accumulation, and flexible application, thereby helping users improve their learning/work efficiency and avoid knowledge fragmentation.
Enter the example prompt and select the virtual author's knowledge base. Then ask questions about the works in the material. At this time, the AI large model can answer based on the private knowledge base.
