Welcome to DOFBOT-Ultra repository
8. AI agent workflow
AI Agent Workflow
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!!!
AI Agent Workflow1. Course Content2. Start Dify Service3. Case Study: Classified Q&A Chatbot4. Visual Debugging Workflow5. Accessing the AI Agent Application
1. Course Content
Use multiple AI large models to build an agent workflow, implementing complex logic functions.
Note: DOFBOT-PRO uses the Dify chatbot class. This tutorial is provided for users interested in learning and development to build and use.
2. Start Dify Service
The Dify backend runs on the host system of the DofbotUltra motherboard, not inside a Docker container.
After connecting to the device via VNC or SSH, execute the following command in any directory on the host system to start Dify:
bringup_dify
After startup, you can check the device's IP address via the OLED screen,
ifconfig, or directly in the terminal. Enter the IP address in the browser address bar of a computer on the same LAN to access the Dify management page.
Tip
If you have not configured the model provider API Key yet, please complete the previous
02-Configure API-KEYcourse before proceeding with subsequent workflow configuration.If the browser cannot access it, execute
docker pson the host system to confirm that thelanggenius/dify-*related containers are in theUpstate.

3. Case Study: Classified Q&A Chatbot
In this course's example AI application folder, there is a reference example that can be imported directly.
In the Dify homepage studio, click Import DSL File.

Select the example AI application
Complex agent.ymlfrom this course's folder, then click Create.

The workflow content is shown below.

In the workflow,
Question Classifieris a module driven by an AI large model. Its function is to classify user questions into math problems, physics problems, or other problems. If the user input is related to math or physics, it will call different branches of AI large models to answer. TheQuestion Classifierclassification content is as follows:

Among them, the LLM-1 branch is used to answer questions related to mathematics. The prompt and settings are as follows:

The LLM-2 branch is used to answer questions related to physics. The prompt and settings are as follows:

4. Visual Debugging Workflow
If you need to debug and test the workflow effect, click Preview in the upper right corner, then enter a question in the pop-up dialog to test.

At the same time, the workflow will display the branch the data flows through in real-time, making it convenient to debug the workflow.

If you need to extend the workflow, click the + button on the left, which contains multiple Dify preset tools and modules.

5. Accessing the AI Agent Application
After completing the AI application orchestration, click Publish Application to save the configuration. Then click Copy URL or API Access Credentials to access the created AI application via a web page or backend service API.
