Welcome to DOFBOT-Ultra repository
6. Deploy the RAG knowledge base
Deploy Local RAG Knowledge Base
Please ensure that the web control program backend process is not running in the background. To close it, refer to the [Get Started Quickly - 2. Access the Terminal] section in [Disable the Auto-Start Web Control Backend Process]. After closing, please restart DofbotUltra!!!
Deploy Local RAG Knowledge Base1. Course Content2. Start Dify Service3. View Preset Knowledge Bases4. Extend RAG Knowledge Base4.1 Economy Mode Knowledge Base4.2 High Quality Mode Knowledge Base4.3 Recall Test
1. Course Content
Master the workflow for local deployment, debugging, and testing of RAG knowledge bases
Master the method for extending RAG knowledge bases according to your specific task scenarios
Tip
RAG knowledge bases help general AI large models provide reference knowledge in vertical domains, avoiding hallucination responses from AI models and increasing the model's response capability in vertical domain knowledge
RAG knowledge bases can help robots quickly expand their generalization capabilities in different task scenarios
2. Start Dify Service
Dify backend runs on the host machine of the DofbotUltra mainboard, not inside a docker container
After connecting to the vehicle via VNC or SSH, execute the following command in any directory on the host to start Dify:
bringup_dify
After startup is complete, you can view the vehicle's IP address through the OLED screen,
ifconfig, or directly in the terminal. Enter this IP in a browser on the same local area network to access the Dify management page.
Tip
If you haven't configured the model provider API Key yet, please complete the
02-Configure API-KEYcourse from earlier in this chapter before continuing with the knowledge base and model configurationIf the browser cannot access it, you can execute
docker pson the host to confirm thatlanggenius/dify-*related containers are in theUpstate

3. View Preset Knowledge Bases
Click on the Knowledge Base page on the homepage. Dify comes pre-configured with 2 RAG knowledge bases from the factory. The content is the same, only the language differs.
Tip
The preset knowledge bases here provide some training examples for task scenarios, helping AI models quickly master relevant skills

Open a knowledge base, which contains the
Decision Layer Example Librarypreset file, where:Decision Layer Example Library: stores some preset reference examples related to specific task scenarios

4. Extend RAG Knowledge Base
If you need to extend a new knowledge base, click Create Knowledge Base

Here we use importing local data as an example for the data source
Click Import Existing Text ———> Select File ———> Next

Then enter the knowledge base configuration page. Click Preview Chunk to view the chunking effect of the file. Here select Economy for the index mode
Tip
For beginners, it is recommended to use Economy mode for learning and testing first. The differences between the two index modes are:
Economy: retrieves content in the knowledge base through keywords, cannot perform extended retrieval of similar semantics, and the method of retrieving knowledge fragments is relatively rigid
High Quality mode: requires an embedding model that consumes additional tokens and needs a rerank model, can achieve more accurate retrieval of similar semantic fragments
The factory default knowledge base mode is High Quality mode
4.1 Economy Mode Knowledge Base
After selecting the following configuration, click Save and Process

Then wait for the embedding to complete, click Go to Documents