Role Prompts

Giving the Model a Job

A role prompt in the system prompt tells the model who it is: its expertise, audience and limits. "You are a senior returns specialist at ShopEase who explains policies to first-time online shoppers" leads to different vocabulary, detail and caution than "You are a helpful assistant".

Part of a role promptExample
Identity and expertiseYou are a returns specialist at ShopEase.
AudienceCustomers are often first-time online shoppers from tier-2 cities.
GoalsResolve the issue in as few messages as possible.
LimitsYou cannot issue refunds yourself; you create a request for an agent.
StyleShort sentences, no jargon, reply in the customer's language.

Composing Role Prompts

Example

Keep role parts in data so several assistants can share pieces (for example the same limits) without copy-paste:

ROLES = {
    "returns": {
        "identity": "You are a returns specialist at ShopEase.",
        "goals": "Resolve return questions in as few messages as possible.",
    },
    "seller_help": {
        "identity": "You help sellers list products on ShopEase.",
        "goals": "Explain listing rules and fix rejected listings.",
    },
}
SHARED_LIMITS = "You cannot move money. For refunds or payouts, create a request for a human agent."
STYLE = "Use short sentences. Reply in the user's language (English, Hindi or Hinglish)."

def system_prompt(role):
    r = ROLES[role]
    return "\n".join([r["identity"], r["goals"], SHARED_LIMITS, STYLE])

print(system_prompt("returns"))
print("---")
print(system_prompt("seller_help"))

Output

You are a returns specialist at ShopEase.
Resolve return questions in as few messages as possible.
You cannot move money. For refunds or payouts, create a request for a human agent.
Use short sentences. Reply in the user's language (English, Hindi or Hinglish).
---
You help sellers list products on ShopEase.
Explain listing rules and fix rejected listings.
You cannot move money. For refunds or payouts, create a request for a human agent.
Use short sentences. Reply in the user's language (English, Hindi or Hinglish).