Coze Agent Workflow: System Prompt VS User Prompt, How to Use It?

When developing agent workflows on the Coze AI platform, system prompts and user prompts are the core elements of building conversational interactions. There are significant differences between the two in terms of function positioning, role level and application scenarios, which directly affect the behavior mode and output quality of the agent. This article will elaborate on the differences between system prompts and user prompts through function comparison, scenario analysis, and typical cases, and provide design practice suggestions to help novice users better understand and apply these two prompts to achieve efficient dialogue and interaction between agents.

When developing agent workflows on the Coze AI platform, system prompts and user prompts are the core elements of building conversational interactions. There are significant differences between the two in terms of function positioning, role level and application scenarios, which directly affect the behavior mode and output quality of the agent.

When building an agent workflow, it is not easy for novice users to distinguish the difference between system prompts and user prompts.

Below we will explain it to you through functional comparison, scenario analysis and typical cases.

01 Comparison of core function differences

System prompt: The underlying operating system of the agent

1. Role definition function Establish the identity of the agent, such as “You are a senior nutritionist” or “You are an AI customer service representative of an e-commerce platform”. This role setting will continue to affect all subsequent interactions.

2. The behavioral norm is set by clearly restricting the output mode by directives: “answers need to cite authoritative medical literature”, “avoid using professional terms”, etc. For example, the medical scenario setting “When a user describes a condition, he must be advised to seek medical treatment offline”.

How can product managers do a good job in B-end digitalization?
All walks of life have taken advantage of the ride-hail of digital transformation and achieved the rapid development of the industry. Since B-end products are products that provide services for enterprises, how should enterprises ride the digital ride?

View details >

3. Limit the scope of knowledge and delineate information boundaries: “Your knowledge is as of July 2023” to prevent the generation of out-of-the-line content. The educational agent will set “only use the knowledge points of the People’s Education Edition textbook to answer”.

4. Interaction style shaping defines language characteristics: “use friendly colloquial expressions” or “maintain a formal business tone”. For example, legal consulting robots need to be set up with “answers must be rigorous and objective, without subjective judgment”.

User prompt: Action instructions that trigger the agent’s response

1. Instant task triggering provides specific interactive goals, such as “Help me make a fat loss menu”. These instructions directly determine the output of a single interaction.

2. Contextual association establishes semantic association through conversation history: “Refer to the training plan just mentioned and adjust the diet plan”. Supports continuous understanding of multiple rounds of conversation.

3. Output format control specifies structural requirements: “Use a table to display this week’s recipes, including breakfast, noon, and dinner” or “Use Python code to implement the sorting algorithm”.

4. Emotional guidance includes tone tendencies: “Evaluate my learning progress with encouraging language” or “Explain the laws of physics in a humorous way”.

02 Analysis of application scenario differences

Typical application scenarios for system prompts

1. Long-term memory is built In the psychological counseling robot scenario, the system prompts the setting: “Remember the key life events mentioned by the user during each consultation, and establish a long-term file but strictly confidential”.

2. Risk control mechanism Financial consulting agent setting: “When users inquire about specific stock symbols, they must state that ‘this suggestion does not constitute investment guidance'”.

3. Multimodal output configuration sets the image and text generation rules: “When the user requests a recipe, list the text steps first, and then generate the dish picture”.

4. Domain knowledge enhancement legal counsel system reminds: “Priority should be given to quoting the latest provisions of the Civil Code, and if the problem is beyond the scope of knowledge, it must be clearly informed”.

Application scenarios of user prompts

1. Accurate demand extraction of user input: “Compare the camera performance of Huawei Mate60 and Xiaomi Mi 14, and use radar maps to show the difference in core parameters”.

2. Multi-step instructions for complex task decomposition: “First summarize the innovation points of this paper, then point out the shortcomings of the research method, and finally recommend 3 related literature”.

3. Customize specific format requirements: “organize the meeting points into Markdown format, and the secondary title is marked in blue”.

4. Real-time interaction correction to dynamically adjust the conversation content: “The travel route generated just now is too compact, and each attraction is reserved for 2 hours when re-planning”.

03 Collaborative working mechanism

Parse workflows

example

Take the “intelligent fitness coach” scenario as an example:

1. System layer setting role:

Professional fitness trainer with NASM certification

Code of Conduct:

– Plan based on user medical examination data – Avoid recommending high-risk actions for injury

– Each instruction includes a warm-up reminder

Scope of knowledge: Exercise physiology, nutrition basics

Interaction style: Positive encouragement, use emojis

2. User layer interaction

User input: “I have a body fat percentage of 28%, an old knee injury, please design a 4-week home training plan, including daily dietary suggestions, and use a Gantt chart to show the schedule”.

3. Collaborative output

The agent integrates the safety specifications set by the system and the specific needs of the user, generates a visual schedule with low-impact training movements, protein intake recommendations, and includes warm-up reminders in the daily plan.

Exception Handling Mechanism When the user prompts conflicts with the system settings, such as requesting the formulation of an extreme weight loss plan. The risk control rule in the system prompt will be triggered: “According to the health guidelines, it is not recommended to consume less than 1200 kcal per day, and it is recommended to adjust to a progressive plan”.

04 Typical case library

Case 1: Cross-border e-commerce customer service scenario

System prompt

Identity: The official customer service of an e-commerce merchant serving the Southeast Asian market

Duty:

1. Prioritize handling logistics inquiries

2. Direct the return request to the self-service system

3. The promotion description is accompanied by a link to the official website

Contraindication: Do not promise specific arrival time

Language: Automatic switching between Chinese and English

The user prompt “Order#2023120456 shows a delay in customs clearance, please explain the reason and estimate the arrival time, reply in English”.

The output feature reply contains a logistics process diagram (system setting), but indicates that “the specific timeliness is subject to the actual processing of the customs” (system constraints), and the contact information of the logistics company (user requirements) is listed in English.

Case 2: Academic Paper Assistant

System prompt

Role: Scientific research paper reviewer

Rules:

1. References need to be in the core journal for nearly 5 years

2. The method section checks variable definition completeness

3. Refuse ghostwriting services and only provide suggestions for revisions

Format: The revision suggestion is presented in revision mode

User prompt “Please check the experimental design section, focus on verifying the rationality of the control group settings, and indicate the content that needs to be supported by supplementary data”.

The output features indicate that the sample size of the control group is insufficient in the form of annotations (system rules), and 5 experimental design literatures published in the past three years (system constraints) are recommended, and the locations that need to be supplemented are marked in red (user format requirements).

05 Design practice

suggestion

1. The system prompt optimization principle adopts a hierarchical structure, with basic roles → knowledge rules → interaction specifications. Implant verification mechanisms, such as when a user asks for a medical diagnosis, they must ask for specific symptoms. Reserve extension interfaces to guide users to redefine requirements when encountering undefined scenarios.

2. User prompt design skills element structuring: background requirements + output requirements + format examples. Progressive guidance, using the “total-score” structure to describe the topic, first summarize the topic, and then explain in detail. Dynamically remediate the strategy, if Option A is not feasible, provide Alternative B, and key points of variance.

3. Debug the methodology boundary test, input user prompts beyond the system setting range, and observe the effectiveness of the constraint mechanism. Stress testing, continuously sending contradictory instructions, and testing context management capabilities. Finally, the system prompts value orientation, knowledge boundaries and interaction paradigms to ensure the stability and safety of agent operation.

The user prompt is used as a dynamic trigger to form a specific task path through real-time demand injection, driving the agent to achieve precise scene adaptation. Through the resonance effect of the dual prompt system, the dynamic balance between controllability and intelligence is finally achieved.

End of text
 0