AI Personal Learning
and practical guidance

Learning: Performing workflow "state changes" in natural language (state machines)

contexts

Customer service related dialog design often requires the user to confirm that the current action is complete before performing the next action, and there are two ways to accomplish this:

1. Routing 2. Cue words


 

1. Routing

Generally by the big model to determine the state of the user, and then perform the corresponding node service, which is somewhat similar to the arrangement of "intelligent customer service" node. Example: After asking the name, the next step is to get the phone number.

Typical routing transit node hint words:

You will be provided with .
Categorize each  into primary and secondary categories.
Provide the output in Json format with keys:  and . Only the output in Json format needs to be output, nothing else.
Primary category: , ,  or .
 Secondary category: \
Cancel Subscription or Upgrade \\
Add payment method \\
Explanation about fees \
Dispute fee
 Secondary Category: \
General Troubleshooting\\
Device Compatibility \\
Software Updates \\
 Sub Category: \
Reset Password \
Update Personal Information \
Close Account \
Account Security \\
 Secondary Category:
Product Information \
Payment \
Feedback \
Talking to people \
---
Customer Service Enquiry: I want you to delete my personal data and all my user data

exports

{
"primary": "account management", "primary": "account management", "secondary".
"secondary": "Close account"
}

The developer uses this state to continue designing subsequent service nodes.

 

2. Cue word

Retrofit on top of routing instructions to add subsequent service nodes.

You will get .

## Service flow

1. Preferred to confirm the user's problem classification, the problem classification is as follows:

Primary category: , ,  or .
 Secondary category: \
Cancel subscription or upgrade \\
Adding a payment method \\
Explanation about fees \
Dispute fee
 Secondary Category: \
General Troubleshooting\\
Device Compatibility \\
Software Updates \\
 Sub Category: \
Reset Password \
Update Personal Information \
Close Account \
Account Security \\
 Secondary Category:
Product Information \
Payment \
Feedback \
Talking to People \

2. When the user confirms that the question is categorized accurately, answer the operation steps according to the context

3. After the user recognizes the operation steps, and gives the user a friendly greeting and closes the topic.

---

{context}

---

Customer service query: I want you to delete my profile and all my user data

 

When designing prompts, we often describe the "process", one is to let the big model follow the process step by step; the other is to ask the big model to follow the process step by step interaction.

The above cue word example is the latter, which requires a large model as a context to participate in the "judgment", similar to a "state machine".

The cue word describes the shortcomings of the judgment process:Unstable, as historical context is truncated and difficult to describe logically (resulting instability).

 

A new approach given by OpenAI

The principle is simple, define a set of dialog states in the context of a user's dialog:

# Dialog status

```json
{
"id": "1_intro",.
"description": "Guides customers through their needs by providing personal information and information about the occasion they are wearing." ,
"instructions": [
"Greet customers in a friendly manner and inquire about their age, gender, occupation and personal preferences." , "instructions".
"Confirm customers' dressing occasions (e.g., formal, casual, dating, etc.) in order to recommend appropriate clothing ensembles for them."
],.
"examples": [
"Hello! In order to better assist you in choosing a match, could you start by telling me your age, gender, and occupation?" ,
"May I ask what occasion you plan to wear these outfits to? Is it for work, a date or a casual event?"
],.
"transitions": [{
"next_step": "2_recommend_outfit",.
"condition": "After the customer has provided personal information and information about the occasion of dress."
}]
}
``.

```json.
{
"id": "2_recommend_outfit",.
"description": "Recommends appropriate outfits to match based on the information provided by the customer." ,
"instructions": [
"Provides two to three outfit matching suggestions based on the customer's personal information and the occasion they are wearing." , "instructions".
"Provide a detailed description for each pairing, including the type of clothing, how it goes together, and how to accessorize."
],.
"examples": [
"Based on your profession and the business meeting you are about to attend, I recommend a dark suit with a simple tie." ,
"If you're planning to attend a relaxed party, try jeans with a casual shirt and a pair of comfortable shoes."
],.
"transitions": [{
"next_step": "3_get_feedback",
"condition": "The customer has received the clothing recommendation and is ready to give feedback."
}]
}
``

```json.
{
"id": "3_get_feedback",.
"description": "Adjust or confirm recommendations based on customer feedback." ,
"instructions": [
"Ask the customer if they are happy with the recommended pairing and adjust the recommendation based on feedback if they have more specific needs." , "instructions".
"If the client is satisfied with the recommendation, confirm the final pairing and end the conversation."
],.
"examples": [
"What are your thoughts on these pairings? Do they need to be adapted to your needs?" ,
"If you feel this pairing is suitable, then you can start preparing!"

"transitions": [{
"next_step": "4_finalize_outfit",
"condition": "Client confirms satisfaction and finalizes outfit matching."
}]
}
```

```json.
{
"id": "4_finalize_outfit",.
"description": "Confirms the client's finalized match and closes the conversation." ,
"instructions": [
"Confirms the client's finalized match selection." ,
"Wish the client well dressed and happy to attend the occasion."
],
"examples": [
"Great, your pairing has been selected! We hope you will shine at the occasion." ,
"Good luck with your event today, the matching outfits are sure to make you feel more confident!"
],.
"transitions": []
}
```

Full example: https://chatgpt.com/share/678dcc28-9570-800b-986a-51e6f80fd241

 

decode

The above prompt words are the saved dialog state between the AI clothing guide and the user, recording the pre-programmed service flow.

Define 4 service process nodes: guide the question, provide matching suggestions, adjust suggestions based on feedback, and end the dialog after user confirmation.

description defines "flow" and condition defines "circulation".

 

reflections

Building workflows using only natural language provides new ideas. Especially when building Agent collaboration services, this approach may allow for a more rigorous collaboration process.

If the vast majority of services can be realized by retrieving and inserting the context related to the user's question for each conversation state, this may be a lightweight and efficient way to frame conversation service-based AI applications.

May not be reproduced without permission:Chief AI Sharing Circle " Learning: Performing workflow "state changes" in natural language (state machines)

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish