Role Instruction Design Guide

You can use the AI tool for generating role instructions created by MaiAgent to help perfect your role instructions

🎭 What are "Role Instructions"?

Imagine you're directing a movie and need to tell actors what roles to play, what personalities they have, and how they should speak. Role instructions are like a "script" for AI, telling it what kind of customer service representative to be.

📚 Technical Terms Dictionary

Before we begin, let's understand some important concepts:

🤖 AI Agent

  • Analogy: Like hiring a virtual employee

  • Description: An AI system that can autonomously execute tasks, serving as your digital customer service specialist

💬 Prompt

  • Analogy: A "work instruction manual" for AI

  • Description: Text instructions telling AI what to do and how to do it

🎯 Context

  • Analogy: The "memory" and "background information" of conversations

  • Description: Relevant information needed for AI to understand the current dialogue situation

🔄 Token

  • Analogy: AI's "units" for understanding text, like breaking sentences into small pieces

  • Description: The basic unit for AI text processing, affecting processing efficiency and cost


🌟 Why are Role Instructions So Important?

AI Customer Service Without Role Instructions 😵

User: "Why hasn't my order arrived yet?"
AI: "According to system data, your order status is processing."

Feels like talking to a robot, cold and impersonal

AI Customer Service With Good Role Instructions 😊

User: "Why hasn't my order arrived yet?"
AI: "I completely understand your concern! Let me check your order status right away.
     According to tracking information, your package is currently at the distribution center,
     expected to arrive tomorrow afternoon. Would you like me to provide the tracking number?"

Feels like talking to a real customer service representative, warm and professional


🏗️ The Four Pillars of Role Instructions

1. 🎭 Identity Positioning (Who)

Tell AI "who you are"

❌ Vague Identity

You are a customer service representative

✅ Clear Identity

You are "Mei", a senior customer service specialist at MaiAgent company,
with 5 years of customer service experience, specializing in product consultation and problem-solving.

2. 🗣️ Tone and Style (How)

Tell AI "how to speak"

Tone Selection Guide:

  • Professional Formal: Suitable for finance, legal, medical industries

  • Friendly and Kind: Suitable for retail, food service, lifestyle services

  • Lively and Young: Suitable for gaming, entertainment, fashion industries

  • Warm and Caring: Suitable for education, health, social services

Example: Friendly and Kind Style

When responding, please use a warm, friendly tone,
appropriately use "您" to show respect,
can include friendly phrases like "Happy to serve you",
but avoid excessive enthusiasm or too many exclamation marks.

3. 🎯 Professional Capabilities (What)

Tell AI "what you can do"

Your professional capabilities include:
- Product feature introduction and usage guidance
- Order inquiry and logistics tracking
- Return and exchange policy explanation
- Initial technical problem diagnosis
- Account and payment issue handling

When encountering issues beyond your capabilities,
please actively refer to human customer service.

4. 📋 Code of Conduct (Rules)

Tell AI "what you can and cannot do"

Principles to follow:
✅ Protect user privacy, don't disclose personal information
✅ Acknowledge what you don't know, don't make up answers
✅ Stay calm when handling complaints, apologize first then solve
✅ Keep responses within 100 words, stay concise

Absolutely forbidden:
❌ Promise things that can't be delivered
❌ Argue with or contradict users
❌ Disclose internal company information
❌ Handle refund requests beyond authority

🛠️ Practice: Design Your First Role Instructions

Step 1: Analyze Your Business Needs

Consider these questions:

  • Who are your customers? (Age, occupation, usage habits)

  • What are your product/service features?

  • What questions do customers ask most often?

  • What kind of service experience do you want to provide?

Step 2: Choose Appropriate Role Settings

🏪 E-commerce Customer Service Example

You are "Helper", a professional online shopping consultant.
You are familiar with all product information, excel at recommending suitable products,
and can quickly handle order-related issues.
Your speaking style is friendly and natural, caring about customer needs like a friend.

🏥 Medical Customer Service Example

You are "Health Assistant", a professional medical service consultant.
You have basic medical knowledge, can provide information about appointments and examination procedures,
but absolutely do not provide medical diagnostic advice.
Your speaking style is professional and warm, making patients feel at ease.

Step 3: Write Complete Role Instructions

📝 Role Instruction Template

# Role Identity
You are [role name], [company name]'s [position].
[Role background and professional experience]

# Service Goals
Your main task is [core task],
helping customers [achieve goals] through [service methods].

# Language Style
- Tone: [Choose appropriate tone]
- Wording: [Specific wording requirements]
- Length: [Response length limits]

# Professional Capabilities
You can handle the following issues:
- [Capability list 1]
- [Capability list 2]
- [Capability list 3]

# Code of Conduct
Must follow:
✅ [Rule 1]
✅ [Rule 2]

Absolutely forbidden:
❌ [Prohibition 1]
❌ [Prohibition 2]

# Special Situation Handling
When encountering [special situation], please [handling method].

🎨 Advanced Techniques: Make Your Role Instructions More Vivid

1. 🎪 Add Personality Traits

Regular Version:

You are a customer service representative, responsible for answering questions.

Vivid Version:

You are "Xiao Zhi", a tech enthusiast full of curiosity.
You're always excited about new features, and like using simple analogies
to explain complex technical concepts, making them easy for everyone to understand.

2. 🎯 Contextualized Instructions

Adjust responses according to different situations:

# Context-Aware Instructions
- When customers express dissatisfaction: Respond with empathy first, then provide solutions
- When customers ask technical questions: Explain using everyday analogies
- When customers are hesitant about purchasing: Provide objective advice, don't force sales
- When customers praise products: Express gratitude and ask if they need other assistance

3. 🔄 Dynamic Adjustment Mechanism

# Conversation Adaptability
Adjust your style based on customer responses:
- If customers use formal language, you should be relatively formal
- If customers are impatient, be more concise and efficient
- If customers are talkative, you can extend topics slightly

4. Version Control Friendly

  • Add version numbers and update logs

  • Maintain backward compatibility, ensuring existing processes work correctly after role instruction updates

Example:

Version: v1.0
# Update Date: October 26, 2024
# Update Log:
#   - Initial version, providing basic product recommendation functionality.
#   - Recommend products based on user preferences.
#   - Response tone set to friendly and professional.

🚀 Testing and Optimizing Your Role Instructions

Phase 1: Basic Testing

Test AI responses to common questions to see if they meet expectations

Test Question Examples:

  • "What's your return policy?"

  • "When will my order arrive?"

  • "Is this product suitable for me?"

Phase 2: Boundary Testing

Test AI performance in extreme situations

Boundary Situation Examples:

  • When customers are emotionally agitated

  • When encountering unknown questions

  • When asked to do something beyond authority

Phase 3: Continuous Optimization

📊 Collect Data

  • Customer satisfaction scores

  • Problem resolution rate

  • Human customer service transfer rate

🔧 Adjustment Strategy

  • Supplement knowledge base based on common questions

  • Adjust language style based on customer feedback

  • Improve code of conduct based on failure cases


📝 System Prompt Length Control Techniques

Best Practice Guidelines

System Prompt ideal length should be controlled within 500-2000 characters (about 200-800 tokens), with common optimal values between 800-1500 characters.

Remember one core principle: "Clarity beats verbosity" — too long instructions are easily ignored by the model, while too short may lead to unstable behavior.

Why is Length Important?

First is model performance consideration, too long prompts distract the model's attention, affecting key instruction execution. Second is Context space limitation, System prompt occupies dialogue context window, compressing user conversation space. Finally is maintenance cost, concise structured prompts are easier to continuously optimize and adjust.

Three Writing Techniques

Structured Design: Clear sections with core instructions at the front.

Simplification Principle: Remove repetitive descriptions and lengthy background, keep only necessary rules.

Continuous Validation: Conduct A/B testing for different models (GPT, Claude, Gemini) to find optimal length configuration.

Practical Considerations

Different AI models have varying tolerance for long prompts, requiring individual testing and validation. In token calculation, Chinese is about 1 character equals 1 token, while English is about 1 token equals 0.75 words. Since System prompt has higher instruction weight, it's recommended to keep content focused and avoid unnecessary verbose descriptions.


💡 Common Questions and Solutions

Q1: How to make AI responses more natural?

A: Add specific dialogue examples in role instructions and set clear language style guidance.

Q2: What if AI keeps answering irrelevant questions?

A: Clearly define service scope in role instructions and teach AI how to identify and handle out-of-scope questions.

Q3: How to balance professionalism and friendliness?

A: Adjust according to your target audience. B2B customers prefer professionalism, B2C customers prefer friendliness. Design A/B tests to find the best balance point.


🎉 Conclusion: Create Your Own AI Customer Service

Designing role instructions is like training a new employee, requiring patience and continuous adjustment. Remember these key principles:

  1. 🎯 Clear Positioning: Clearly tell AI who it is

  2. 🗣️ Consistent Style: Maintain uniformity in language style

  3. 📋 Clear Boundaries: Clearly define what can and cannot be done

  4. 🔄 Continuous Optimization: Keep improving based on actual usage

Start designing your first role instructions now! Remember, the best role instructions are continuously perfected through actual use.

Last updated

Was this helpful?