Quickly Setting Up an Agent
Overview
With the continuous progress of AI technologies, the application of large models in the medical field is gradually maturing. By combining medical knowledge bases, NLP, and intelligent interaction technologies, the medical consultation assistant agent can provide preliminary health consultation, symptom analysis, and diagnosis suggestions for patients, while reducing the workload of doctors and improving the efficiency of medical services.
This tutorial describes how to set up a medical consultation assistant on the agent development platform to obtain healthcare suggestions.
Agent Q&A Effect
When you talk with the medical consultation assistant agent, the agent can simulate the doctor's consultation method to guide you to provide symptom information and provide healthcare suggestions.

Step 1: Creating an Agent
- Log in to the agent development platform.
- Choose Workstation > Application. In the upper right corner of the page, click Create App.
- Enter the application name and description, and select an icon as the avatar for the agent.
- Click OK.
After an agent is created, the agent orchestration page is displayed. You can:
- Describe the persona and task of the agent in the prompt area on the left.
- In the Skill area in the middle, configure various extended skills for the agent.
- In the Dialogue experience area in the middle, configure multiple dialogue configurations for the agent.
- In the Preview Debugging area on the right, debug the agent in real time.

Step 2: Writing Prompts
The first step for configuring an agent is to writing prompts, that is, the persona and reply logic of the agent. prompt defines the basic persona of the agent, which continuously affects the agent's response quality in all conversations. You are advised to specify the role, task description, constraints, execution steps, and output format of the model in the persona and reply logic.
Enter a prompt in the prompt area on the agent configuration page. For example, the prompt for a medical consultation assistant can be set to:
You are a private digital health manager. You can conduct consultations, ask about the patient's condition, and provide advice and treatment plans. \n\n\n Requirements:\n 1. Focus on questions about diseases, symptoms, examinations, and medicines.\n 2. When a patient describes symptoms, ask follow-up questions. Ask up to two questions each time to guide the patient in describing their symptoms and health records in detail (including medical history, surgical history, medication history, and family medical history) to better assist diagnosis.\n 3. If the patient has provided sufficient information, or the patient's main problems and symptoms are clear enough, summarize the health conditions and provide suggestions for necessary examinations, treatment plans, and the clinics to visit.\n 4. Provide accurate and concise answers relevant to the patient's current health status or problems. Do not deviate from the topic.\n 5. **Do not repeat questions in historical dialogs**. If the patient does not answer a question, no further questions will be asked.\n 6. **Do not repeat the symptoms described by the patient**. Ensure that the dialog is novel and relevant.\n 7. Reply with no more than 100 words. Put each sentence in a separate paragraph.\n 8. Do not reply to casual chat or questions that are not related to medical knowledge.\n Please strictly follow the above rules and provide only **necessary and concise** answers.

You can use the intelligent prompt optimization function of the platform to optimize the preceding prompts.

The optimization result is as follows:
## Persona - Role: personal digital health manager - Professional skills: disease diagnosis, symptom analysis, examination suggestions, and drug treatment suggestions ## Job Description - Objective: Learn about patients' conditions through consultation and provide necessary suggestions and treatment solutions. - Positive impact: Help users better understand their health status and provide targeted medical advice. ## Constraints - Focus on diseases, symptoms, examinations, and drugs, understand the patient's condition, and provide necessary suggestions and treatment solutions. - A maximum of two questions can be asked at a time. - Do not repeat questions in historical dialogs. - Do not repeat the symptoms described by the patient. - The answer contains a maximum of 100 words, and each sentence is wrapped. - Do not answer questions other than medical knowledge. ## Procedure 1. Ask the patient about the main symptoms. 2. Based on the patient's description, ask for background information (past medical history, surgery history, drug use history, and family medical history). 3. Summarize the patient's condition, provide necessary examination and treatment solutions, and provide necessary suggestions and treatment solutions. ## Output format - Style: Accurate, concise, and directly related to the patient's current health status or issues. - Word count: no more than 100 words. - Format: Each sentence must be placed in a separate line.
(Optional) Step 3: Adding Skills to the Agent
If the model capabilities can cover the agent functions, you only need to write prompts for the agent. However, if the functions designed for an agent cannot be implemented only through model capabilities, you need to add skills to the agent to expand its capability boundary. For example, the training data of the model is public data on the Internet, and the model usually does not have industry-specific professional knowledge. If the application involves intelligent Q&A scenarios in professional fields, you need to add a dedicated knowledge base to the agent to solve the problem of insufficient professional knowledge of the model. For details, see Improving Skills for Agents.
As a medical consultation assistant chatbot, the model can basically achieve the expected effect. However, if you want to add more skills to the assistant, for example, search for answers through the search engine when the model cannot answer questions, you can add a web search plug-in to the agent.
- In the skill area on the orchestration page, click the + icon corresponding to the Plugin function.
- On the Add plugins page, search for WebSearch, select the plug-in, and click OK.
Figure 5 Adding a plug-in
- Modify the persona setting and reply logic in the prompt area to instruct the agent to use the WebSearch plug-in to answer uncertain questions. Otherwise, the agent may not call the plug-in as expected.
Figure 6 Modifying the prompt
Step 4: Setting a Prologue Recommended Questions, and Follow-up Questions
- Add a prologue.
You can add a prologue for your agent. The prologue will be displayed as a pop-up message to users as a prologue. You can also click Intelligent Add in the upper right corner of the prologue area to automatically generate a prologue.
Figure 7 Adding a prologue - Add recommended questions.
You can add some preset recommended questions for your agent. You can add some recommended questions for the medical consultation assistant, for example, "How can I increase muscle mass?" "A little cough lately," "I have a stomach pain," etc.
You can also click Intelligent Add in the upper right corner of the Recommended Questions area to automatically generate some recommended questions.
Figure 8 Adding a recommended question - Set follow-up questions.
After each round of reply, the system provides suggestions based on the dialog content by default. You can enable or disable the follow-up question function. You can also customize follow-up question generation rules. The following are examples:
Figure 9 Setting a follow-up question
Step 5: Debugging the Agent
After configuring the agent, you can test whether it meets the expectation in the Preview Debugging area.

Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot